diff --git a/Java/Lagoudas/bin/Lag_sme.class b/Java/Lagoudas/bin/Lag_sme.class index e280973b25cd3ec7848b208db07c4ea7c0b7f9c9..a66210c5257547eedcae7a70524cc207b4eac3d9 100644 Binary files a/Java/Lagoudas/bin/Lag_sme.class and b/Java/Lagoudas/bin/Lag_sme.class differ diff --git a/Java/Lagoudas/bin/Lag_sme_mart.class b/Java/Lagoudas/bin/Lag_sme_mart.class index 0e7d8265162358f8bc4ab2c5a92a0b99af02c35f..b7e2d430a551f9f3cfc31630c3bd61f5aca993ef 100644 Binary files a/Java/Lagoudas/bin/Lag_sme_mart.class and b/Java/Lagoudas/bin/Lag_sme_mart.class differ diff --git a/Java/Lagoudas/src/Lag_sme.java b/Java/Lagoudas/src/Lag_sme.java index 9424d7f7e6b5a69bf591ead1f191e6cbb1090fa3..da8163f32bd6def10206c26a9febc00c81e5db9e 100644 --- a/Java/Lagoudas/src/Lag_sme.java +++ b/Java/Lagoudas/src/Lag_sme.java @@ -11,16 +11,16 @@ public class Lag_sme{ // Global Definitions block model.param().set("t1", "0.01 [s]"); // Ramping starts - model.param().set("t2", "0.25 [s]"); // Saturation + model.param().set("t2", "0.25 [s]"); // Saturation model.param().set("t3", "0.5 [s]"); // Reduction model.param().set("t4", "0.75 [s]"); // Temperature increase and load set to zero - model.param().set("t5", "5.0 [s]"); - + model.param().set("t5", "2.0 [s]"); + model.param().set("dt", "0.001 [s]"); model.param().set("T_ref", "295[K]", "Applied Temperature"); - model.param().set("T_rec", "350[K]", "Recovery Temperature"); - + model.param().set("T_rec", "320[K]", "Recovery Temperature"); + model.param().set("width", "15[mm]", "Length"); model.param().set("height", "1.5[mm]", "width"); @@ -61,7 +61,7 @@ public class Lag_sme{ {"t2", "t3", "maxload"}, {"t3", "t4", "maxload/(t3-t4)*(t-t4)"}, {"t4", "t5", "1e-8"}}); - + // Function temperature interpolation model.func().create("pw2", "Piecewise"); model.func("pw2").label("pw2"); @@ -75,15 +75,56 @@ public class Lag_sme{ {"t2", "t3", "T_ref"}, {"t3", "t4", "T_ref"}, {"t4", "t5", "((T_rec-T_ref)/(t5-t4))*(t-t4)+T_ref"}}); - - + + // Function Random normal distribution model.func().create("rn1", "Random"); model.func("rn1").set("nargs", 2); model.func("rn1").set("type", "normal"); model.func("rn1").set("funcname", "rn"); - + +// Function for plotting Lagoudas Phase modelPath + + model.func().create("Ms", "Analytic"); + model.func("Ms").label("Martensite Start boundary"); + model.func("Ms").set("funcname", "Ms"); + model.func("Ms").set("expr", "TMs_1+C_M*(T-TMs_1)"); + model.func("Ms").set("args", "T"); + + model.func("Ms").setIndex("plotargs", "TMf_1", 0, 1); + model.func("Ms").setIndex("plotargs", "TAf_1", 0, 2); + + //// + model.func().create("Mf", "Analytic"); + model.func("Mf").label("Martensite finish boundary"); + model.func("Mf").set("funcname", "Mf"); + model.func("Mf").set("expr", "TMf_1+C_M*(T-TMf_1)"); + model.func("Mf").set("args", "T"); + + model.func("Mf").setIndex("plotargs", "TMf_1", 0, 1); + model.func("Mf").setIndex("plotargs", "TAf_1", 0, 2); + + + //// + model.func().create("As", "Analytic"); + model.func("As").label("Austenite Start boundary"); + model.func("As").set("funcname", "As"); + model.func("As").set("expr", "TAs_1+C_M*(T-TAs_1)"); + model.func("As").set("args", "T"); + + model.func("As").setIndex("plotargs", "TMf_1", 0, 1); + model.func("As").setIndex("plotargs", "TAf_1", 0, 2); + + //// + model.func().create("Af", "Analytic"); + model.func("Af").label("Austenite finish boundary"); + model.func("Af").set("funcname", "Af"); + model.func("Af").set("expr", "TAf1_+C_M*(T-TAf_1)"); + model.func("Af").set("args", "T"); + + model.func("Af").setIndex("plotargs", "TMf_1", 0, 1); + model.func("Af").setIndex("plotargs", "TAf_1", 0, 2); // Component block model.component().create("comp1", true); @@ -152,13 +193,13 @@ public class Lag_sme{ // sma1 model.component("comp1").physics("ht").create("sma1", "ShapeMemoryAlloy", 2); model.component("comp1").physics("ht").feature("sma1").selection().set(1); - + model.component("comp1").physics("ht").feature("sma1").set("EffectiveConductivity", "PowerLaw"); model.component("comp1").physics("ht").feature("sma1").set("MartensiteMaterial", "mat2"); model.component("comp1").physics("ht").feature("sma1").set("AusteniteMaterial", "mat1"); model.component("comp1").physics("ht").feature("sma1").set("xi", "xi_0"); model.component("comp1").physics("ht").feature("sma1").set("rho_mat", "userdef"); - model.component("comp1").physics("ht").feature("sma1").set("rho", "rho_"); + model.component("comp1").physics("ht").feature("sma1").set("rho", "rho_"); // temp1 @@ -291,8 +332,8 @@ public class Lag_sme{ model.component("comp1").physics("solid").create("bndl1", "BoundaryLoad", 1); model.component("comp1").physics("solid").feature("bndl1").selection().set(4); model.component("comp1").physics("solid").feature("bndl1").set("FperArea", new String[]{"pw1(t)", "0", "0"}); - - + + //free2 model.component("comp1").physics("solid").create("free2", "Free", 1); @@ -417,7 +458,7 @@ public class Lag_sme{ model.sol("sol1").feature("t1").set("plotgroup", "pg2"); model.result("pg2").feature("glob2").active(false); model.result("pg2").run(); - + return model; } diff --git a/Java/Lagoudas/src/Lag_sme_mart.java b/Java/Lagoudas/src/Lag_sme_mart.java index 0ff6b6757a59a095002f3f041dcd1183ac1cec78..c238505ee500f363940ddb714c126475e719a101 100644 --- a/Java/Lagoudas/src/Lag_sme_mart.java +++ b/Java/Lagoudas/src/Lag_sme_mart.java @@ -11,16 +11,16 @@ public class Lag_sme_mart{ // Global Definitions block model.param().set("t1", "0.01 [s]"); // Ramping starts - model.param().set("t2", "0.25 [s]"); // Saturation + model.param().set("t2", "0.25 [s]"); // Saturation model.param().set("t3", "0.5 [s]"); // Reduction model.param().set("t4", "0.75 [s]"); // Temperature increase and load set to zero - model.param().set("t5", "5.0 [s]"); - + model.param().set("t5", "2.0 [s]"); + model.param().set("dt", "0.001 [s]"); model.param().set("T_ref", "280[K]", "Applied Temperature"); - model.param().set("T_rec", "350[K]", "Recovery Temperature"); - + model.param().set("T_rec", "320[K]", "Recovery Temperature"); + model.param().set("width", "15[mm]", "Length"); model.param().set("height", "1.5[mm]", "width"); @@ -61,7 +61,7 @@ public class Lag_sme_mart{ {"t2", "t3", "maxload"}, {"t3", "t4", "maxload/(t3-t4)*(t-t4)"}, {"t4", "t5", "1e-8"}}); - + // Function temperature interpolation model.func().create("pw2", "Piecewise"); model.func("pw2").label("pw2"); @@ -75,6 +75,47 @@ public class Lag_sme_mart{ {"t2", "t3", "T_ref"}, {"t3", "t4", "T_ref"}, {"t4", "t5", "((T_rec-T_ref)/(t5-t4))*(t-t4)+T_ref"}}); + +// Function for plotting Lagoudas Phase modelPath + model.func().create("Ms", "Analytic"); + model.func("Ms").label("Martensite Start boundary"); + model.func("Ms").set("funcname", "Ms"); + model.func("Ms").set("expr", "TMs_1+C_M*(T-TMs_1)"); + model.func("Ms").set("args", "T"); + + model.func("Ms").setIndex("plotargs", "TMf_1", 0, 1); + model.func("Ms").setIndex("plotargs", "TAf_1", 0, 2); + + //// + model.func().create("Mf", "Analytic"); + model.func("Mf").label("Martensite finish boundary"); + model.func("Mf").set("funcname", "Mf"); + model.func("Mf").set("expr", "TMf_1+C_M*(T-TMf_1)"); + model.func("Mf").set("args", "T"); + + model.func("Mf").setIndex("plotargs", "TMf_1", 0, 1); + model.func("Mf").setIndex("plotargs", "TAf_1", 0, 2); + + + //// + model.func().create("As", "Analytic"); + model.func("As").label("Austenite Start boundary"); + model.func("As").set("funcname", "As"); + model.func("As").set("expr", "TAs_1+C_A*(T-TAs_1)"); + model.func("As").set("args", "T"); + + model.func("As").setIndex("plotargs", "TMf_1", 0, 1); + model.func("As").setIndex("plotargs", "TAf_1", 0, 2); + + + model.func().create("Af", "Analytic"); + model.func("Af").label("Austenite finish boundary"); + model.func("Af").set("funcname", "Af"); + model.func("Af").set("expr", "TAf_1+C_A*(T-TAf_1)"); + model.func("Af").set("args", "T"); + + model.func("Af").setIndex("plotargs", "TMf_1", 0, 1); + model.func("Af").setIndex("plotargs", "TAf_1", 0, 2); // Function Random normal distribution @@ -152,13 +193,13 @@ public class Lag_sme_mart{ // sma1 model.component("comp1").physics("ht").create("sma1", "ShapeMemoryAlloy", 2); model.component("comp1").physics("ht").feature("sma1").selection().set(1); - + model.component("comp1").physics("ht").feature("sma1").set("EffectiveConductivity", "PowerLaw"); model.component("comp1").physics("ht").feature("sma1").set("MartensiteMaterial", "mat2"); model.component("comp1").physics("ht").feature("sma1").set("AusteniteMaterial", "mat1"); model.component("comp1").physics("ht").feature("sma1").set("xi", "xi_0"); model.component("comp1").physics("ht").feature("sma1").set("rho_mat", "userdef"); - model.component("comp1").physics("ht").feature("sma1").set("rho", "rho_"); + model.component("comp1").physics("ht").feature("sma1").set("rho", "rho_"); // temp1 @@ -291,8 +332,8 @@ public class Lag_sme_mart{ model.component("comp1").physics("solid").create("bndl1", "BoundaryLoad", 1); model.component("comp1").physics("solid").feature("bndl1").selection().set(4); model.component("comp1").physics("solid").feature("bndl1").set("FperArea", new String[]{"pw1(t)", "0", "0"}); - - + + //free2 model.component("comp1").physics("solid").create("free2", "Free", 1); @@ -380,11 +421,13 @@ public class Lag_sme_mart{ model.result("pg1").create("surf1", "Surface"); model.result("pg1").feature("surf1").label("Temperature"); model.result("pg1").feature("surf1").set("data", "dset1"); - + model.result("pg1").feature("surf1").active(false); + model.result("pg1").create("surf2", "Surface"); model.result("pg1").feature("surf2").label("Stress"); model.result("pg1").feature("surf2").set("data", "dset1"); model.result("pg1").feature("surf2").set("expr", "solid.mises"); + model.result("pg1").feature("surf2").active(false); model.result("pg1").create("surf3", "Surface"); model.result("pg1").feature("surf3").label("Martensite fraction"); @@ -394,29 +437,44 @@ public class Lag_sme_mart{ model.result("pg1").create("surf4", "Surface"); model.result("pg1").feature("surf4").label("Austenite Fraction"); model.result("pg1").feature("surf4").set("expr", "solid.xi_A"); + model.result("pg1").feature("surf4").active(false); model.result("pg1").run(); model.result().create("pg2", "PlotGroup1D"); - model.result("pg2").label("1D"); + model.result("pg2").label("Strain based"); model.result("pg2").create("glob1", "Global"); - model.result("pg2").feature("glob1").setIndex("expr", "aveop1(solid.mises)", 0); + model.result("pg2").feature("glob1").setIndex("expr", "aveop1(solid.sx)", 0); model.result("pg2").feature("glob1").set("xdata", "expr"); model.result("pg2").feature("glob1").set("xdataexpr", "aveop1(solid.eXX)"); - model.result("pg2").create("glob2", "Global"); model.result("pg2").feature("glob1").label("Stress/strain"); - model.result("pg2").feature("glob2").label("Stress/T"); - model.result("pg2").feature("glob2").set("data", "dset1"); - model.result("pg2").feature("glob2").setIndex("expr", "aveop1(solid.mises)", 0); - model.result("pg2").feature("glob2").set("xdata", "expr"); - model.result("pg2").feature("glob2").set("xdataexpr", "aveop1(T)"); - model.result("pg2").run(); - model.sol("sol1").feature("t1").set("plotgroup", "pg2"); - model.result("pg2").feature("glob2").active(false); model.result("pg2").run(); + + model.result().create("pg3", "PlotGroup1D"); + model.result("pg3").label("Temperature based"); + + model.result("pg3").create("glob1", "Global"); + model.result("pg3").feature("glob1").label("Stress/T"); + model.result("pg3").feature("glob1").set("data", "dset1"); + + model.result("pg3").feature("glob1").setIndex("expr", "aveop1(solid.sx)", 0); + model.result("pg3").feature("glob1").setIndex("expr", "Ms(aveop1(T))", 1); + model.result("pg3").feature("glob1").setIndex("expr", "Mf(aveop1(T))", 2); + model.result("pg3").feature("glob1").setIndex("expr", "As(aveop1(T))", 3); + model.result("pg3").feature("glob1").setIndex("expr", "Af(aveop1(T))", 4); + + model.result("pg3").feature("glob1").set("xdata", "expr"); + model.result("pg3").feature("glob1").set("xdataexpr", "aveop1(T)"); + model.result("pg3").set("axislimits", true); + model.result("pg3").set("xmin", "TMf_1-50"); + model.result("pg3").set("xmax", "TAf_1+50"); + + model.result("pg3").run(); + + return model; }