/* * full_tpc.java */ import com.comsol.model.*; import com.comsol.model.util.*; import java.io.*; //import java.util.Arrays; //import java.util.List; //import java.util.ArrayList; import java.util.Vector; //import java.util.Stack; //import java.text.*; /** Model exported on Nov 10 2012, 19:51 by COMSOL 4.1.0.88. */ public class full_tpc_af { public static void main(String[] args) { int deformcath=0; int single_force=0; double force = 0.3;//[N] double forceStop =0.3; double forceStep =0.3; int single_degree=0; double degree =-0.3; double DegStop =0.3; double DegStep =0.1; int single=1; Integer shortci=5; //5 in reality Integer shortco=4; //4 in reality double Els; double ElsStart=-200; double ElsEnd=-200; double ElsStep=-1; double Ed=-312.9; double dLs=4.7; double dLsStart=4.7; double dLsStop=5.0; double dLsStep=0.1; Integer nofStr=20;//478; //484 double strShifti=0; double strShifto=0; String name; } public static Model run(double E1, double E2, Integer _shorti, Integer _shorto, String addon, double dLsG1, Integer nofStrips, double V1, double V2, double V3, double shi, double sho, int deformcath, double force, double degree) { //other cathode material model.geom("geom1").feature().create("cathode kapton 1", "Rectangle"); model.geom("geom1").feature().create("cathode rohacell 1", "Rectangle"); model.geom("geom1").feature().create("cathode kapton 2", "Rectangle"); model.geom("geom1").feature().create("cathode rohacell 2", "Rectangle"); model.geom("geom1").feature().create("cathode kapton 3", "Rectangle"); model.geom("geom1").feature().create("cathode rohacell 3", "Rectangle"); model.geom("geom1").feature().create("cathode kapton 4", "Rectangle"); model.geom("geom1").feature().create("cathode aluminum shield", "Rectangle"); model.geom("geom1").feature("cathode kapton 1").set("size", new String[]{"105 + 2*(2e-3[mm] + 1e-3[mm])", "0.175"}); model.geom("geom1").feature("cathode kapton 1").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]"}); model.geom("geom1").feature("cathode rohacell 1").label("cathode rohacell 1"); model.geom("geom1").feature("cathode rohacell 1").set("size", new String[]{"105+ 2*(2e-3[mm] + 1e-3[mm])", "2"}); model.geom("geom1").feature("cathode rohacell 1").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]+0.175"}); model.geom("geom1").feature("cathode kapton 2").label("cathode kapton 2"); model.geom("geom1").feature("cathode kapton 2").set("size", new String[]{"105+ 2*(2e-3[mm] + 1e-3[mm])", "0.125"}); model.geom("geom1").feature("cathode kapton 2").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]+0.175+2"}); model.geom("geom1").feature("cathode rohacell 2").label("cathode rohacell 2"); model.geom("geom1").feature("cathode rohacell 2").set("size", new String[]{"105+ 2*(2e-3[mm] + 1e-3[mm])", "2"}); model.geom("geom1").feature("cathode rohacell 2").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]+0.175+2+0.125"}); model.geom("geom1").feature("cathode kapton 3").label("cathode kapton 3"); model.geom("geom1").feature("cathode kapton 3").set("size", new String[]{"105+ 2*(2e-3[mm] + 1e-3[mm])", "0.125"}); model.geom("geom1").feature("cathode kapton 3").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]+0.175+2+0.125+2"}); model.geom("geom1").feature("cathode rohacell 3").label("cathode rohacell 3"); model.geom("geom1").feature("cathode rohacell 3").set("size", new String[]{"105+ 2*(2e-3[mm] + 1e-3[mm])", "2"}); model.geom("geom1").feature("cathode rohacell 3").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125"}); model.geom("geom1").feature("cathode kapton 4").label("cathode kapton 4"); model.geom("geom1").feature("cathode kapton 4").set("size", new String[]{"105+ 2*(2e-3[mm] + 1e-3[mm])", "0.175"}); model.geom("geom1").feature("cathode kapton 4").set("pos", new String[]{"50 - 2e-3 - 1e-3", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2"}); model.geom("geom1").feature("cathode aluminum shield").label("cathode aluminum shield"); model.geom("geom1").feature("cathode aluminum shield").set("size", new String[]{"105+2*(25e-3 + 2e-3 + 3e-3 + 1e-3 + 0.15 + 2 + 0.125 + 2 + 0.15 + 2e-3)", "2e-3"}); model.geom("geom1").feature("cathode aluminum shield").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175"}); //other wall material model.geom("geom1").feature().create("first Kapton", "Rectangle"); model.geom("geom1").feature("first Kapton").set("size", new String[]{"0.150", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1"}); model.geom("geom1").feature("first Kapton").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15", "-1"}); model.geom("geom1").feature().create("first Rohazell", "Rectangle"); model.geom("geom1").feature("first Rohazell").set("size", new String[]{"2", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1"}); model.geom("geom1").feature("first Rohazell").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2", "-1"}); model.geom("geom1").feature().create("middle Kapton", "Rectangle"); model.geom("geom1").feature("middle Kapton").set("size", new String[]{"0.125", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1"}); model.geom("geom1").feature("middle Kapton").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125", "-1"}); model.geom("geom1").feature().create("second Rohazell", "Rectangle"); model.geom("geom1").feature("second Rohazell").set("size", new String[]{"2", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1"}); model.geom("geom1").feature("second Rohazell").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2", "-1"}); model.geom("geom1").feature().create("second Kapton", "Rectangle"); model.geom("geom1").feature("second Kapton").set("size", new String[]{"0.15", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1"}); model.geom("geom1").feature("second Kapton").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15", "-1"}); model.geom("geom1").feature().create("alu insu", "Rectangle"); model.geom("geom1").feature("alu insu").set("size", new String[]{"2e-3", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1"}); model.geom("geom1").feature("alu insu").set("pos", new String[]{"50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3", "-1"}); model.geom("geom1").feature().create("mir2", "Mirror"); model.geom("geom1").feature("mir2").set("createselection", true); model.geom("geom1").feature("mir2").set("pos", new String[]{"102.5", "0"}); model.geom("geom1").feature("mir2").set("keep", true); model.geom("geom1").feature("mir2").selection("input").set(new String[]{"first Kapton", "first Rohazell", "middle Kapton", "second Rohazell", "second Kapton", "alu insu", "strip_insulator"}); //selection Anode model.selection().create("sel_insu3", "Box"); model.selection("sel_insu3").label("Box 3"); model.selection("sel_insu3").set("ymin", "CminZ"); model.selection("sel_insu3") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.075"); model.selection("sel_insu3").set("ymax", "CminZ+0.1[mm]"); model.selection("sel_insu3") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 - 0.07"); model.selection("sel_insu3").label("sel_insu1.2"); model.selection().create("sel_insu4", "Box"); model.selection("sel_insu4").label("Box 4"); model.selection("sel_insu4").set("ymin", "CminZ"); model.selection("sel_insu4") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125/2"); model.selection("sel_insu4").set("ymax", "CminZ+0.1[mm]"); model.selection("sel_insu4") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125/2"); model.selection("sel_insu4").label("sel_insu1.2.2"); model.selection().create("sel_insu5", "Box"); model.selection("sel_insu5").label("Box 5"); model.selection("sel_insu5").set("ymin", "CminZ"); model.selection("sel_insu5") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15/2"); model.selection("sel_insu5").set("ymax", "CminZ+0.1[mm]"); model.selection("sel_insu5") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15/2"); model.selection("sel_insu5").label("sel_insu1.2.2.2"); model.selection().create("sel_insu6", "Box"); model.selection("sel_insu6").label("Box 6"); model.selection("sel_insu6").set("ymin", "CminZ"); model.selection("sel_insu6").set("xmin", "155.031+0.150/2"); model.selection("sel_insu6").set("ymax", "CminZ+0.1[mm]"); model.selection("sel_insu6").set("xmax", "155.031+0.150/2+0.01"); model.selection("sel_insu6").label("sel_insu1.2.3"); model.selection().create("sel_insu7", "Box"); model.selection("sel_insu7").label("Box 7"); model.selection("sel_insu7").set("ymin", "CminZ"); model.selection("sel_insu7").set("xmin", "155.031+0.15+2+0.125/2"); model.selection("sel_insu7").set("ymax", "CminZ+0.1[mm]"); model.selection("sel_insu7").set("xmax", "155.031+0.15+2+0.125/2"); model.selection("sel_insu7").label("sel_insu1.2.2.3"); model.selection().create("sel_insu8", "Box"); model.selection("sel_insu8").label("Box 8"); model.selection("sel_insu8").set("ymin", "CminZ"); model.selection("sel_insu8").set("xmin", "155.031+0.15+2+0.125+2+0.15/2"); model.selection("sel_insu8").set("ymax", "CminZ+0.1[mm]"); model.selection("sel_insu8").set("xmax", "155.031+0.15+2+0.125+2+0.15/2"); model.selection("sel_insu8").label("sel_insu1.2.2.2.2"); model.selection().create("box1", "Box"); model.selection().create("box2", "Box"); model.selection().create("box3", "Box"); model.selection().create("box4", "Box"); model.selection().create("box5", "Box"); model.selection().create("box6", "Box"); model.selection("box1").label("Box 1"); model.selection("box1").set("ymin", "CminZ"); model.selection("box1") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2/2"); model.selection("box1").set("ymax", "CminZ+0.1[mm]"); model.selection("box1") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2/2"); model.selection("box1").label("sel_rohacell"); model.selection("box2").label("Box 2"); model.selection("box2").set("ymin", "CminZ"); model.selection("box2") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2/2"); model.selection("box2").set("ymax", "CminZ+0.1[mm]"); model.selection("box2") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2/2"); model.selection("box2").label("sel_rohacell2"); model.selection("box3").label("Box 3"); model.selection("box3").set("ymin", "CminZ"); model.selection("box3").set("xmin", "155.031+0.15+2+0.125+2/2"); model.selection("box3").set("ymax", "CminZ+0.1[mm]"); model.selection("box3").set("xmax", "155.031+0.15+2+0.125+2/2"); model.selection("box3").label("sel_rohacell2.2"); model.selection("box4").label("Box 4"); model.selection("box4").set("ymin", "CminZ"); model.selection("box4").set("xmin", "155.031+0.15+2/2"); model.selection("box4").set("ymax", "CminZ+0.1[mm]"); model.selection("box4").set("xmax", "155.031+0.15+2/2"); model.selection("box4").label("sel_rohacell2.2.2"); model.selection("box5").label("Box 5"); model.selection("box5").set("ymin", "CminZ"); model.selection("box5") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3/2"); model.selection("box5").set("ymax", "CminZ+0.1[mm]"); model.selection("box5") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3/2"); model.selection("box5").label("sel_alu"); model.selection("box6").label("Box 6"); model.selection("box6").set("ymin", "CminZ"); model.selection("box6").set("xmin", "155.031+0.15+2+0.125+2+0.15+2e-3/2"); model.selection("box6").set("ymax", "CminZ+0.1[mm]"); model.selection("box6").set("xmax", "155.031+0.15+2+0.125+2+0.15+2e-3/2"); model.selection("box6").label("sel_alu 1"); model.selection().create("box9", "Box"); model.selection("box9").set("entitydim", "1"); model.selection().create("box10", "Box"); model.selection("box10").set("entitydim", "1"); model.selection("box9").label("Box 9"); model.selection("box9").set("ymin", "0-1-1e-4"); model.selection("box9") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3-1e-4"); model.selection("box9").set("ymax", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1e-4"); model.selection("box9").set("condition", "inside"); model.selection("box9") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15 + 1e-4"); model.selection("box10").label("Box 10"); model.selection("box10").set("ymin", "0-1-1e-4"); model.selection("box10") .set("xmin", "155.031 + 0.15+2+0.125+2+0.15-1e-4"); model.selection("box10").set("ymax", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175+1e-4"); model.selection("box10").set("condition", "inside"); model.selection("box10") .set("xmax", "155.031+0.15+2+0.125+2+0.15+1e-4+2e-3"); //selections for cathode material model.selection().create("cat_kapton1", "Box"); model.selection("cat_kapton1").label("Cathode Kapton 1"); model.selection("cat_kapton1").set("ymin", "Cz + 2e-3[mm]+0.175/2"); model.selection("cat_kapton1").set("xmin", "102"); model.selection("cat_kapton1").set("ymax", "Cz + 2e-3[mm]+0.175/2"); model.selection("cat_kapton1").set("xmax", "103"); model.selection().create("cat_roha1", "Box"); model.selection("cat_roha1").label("cathode Rohazell 1"); model.selection("cat_roha1").set("ymin", "Cz + 2e-3[mm]+0.175+1"); model.selection("cat_roha1").set("xmin", "102"); model.selection("cat_roha1").set("ymax", "Cz + 2e-3[mm]+0.175+1"); model.selection("cat_roha1").set("xmax", "103"); model.selection().create("cat_kapton2", "Box"); model.selection("cat_kapton2").label("Cathode Kapton 2"); model.selection("cat_kapton2").set("ymin", "Cz + 2e-3[mm]+0.175+2+0.125/2"); model.selection("cat_kapton2").set("xmin", "102"); model.selection("cat_kapton2").set("ymax", "Cz + 2e-3[mm]+0.175+2+0.125/2"); model.selection("cat_kapton2").set("xmax", "103"); model.selection().create("cat_roha2", "Box"); model.selection("cat_roha2").label("Cathode Rohazell 2"); model.selection("cat_roha2").set("ymin", "Cz + 2e-3[mm]+0.175+2+0.125+2/2"); model.selection("cat_roha2").set("xmin", "102"); model.selection("cat_roha2").set("ymax", "Cz + 2e-3[mm]+0.175+2+0.125+2/2"); model.selection("cat_roha2").set("xmax", "103"); model.selection().create("cat_kapton3", "Box"); model.selection("cat_kapton3").label("Cathode Kapton3"); model.selection("cat_kapton3") .set("ymin", "Cz + 2e-3[mm]+0.175+2+0.125+2+0.125/2"); model.selection("cat_kapton3").set("xmin", "102"); model.selection("cat_kapton3") .set("ymax", "Cz + 2e-3[mm]+0.175+2+0.125+2+0.125/2"); model.selection("cat_kapton3").set("xmax", "103"); model.selection().create("cat_roha3", "Box"); model.selection("cat_roha3").label("Cathode Rohazell 3"); model.selection("cat_roha3") .set("ymin", "Cz + 2e-3[mm]+0.175+2+0.125+2+0.125+2/2"); model.selection("cat_roha3").set("xmin", "102"); model.selection("cat_roha3") .set("ymax", "Cz + 2e-3[mm]+0.175+2+0.125+2+0.125+2/2"); model.selection("cat_roha3").set("xmax", "103"); model.selection().create("cat_kapton4", "Box"); model.selection("cat_kapton4").label("Cathode Kapton 4"); model.selection("cat_kapton4") .set("ymin", "Cz + 2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175/2"); model.selection("cat_kapton4").set("xmin", "102"); model.selection("cat_kapton4") .set("ymax", "Cz + 2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175/2"); model.selection("cat_kapton4").set("xmax", "103"); model.selection().create("cat_alushield", "Box"); model.selection("cat_alushield").label("Cathode Alushield"); model.selection("cat_alushield") .set("ymin", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175-2e-4"); model.selection("cat_alushield") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3-2e-4"); model.selection("cat_alushield") .set("ymax", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175-1e-4+2e-3+2e-4"); model.selection("cat_alushield").set("condition", "inside"); model.selection("cat_alushield") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3-1e-4+105+2*(25e-3 + 2e-3 + 3e-3 + 1e-3 + 0.15 + 2 + 0.125 + 2 + 0.15 + 2e-3)+2e-4"); model.selection().create("cat_alushieldB", "Box"); model.selection("cat_alushieldB").label("Cath Alushield B"); model.selection("cat_alushieldB").set("condition", "inside"); model.selection("cat_alushieldB").set("entitydim", "1"); model.selection("cat_alushieldB") .set("ymin", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175-2e-4"); model.selection("cat_alushieldB") .set("xmin", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3-2e-4"); model.selection("cat_alushieldB") .set("ymax", "Cz+2e-3[mm]+0.175+2+0.125+2+0.125+2+0.175-1e-4+2e-3+2e-4"); model.selection("cat_alushieldB").set("condition", "inside"); model.selection("cat_alushieldB") .set("xmax", "50-25e-3-2e-3-3e-3 - 1e-3 -0.15-2-0.125-2-0.15-2e-3-1e-4+105+2*(25e-3 + 2e-3 + 3e-3 + 1e-3 + 0.15 + 2 + 0.125 + 2 + 0.15 + 2e-3)+2e-4"); String selnameInsu="sel_Insu"; model.selection().create(selnameInsu, "Union"); model.selection(selnameInsu).label("Union Kapton"); model.selection(selnameInsu).set("input", new String[]{selnameInsu1, selnameInsu2,"sel_insu3","sel_insu4","sel_insu5","sel_insu6","sel_insu7","sel_insu8","cat_kapton1","cat_kapton2","cat_kapton3","cat_kapton4"}); model.selection().create("uni1", "Union"); model.selection("uni1") .set("input", new String[]{"box1", "box2", "box3", "box4","cat_roha1","cat_roha2","cat_roha3"}); model.selection("uni1").label("Union rohacell"); model.selection().create("uni2", "Union"); model.selection("uni2").set("input", new String[]{"box5", "box6","cat_alushield"}); model.selection("uni2").label("Union alu"); model.selection().create("uni3", "Union"); model.selection("uni3").set("entitydim", "1"); model.selection("uni3").set("input", new String[]{"box9", "box10","cat_alushieldB"}); model.selection("uni3").label("Union alu 1"); System.out.println("Run Geometry and Selections needed: "+Double.toString((System.currentTimeMillis()-stamp)/1000)+" s"); return model; } }