/* * full_tpc.java */ import com.comsol.model.*; import com.comsol.model.util.*; import java.io.*; import java.util.Vector; public class full_tpc_v2 { public static Model getModel() { return model; } public static boolean isUsePot() { return usePot; } public static double getForce() { return force; } public static double getDegree() { return degree; } public static int getShortci() { return shortci; } public static int getShortco() { return shortco; } public static double getEls() { return Els; } public static double getEd() { return Ed; } public static double getVd() { return Vd; } public static double getVgem() { return Vgem; } public static double getVls() { return Vls; } public static double getdLs() { return dLs; } public static int getNofStr() { return nofStr; } public static double getStrShifti() { return strShifti; } public static double getStrShifto() { return strShifto; } public static void setModel(Model model) { full_tpc_v2.model = model; } public static void setUsePot(boolean usePot) { full_tpc_v2.usePot = usePot; } public static void setForce(double force) { full_tpc_v2.force = force; } public static void setDegree(double degree) { full_tpc_v2.degree = degree; } public static void setShortci(int shortci) { full_tpc_v2.shortci = shortci; } public static void setShortco(int shortco) { full_tpc_v2.shortco = shortco; } public static void setEls(double els) { Els = els; } public static void setEd(double ed) { Ed = ed; } public static void setVd(double vd) { Vd = vd; } public static void setVgem(double vgem) { Vgem = vgem; } public static void setVls(double vls) { Vls = vls; } public static void setdLs(double dLs) { full_tpc_v2.dLs = dLs; } public static void setNofStr(int nofStr) { full_tpc_v2.nofStr = nofStr; } public static void setStrShifti(double strShifti) { full_tpc_v2.strShifti = strShifti; } public static void setStrShifto(double strShifto) { full_tpc_v2.strShifto = strShifto; } //public static String getName() { return name; } //public static void setName(String name) { full_tpc_v2.name = name; } static Model model; static boolean usePot;//=true; static boolean replace_file =true; static boolean oneRow =false; //true to create only one row of strips per side. not double row static boolean stud =true; static boolean dbgplots =false; static double force =0;//[N] static double degree =0;//gem rotation in degree static int shortci =5; //5 in reality static int shortco =4; //4 in reality static int midshort =1; static double shi=0; static double sho=0; static double Els =-341; static double Ed =-312.9; static double Vd; static double Vgem; static double Vls; static double dLs =4.7; static int nofStr =478;//478; //484 static double strShifti =0; static double strShifto =0; //static String name; static String fieldf; static String outpath="/data2/fopiroot_data/field_sim/pion_setting/"; static double Emod=36.0;//[MPa] //double hight=1; //[mm] //double width=105; //[mm] //1 is the height of thickness of the cathode in [mm], 105 is the radius of the cathode in [mm] static double AreaMoment=1*Math.pow(105,3)*1/12 ; //geometric values of the tpc static double outerf_rad=155; // [mm] measured from the outside (not in gas volume) -> biggest radius of field cage static double inner_rad=52; // [mm] measured from the outside (not in gas volume) -> smallest radius of field cage static double fc_rohacell_d=2; //[mm] static double fc_kapton1_d=25e-3; //[mm] static double fc_kapton2_d=125e-3; //[mm] static double fc_copper_d=5e-3; //[mm] static double fc_alu_d=5e-3; //[mm] in reality its 200e-7 but this would make mesh creation a pain in the ass static double innerf_rad_gas=inner_rad+2*fc_rohacell_d+3*fc_kapton1_d+3*fc_kapton2_d+2*fc_copper_d+fc_alu_d; static double outerf_rad_gas=outerf_rad-2*fc_rohacell_d-3*fc_kapton1_d-3*fc_kapton2_d-2*fc_copper_d-fc_alu_d; static double cath_rohacell_d;//[mm] static double cath_kapton1_d; //[mm] static double cath_kapton2_d; //[mm] static double cath_alu_d; //[mm] static double fc_len=728.5; //[mm] static File runfile; public static void main(String[] args) { String name2; //name="perfect_"; //run(Ed,Els,0,0,name,dLs,nofStr,0,0,0,0,0,1,0,0); //name="bending_"; //run(Ed,Els,shortci,shortco,name,dLs,nofStr,0,0,0,0,0,1,2,0); //name2=name+"86ar81_Midshort_478Strips"; //run(Ed,Els,shortci,shortco,name2,dLs,nofStr,-3295.88,-3365.89,-25777,strShifti,strShifto,1,0,0); // Drift=86%, GEM=81% run 3980-4009 //name2=name+"86ar82_Midshort_478Strips"; //run(Ed,Els,shortci,shortco,name2,dLs,nofStr,-3336.58,-3429.07,-25840,strShifti,strShifto,1,0,0); // Drift=86%, GEM=82% run 3774-3800 //name2=name+"86ar83_Midshort_478Strips"; //run(Ed,Els,shortci,shortco,name2,dLs,nofStr,-3377.27,-3447.27,-25858.7,strShifti,strShifto,1,0,0); // Drift=86%, GEM=83% run 3814-3834 //name2=name+"86ar84_Midshort_478Strips"; //run(Ed,Els,shortci,shortco,name2,dLs,nofStr,-3417.96,-3487.95,-25899,strShifti,strShifto,1,0,0); // Drift=86%, GEM=84% run 3843-3865 shortci=5; shortco=4; usePot=true; dbgplots=false; Vd=-25940; Vls=-3528.6; Vgem=-3458.6; run("86ar85_Midshort_478Strips_v2"); // Drift=86%, GEM=85% run 3883-3901 shortci=0; shortco=0; usePot=true; dbgplots=true; Vd=-25802; Vls=-3611.6; Vgem=-3458.6; //run("86ar85_Midshort_478Strips_perfect"); //name2=name+"86ar86_Midshort_478Strips"; //run(Ed,Els,shortci,shortco,name2,dLs,nofStr,-3499.34,-3569.33,-25979.9,strShifti,strShifto,1,0,0); // Drift=86%, GEM=86% run 3912-3944 //name2=name+"86ar84_"; //run(Ed,Els,shortci,shortco,name2,dLs,nofStr,-3417.97,-3487.97,-25898.9); //Drift=86%, GEM=84% shortci=5; shortco=4; usePot=true; dbgplots=false; Vd=-20306; Vls=-3365.73; Vgem=-3295.88; //run("65ar81_Midshort_478Strips");//Drift=65%, GEM=81% (actually 80.6) Pion Beamtime shortci=5; shortco=4; usePot=true; dbgplots=false; Vd=-20265; Vls=-3325.05; Vgem=-3255.2; //run("65ar80_Midshort_478Strips");//Drift=65%, GEM=80% (actually 79.6) Pion Beamtime } public static void run(String nameadd) { if ( isUsePot() ) { //recalculate fields if a potential should be used Ed=((Vd-Vgem)/(nofStr*0.15+dLs/10.)); Els=(Vls-Vgem)/(dLs/10.); } else { //calculate fields Vd=Ed*(nofStr*0.15); Vls=Els*(dLs/10.); Vgem=0; } System.out.println("*******************************************"); System.out.println("Ed="+Double.toString(Ed)); System.out.println("Els="+Double.toString(Els)); System.out.println("dLs="+Double.toString(dLs)); System.out.println("Inner/Outer Shorts:"+Integer.toString(shortci)+"/"+Integer.toString(shortco)); System.out.println("Inner/Outer Shift:"+Double.toString(shi)+"/"+Double.toString(sho)); System.out.println("Number of Strips="+Integer.toString(nofStr)); System.out.println("Force"+Double.toString(force)); System.out.println("*******************************************"); fieldf=String.format("full_field_%.2f_%.2f_%ds%d_%.3f_%.3fsh%.3f_%.4f_%s",Els,Ed,shortci,shortco,dLs,shi,sho,force,nameadd); if (!openFile()) { return; } //create the actual model model = ModelUtil.create("Model"); model.modelNode().create("TPC"); addParameter(); System.out.println("starting Geometry"); model.geom().create("geom1", 2); model.geom("geom1").axisymmetric(true); model.geom("geom1").lengthUnit("mm"); createCathode(); createGem(); createGasVolume(); createStrips(); double stamp=System.currentTimeMillis(); model.geom("geom1").run(); System.out.println("Run Geometry needed: "+Double.toString((System.currentTimeMillis()-stamp)/1000)+" s"); addMaterials(); addPotentials(); addMesh(); addStudy(); addPlots(); //return model; System.out.println("try delete lockfile: "+outpath+"/"+fieldf+".run"); if (replace_file) { System.out.println("Cleaning up"); runfile.delete(); } System.out.println("all done"); } private static void addParameter() { String CathodeBending = "(Bforce*Clength^3)/(6*Emod*AreaMoment)*( (( x -CmaxR)/Clength)^3-3*(( x -CmaxR)/Clength)^2)+Cz"; model.param().set("Els" , Double.toString(Els) +" [V/cm]"); model.param().set("Edrift" , Double.toString(Ed) +" [V/cm]"); model.param().set("dLs" , Double.toString(dLs) +" [mm]"); model.param().set("Vls" , Double.toString(Vls) +" [V]"); model.param().set("Vd" , Double.toString(Vd) +" [V]"); model.param().set("Vg" , Double.toString(Vgem) +" [V]"); model.param().set("length" , Double.toString(nofStr*1.5)+"[mm] + dLs" ); model.param().set("midshort", Integer.toString(midshort)); model.param().set("shortsi" , Integer.toString(shortci)); model.param().set("shortso" , Integer.toString(shortco)); //this setting for number of shortcuts counted on BOTH sides of the stripfoil //model.param().set("Vstepi","(Vd-Vls) / (nofStrips-0.5*shortsi - 0.5*(shortsi==0) )"); //model.param().set("Vstepo","(Vd-Vls) / (nofStrips-0.5*shortso - 0.5*(shortso==0) - midshort)"); //this setting for number of shortcuts on ONE side counted only model.param().set("nofsteps_i","(nofStrips-shortsi - 0.5*(shortsi==0) + 0.5*(shortsi>0))"); model.param().set("nofsteps_o","(nofStrips-shortso - 0.5*(shortso==0) + 0.5*(shortso>0) - (midshort)*(midshort>0))"); model.param().set("Vstepi","(Vd-Vls) / nofsteps_i "); model.param().set("Vstepo","(Vd-Vls) / nofsteps_o "); model.param().set("Bforce", Double.toString(force)+" [N]"); model.param().set("Emod", Double.toString(Emod)+" [MPa]"); model.param().set("AreaMoment",Double.toString(AreaMoment)+" [mm^4]"); model.param().set("nofStrips",Integer.toString(nofStr)); model.param().set("Cz","0.25[mm]+dLs+(nofStrips*1.5[mm])"); model.param().set("Clength", "105[mm]+2*( 2e-3 + 1e-3 )"); //this is not completely correct! cathode is longer model.param().set("CmaxR", Double.toString(outerf_rad_gas)+" + 2*"+Double.toString(fc_copper_d)+" + "+Double.toString(fc_kapton1_d)); model.param().set("CminZ", CathodeBending.replace(" x "," 50[mm] - 2e-3[mm] - 1e-3[mm]")); model.param().set("shi",Double.toString(shi)); model.param().set("sho",Double.toString(sho)); model.param().set("Anode_rot",Double.toString(degree)); } private static void createCathode() { String CathodeBending = "(Bforce*Clength^3)/(6*Emod*AreaMoment)*( (( x -CmaxR)/Clength)^3-3*(( x -CmaxR)/Clength)^2)+Cz"; model.func().create("an1", "Analytic"); model.func("an1").set("expr", CathodeBending); model.func("an1").set("argunit", "m"); model.func("an1").set("plotargs", new String[][]{{"x", "50[mm]", "155[mm]"}}); //deform cathode model.geom("geom1").feature().create("Cathode_p1", "BezierPolygon"); String[][] CathodePoints=new String[2][4]; String inner_start=Double.toString(innerf_rad_gas)+" - 2*"+Double.toString(fc_copper_d)+" - "+Double.toString(fc_kapton1_d); String outer_end=Double.toString(outerf_rad_gas)+" + 2*"+Double.toString(fc_copper_d)+" + "+Double.toString(fc_kapton1_d); CathodePoints[0][0]=inner_start;//"50 - 2e-3 - 1e-3"; //x1 CathodePoints[1][0]=CathodeBending.replace(" x ",inner_start);//y1 CathodePoints[0][1]=inner_start; //x2 CathodePoints[1][1]="Cz+5e-3[mm]"; //y2 CathodePoints[0][2]=outer_end; //x3 CathodePoints[1][2]="Cz+5e-3[mm]"; //y3 CathodePoints[0][3]=outer_end; //x4 CathodePoints[1][3]=CathodeBending.replace(" x ",outer_end); //y4 model.geom("geom1").feature("Cathode_p1").set("p",CathodePoints); model.geom("geom1").feature("Cathode_p1").set("w", new String[]{"1", "1", "1", "1", "1", "1"}); model.geom("geom1").feature("Cathode_p1").set("type", "open"); model.geom("geom1").feature("Cathode_p1").set("degree", new String[]{"1", "1", "1"}); model.geom("geom1").feature().create("Cathode_p2", "ParametricCurve"); model.geom("geom1").feature("Cathode_p2").set("parmin", inner_start); model.geom("geom1").feature("Cathode_p2").set("parmax", outer_end); model.geom("geom1").feature("Cathode_p2").set("pos", new String[]{"0", "0"}); model.geom("geom1").feature("Cathode_p2").set("coord", new String[]{"s", CathodeBending.replace(" x "," s ")}); model.geom("geom1").feature().create("Cathode", "ConvertToSolid"); model.geom("geom1").feature("Cathode").selection("input").set(new String[]{"Cathode_p1", "Cathode_p2"}); //ymaxB=zCathode; model.param().set("shi","-(Cz-CminZ)"); shi=(force*Math.pow(105,3))/(6*Emod*AreaMoment) * (Math.pow((50)/105,3)-3*(Math.pow((50)/105,2)));//move the inner strips model.param().set("shi",Double.toString(shi)); //selection bended Cathode model.selection().create("sel_cathode","Box"); model.selection("sel_cathode").label("sel_cathode"); model.selection("sel_cathode").set("entitydim", "1"); model.selection("sel_cathode").set("inputent", "all"); model.selection("sel_cathode").set("condition", "inside"); model.selection("sel_cathode").set("groupcontang", "off"); model.selection("sel_cathode").set("xmin", inner_start+"+"+Double.toString(1e-4)); model.selection("sel_cathode").set("xmax", outer_end+"+"+Double.toString(1e-4)); model.selection("sel_cathode").set("ymin", "CminZ-1e-4[mm]"); model.selection("sel_cathode").set("ymax", "Cz+5e-3[mm]+1e-4"); } private static void createGem() { //gem model.geom("geom1").feature().create("anode", "Rectangle"); model.geom("geom1").feature("anode").set("size", new String[]{Double.toString(outerf_rad_gas)+"-"+Double.toString(innerf_rad_gas), "1"}); double theta = Math.toRadians(degree); double offset=(outerf_rad_gas-innerf_rad_gas)/2*Math.tan(theta); double pos=-1*Math.abs(offset)-0.5; double centerpos=innerf_rad_gas+(outerf_rad_gas-innerf_rad_gas)/2.; model.geom("geom1").feature("anode").set("pos", new String[]{Double.toString(centerpos), Double.toString(pos)}); model.geom("geom1").feature("anode").set("base", "center"); model.geom("geom1").feature("anode").set("rot", "Anode_rot"); double xminA=102.4; double xmaxA=102.6; double yminA=-0.1+offset; double ymaxA=0.1+offset; model.selection().create("sel_Anod","Box"); model.selection("sel_Anod").label("Anode (GEM)"); model.selection("sel_Anod").set("entitydim", "1"); model.selection("sel_Anod").set("inputent", "all"); model.selection("sel_Anod").set("condition", "intersects"); model.selection("sel_Anod").set("groupcontang", "off"); model.selection("sel_Anod").set("xmin", Double.toString(xminA)); model.selection("sel_Anod").set("xmax", Double.toString(xmaxA)); model.selection("sel_Anod").set("ymin", Double.toString(yminA)); model.selection("sel_Anod").set("ymax", Double.toString(ymaxA)); } private static void createGasVolume() { //volume //Double zVolume=zCathode+2.; model.geom("geom1").feature().create("gas volume", "Rectangle"); //volume model.geom("geom1").feature("gas volume").set("pos", new String[]{Double.toString(innerf_rad_gas)+"-"+Double.toString(fc_kapton1_d)+"-2*"+Double.toString(fc_copper_d), "0"}); model.geom("geom1").feature("gas volume").set("size", new String[]{Double.toString(outerf_rad_gas)+"-"+Double.toString(innerf_rad_gas)+"+2*"+Double.toString(fc_kapton1_d)+"+4*"+Double.toString(fc_copper_d),"Cz"}); } private static void createStrips() { //Double zS1=dLs+0.75; //kapton between strips model.geom("geom1").feature().create("strip_insulator_inner","Rectangle"); model.geom("geom1").feature("strip_insulator_inner").set("pos", new String[]{Double.toString(innerf_rad_gas)+"-"+Double.toString(fc_copper_d)+"-"+Double.toString(fc_kapton1_d),"dLs+shi"}); model.geom("geom1").feature("strip_insulator_inner").set("size", new String[]{"25e-3", "Cz-dLs-shi"}); //be aware this allows only for negative shifts which are the only reasonable choice model.geom("geom1").feature().create("strip_insulator_outer","Rectangle"); model.geom("geom1").feature("strip_insulator_outer").set("pos", new String[]{Double.toString(outerf_rad_gas)+"+"+Double.toString(fc_copper_d),"dLs+sho"}); model.geom("geom1").feature("strip_insulator_outer").set("size", new String[]{"25e-3", "Cz-dLs-sho"});//be aware this allows only for negative shifts which are the only reasonable choice // linke seite strips model.geom("geom1").feature().create("inner strip", "Rectangle");//inner striprows if(! oneRow) model.geom("geom1").feature().create("outer strip", "Rectangle");//outer striprows model.geom("geom1").feature("inner strip").set("pos", new String[]{Double.toString(innerf_rad_gas)+"-"+Double.toString(fc_copper_d), "dLs+0.75"}); //0.75 is the strip height model.geom("geom1").feature("inner strip").set("size", new String[]{Double.toString(fc_copper_d), "1"}); if(! oneRow) { model.geom("geom1").feature("outer strip").set("pos", new String[]{Double.toString(innerf_rad_gas)+"- 2*"+Double.toString(fc_copper_d)+"-"+Double.toString(fc_kapton1_d), "dLs"}); model.geom("geom1").feature("outer strip").set("size", new String[]{Double.toString(fc_copper_d), "1"}); } model.geom("geom1").feature().create("inner striprow", "Array"); if(!oneRow) model.geom("geom1").feature().create("outer striprow", "Array"); model.geom("geom1").feature("inner striprow").set("size", new String[]{"1", "nofStrips"}); model.geom("geom1").feature("inner striprow").set("displ", new String[]{"0", "1.5"}); model.geom("geom1").feature("inner striprow").selection("input").set(new String[]{"inner strip"}); if(!oneRow) { model.geom("geom1").feature("outer striprow").set("size", new String[]{"1", "nofStrips"}); model.geom("geom1").feature("outer striprow").set("displ", new String[]{"0", "1.5"}); model.geom("geom1").feature("outer striprow").selection("input").set(new String[]{"outer strip"}); } // linke seite strips ende // rechte seite strips model.geom("geom1").feature().create("inner strip r", "Rectangle");//inner striprows rechts if(! oneRow) model.geom("geom1").feature().create("outer strip r", "Rectangle");//outer striprows rechts model.geom("geom1").feature("inner strip r").set("pos", new String[]{Double.toString(outerf_rad_gas), "dLs+0.15"}); model.geom("geom1").feature("inner strip r").set("size", new String[]{Double.toString(fc_copper_d), "1"}); if(! oneRow) { model.geom("geom1").feature("outer strip r").set("pos", new String[]{Double.toString(outerf_rad_gas)+"+"+Double.toString(fc_copper_d)+"+"+Double.toString(fc_kapton1_d), "dLs+0.15+0.75"}); model.geom("geom1").feature("outer strip r").set("size", new String[]{Double.toString(fc_copper_d), "1"}); } model.geom("geom1").feature().create("inner striprow r", "Array"); if(!oneRow) model.geom("geom1").feature().create("outer striprow r", "Array"); model.geom("geom1").feature("inner striprow r").set("size", new String[]{"1", "nofStrips/2"}); model.geom("geom1").feature("inner striprow r").set("displ", new String[]{"0", "1.5"}); model.geom("geom1").feature("inner striprow r").selection("input").set(new String[]{"inner strip r"}); if(!oneRow) { model.geom("geom1").feature("outer striprow r").set("size", new String[]{"1", "nofStrips/2-1"}); model.geom("geom1").feature("outer striprow r").set("displ", new String[]{"0", "1.5"}); model.geom("geom1").feature("outer striprow r").selection("input").set(new String[]{"outer strip r"}); } // horizontal gespiegelt model.geom("geom1").feature().create("mir1", "Mirror"); model.geom("geom1").feature("mir1").set("keep", true); model.geom("geom1").feature("mir1").set("pos", new String[]{Double.toString(innerf_rad_gas), "dLs+0.15+1.5*((nofStrips/2)-1)+1+0.55"}); model.geom("geom1").feature("mir1").set("axis", new String[]{"0", "1"}); if(!oneRow) model.geom("geom1").feature("mir1").selection("input").set(new String[]{"inner striprow r","outer striprow r"}); // rechte seite strips ende model.geom("geom1").feature().create("mov1","Move"); model.geom("geom1").feature("mov1").selection("input").set(new String[]{"mir1"}); model.geom("geom1").feature("mov1").set("disply","sho"); model.geom("geom1").feature().create("mov2","Move"); if(!oneRow) model.geom("geom1").feature("mov2").selection("input").set(new String[]{"inner striprow","outer striprow"}); else model.geom("geom1").feature("mov2").selection("input").set(new String[]{"inner striprow"}); model.geom("geom1").feature("mov2").set("disply","shi"); createStripSelections(); } static boolean openFile() { runfile=new File(outpath+"/"+fieldf+".run"); if (!replace_file) { System.out.println("Checking Fieldfile: "+outpath+fieldf+".txt"); if ( new File(outpath+"/"+fieldf+".txt").isFile() ) { System.out.println("Field already calculated. skipping"); return false; } if (new File(outpath+"/"+fieldf+".run").isFile()) { System.out.println("Field is calculated at the moment"); return false; } } else { System.out.println("Replacing field file if it exists!"); } try { System.out.println("opening runfile: "+outpath+"/"+fieldf+".txt"); runfile.createNewFile(); } catch (IOException e) { System.err.println("Error opening runfile" + e.getMessage()); return false; } return true; } static void createStripSelections() { double xmin=0; double xmax=0; double ymin=0; double ymax=0; String shift=""; for (int row=0;row<4;row++) { System.out.println("adding selections to row: "+Integer.toString(row)); //ymin=-1e-3; //ymax=1+1e-3; if (row==0 | row==1) { //2 + first row + kapton xmin=innerf_rad_gas - 2*fc_copper_d-fc_kapton1_d -1e-4 ; //1e-4 to make sure everything is inside xmax=innerf_rad_gas - fc_copper_d-fc_kapton1_d +1e-4 ; //1e-4 to make sure everything is inside shift="shi"; ymin=-1e-4; ymax=+1+1e-4; } if (row==2 | row==3) { xmin=outerf_rad_gas - 1e-4; xmax=outerf_rad_gas +fc_copper_d +1e-4; shift="sho"; ymin=-1e-4+0.15; ymax=+1+1e-4+0.15; } if (row==1) { ymin+=0.75; ymax+=0.75; //kapton thickness, other striprow thicknes + box offset xmin=innerf_rad_gas-fc_copper_d-1e-4; xmax=innerf_rad_gas+1e-4; } if(row==3) { xmin=outerf_rad_gas+fc_copper_d+fc_kapton1_d-1e-4; xmax=outerf_rad_gas+2*fc_copper_d+fc_kapton1_d+1e-4; ymin+=0.75; ymax+=0.75; } boolean extrastep_done=false; for (int st=0;st<=nofStr-1;st++) // For loop row 0 { System.out.print("At strip "+Integer.toString(st)+" of "+Integer.toString(nofStr-1)+"\r"); if(row==2 & st>(nofStr-1)/2. & !extrastep_done) { ymin+=0.01+0.59; ymax+=0.01+0.59; extrastep_done=true; } if(row==3 & st>(nofStr-3.)/2. & !extrastep_done) { ymin+=1.51+0.59; ymax+=1.51+0.59; extrastep_done=true; } if (st>0) { ymin+=1.5; ymax+=1.5; } String sname="r" +Integer.toString(row)+"s"+Integer.toString(st); String selname="sel_"+sname; model.selection().create(selname,"Box"); model.selection(selname).label(selname); model.selection(selname).set("entitydim", "1"); model.selection(selname).set("inputent", "all"); model.selection(selname).set("condition", "inside"); model.selection(selname).set("groupcontang", "off"); model.selection(selname).set("xmin", Double.toString(xmin)); model.selection(selname).set("xmax", Double.toString(xmax)); model.selection(selname).set("ymin", Double.toString(ymin)+"+"+shift+"+dLs"); model.selection(selname).set("ymax", Double.toString(ymax)+"+"+shift+"+dLs"); //model.geom("geom1").run(selname); } System.out.println(""); } //kapton insulation between strips String selnameInsu1="sel_insu1"; model.selection().create(selnameInsu1,"Box"); model.selection(selnameInsu1).label(selnameInsu1); model.selection(selnameInsu1).set("entitydim","2"); model.selection(selnameInsu1).set("inputent","all"); model.selection(selnameInsu1).set("condition","intersects"); model.selection(selnameInsu1).set("groupcontang","off"); model.selection(selnameInsu1).set("xmin",Double.toString(innerf_rad_gas)+"-"+Double.toString(fc_copper_d)+"-"+Double.toString(fc_kapton1_d/2)); model.selection(selnameInsu1).set("xmax",Double.toString(innerf_rad_gas)+"-"+Double.toString(fc_copper_d)+"-"+Double.toString(fc_kapton1_d/2)+"1e-4"); model.selection(selnameInsu1).set("ymin","CminZ/2"); model.selection(selnameInsu1).set("ymax","CminZ/2+0.1[mm]"); String selnameInsu2="sel_insu2"; model.selection().create(selnameInsu2,"Box"); model.selection(selnameInsu2).label(selnameInsu2); model.selection(selnameInsu2).set("entitydim","2"); model.selection(selnameInsu2).set("inputent","all"); model.selection(selnameInsu2).set("condition","intersects"); model.selection(selnameInsu2).set("groupcontang","off"); model.selection(selnameInsu2).set("xmin",Double.toString(outerf_rad_gas)+"+"+Double.toString(fc_copper_d)+"+"+Double.toString(fc_kapton1_d/2)); model.selection(selnameInsu2).set("xmax",Double.toString(outerf_rad_gas)+"+"+Double.toString(fc_copper_d)+"+"+Double.toString(fc_kapton1_d/2)+"+1e-4"); model.selection(selnameInsu2).set("ymin","CminZ/2"); model.selection(selnameInsu2).set("ymax","CminZ/2+0.1[mm]"); model.selection().create("sel_Insu", "Union"); model.selection("sel_Insu").label("Union Kapton"); model.selection("sel_Insu").set("input", new String[]{selnameInsu1, selnameInsu2,"sel_insu1","sel_insu2"}); } static void addMaterials() { System.out.println("adding materials"); model.material().create("mat1"); model.material("mat1").label("Copper"); model.material("mat1").set("family", "copper"); model.material("mat1").propertyGroup("def").set("relpermeability", "1"); model.material("mat1").propertyGroup("def").set("electricconductivity", "5.998e7[S/m]"); model.material("mat1").propertyGroup("def").set("thermalexpansioncoefficient", "17e-6[1/K]"); model.material("mat1").propertyGroup("def").set("heatcapacity", "385[J/(kg*K)]"); model.material("mat1").propertyGroup("def").set("relpermittivity", "1e9"); model.material("mat1").propertyGroup("def").set("density", "8700[kg/m^3]"); model.material("mat1").propertyGroup("def").set("thermalconductivity", "400[W/(m*K)]"); model.material("mat1").propertyGroup().create("Enu", "Elastizit\u00e4tsmodul und Poissonzahl"); model.material("mat1").propertyGroup("Enu").set("poissonsratio", "0.35"); model.material("mat1").propertyGroup("Enu").set("youngsmodulus", "110e9[Pa]"); model.material("mat1").propertyGroup().create("linzRes", "Linearisierter spezifischer Widerstand"); model.material("mat1").propertyGroup("linzRes").set("alpha", "0.0039[1/K]"); model.material("mat1").propertyGroup("linzRes").set("rho0", "1.72e-8[ohm*m]"); model.material("mat1").propertyGroup("linzRes").set("Tref", "298[K]"); model.material("mat1").set("family", "copper"); model.material("mat1").selection().all(); model.material().create("mat2"); model.material("mat2").label("Air"); model.material("mat2").set("family", "air"); model.material("mat2").propertyGroup("def").set("relpermeability", "1"); model.material("mat2").propertyGroup("def").set("relpermittivity", "1"); model.material("mat2").propertyGroup("def").set("dynamicviscosity", "eta(T[1/K])[Pa*s]"); model.material("mat2").propertyGroup("def").set("ratioofspecificheat", "1.4"); model.material("mat2").propertyGroup("def").set("electricconductivity", "0[S/m]"); model.material("mat2").propertyGroup("def").set("heatcapacity", "Cp(T[1/K])[J/(kg*K)]"); model.material("mat2").propertyGroup("def").set("density", "rho(pA[1/Pa],T[1/K])[kg/m^3]"); model.material("mat2").propertyGroup("def").set("thermalconductivity", "k(T[1/K])[W/(m*K)]"); model.material("mat2").propertyGroup("def").set("soundspeed", "cs(T[1/K])[m/s]"); model.material("mat2").propertyGroup("def").func().create("eta", "Piecewise"); model.material("mat2").propertyGroup("def").func("eta").set("funcname", "eta"); model.material("mat2").propertyGroup("def").func("eta").set("arg", "T"); model.material("mat2").propertyGroup("def").func("eta").set("extrap", "constant"); model.material("mat2").propertyGroup("def").func("eta").set("pieces", new String[][]{{"200.0", "1600.0", "-8.38278E-7+8.35717342E-8*T^1-7.69429583E-11*T^2+4.6437266E-14*T^3-1.06585607E-17*T^4"}}); model.material("mat2").propertyGroup("def").func().create("Cp", "Piecewise"); model.material("mat2").propertyGroup("def").func("Cp").set("funcname", "Cp"); model.material("mat2").propertyGroup("def").func("Cp").set("arg", "T"); model.material("mat2").propertyGroup("def").func("Cp").set("extrap", "constant"); model.material("mat2").propertyGroup("def").func("Cp").set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}}); model.material("mat2").propertyGroup("def").func().create("rho", "Analytic"); model.material("mat2").propertyGroup("def").func("rho").set("funcname", "rho"); model.material("mat2").propertyGroup("def").func("rho").set("args", new String[]{"pA", "T"}); model.material("mat2").propertyGroup("def").func("rho").set("expr", "pA*0.02897/8.314/T"); model.material("mat2").propertyGroup("def").func("rho").set("dermethod", "manual"); model.material("mat2").propertyGroup("def").func("rho").set("argders", new String[][]{{"pA", "d(pA*0.02897/8.314/T,pA)"}, {"T", "d(pA*0.02897/8.314/T,T)"}}); model.material("mat2").propertyGroup("def").func().create("k", "Piecewise"); model.material("mat2").propertyGroup("def").func("k").set("funcname", "k"); model.material("mat2").propertyGroup("def").func("k").set("arg", "T"); model.material("mat2").propertyGroup("def").func("k").set("extrap", "constant"); model.material("mat2").propertyGroup("def").func("k").set("pieces", new String[][]{{"200.0", "1600.0", "-0.00227583562+1.15480022E-4*T^1-7.90252856E-8*T^2+4.11702505E-11*T^3-7.43864331E-15*T^4"}}); model.material("mat2").propertyGroup("def").func().create("cs", "Analytic"); model.material("mat2").propertyGroup("def").func("cs").set("funcname", "cs"); model.material("mat2").propertyGroup("def").func("cs").set("args", new String[]{"T"}); model.material("mat2").propertyGroup("def").func("cs").set("expr", "sqrt(1.4*287*T)"); model.material("mat2").propertyGroup("def").func("cs").set("dermethod", "manual"); model.material("mat2").propertyGroup("def").func("cs").set("argders", new String[][]{{"T", "d(sqrt(1.4*287*T),T)"}}); model.material("mat2").propertyGroup("def").addInput("temperature"); model.material("mat2").propertyGroup("def").addInput("pressure"); model.material("mat2").set("family", "air"); model.material().move("mat2", 1); model.material("mat2").selection().set(new int[]{1}); model.material().create("mat3"); model.material("mat3").propertyGroup("def").func() .create("k", "Piecewise"); model.material("mat3").propertyGroup("def").func() .create("C", "Piecewise"); model.material("mat3").propertyGroup("def").func() .create("rho", "Piecewise"); model.material("mat3").label("Polyimide tape (Kapton HN) [solid]"); model.material("mat3").propertyGroup("def").func("k") .set("pieces", new String[][]{{"5.0", "140.0", "-0.001372384+0.005601653*T^1+2.082966E-6*T^2-5.05445E-9*T^3"}, {"140.0", "300.0", "-0.007707532+0.005769136*T^1+5.622796E-7*T^2-4.329984E-10*T^3"}}); model.material("mat3").propertyGroup("def").func("k").set("arg", "T"); model.material("mat3").propertyGroup("def").func("C") .set("pieces", new String[][]{{"4.0", "30.0", "2.809666-1.394349*T^1+0.2106639*T^2+0.004752016*T^3-3.279998E-4*T^4+4.282249E-6*T^5"}, {"30.0", "300.0", "-86.86946+7.816917*T^1-0.03664788*T^2+9.9128E-5*T^3-1.08441E-7*T^4"}}); model.material("mat3").propertyGroup("def").func("C").set("arg", "T"); model.material("mat3").propertyGroup("def").func("rho") .set("pieces", new String[][]{{"293.0", "303.0", "1420.0"}}); model.material("mat3").propertyGroup("def").func("rho").set("arg", "T"); model.material("mat3").propertyGroup("def") .set("thermalconductivity", new String[]{"k(T[1/K])[W/(m*K)]", "0", "0", "0", "k(T[1/K])[W/(m*K)]", "0", "0", "0", "k(T[1/K])[W/(m*K)]"}); model.material("mat3").propertyGroup("def") .set("heatcapacity", "C(T[1/K])[J/(kg*K)]"); model.material("mat3").propertyGroup("def") .set("density", "rho(T[1/K])[kg/m^3]"); model.material("mat3").propertyGroup("def") .set("relpermittivity", new String[]{"3.83", "0", "0", "0", "3.83", "0", "0", "0", "3.83"}); model.material("mat3").propertyGroup("def").addInput("temperature"); model.material("mat3").selection().named("sel_Insu"); /* model.material().create("mat4"); model.material("mat4").selection().named("uni1"); model.material("mat4").label("Rohacell"); model.material("mat4").propertyGroup("def").set("density", "52.1"); model.material("mat4").propertyGroup("def").set("relpermittivity", new String[]{"1.05", "0", "0", "0", "1.05", "0", "0", "0", "1.05"}); */ /* model.material().create("mat5"); model.material("mat5").propertyGroup("def").func() .create("dL_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("CTE_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("k_solid_bulk_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("res_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("alpha_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("C_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("HC_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("mu", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("sigma_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("rho_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("VP_solid_1", "Piecewise"); model.material("mat5").propertyGroup("def").func() .create("kappa", "Piecewise"); model.material("mat5").propertyGroup() .create("Enu", "Young's modulus and Poisson's ratio"); model.material("mat5").propertyGroup("Enu").func() .create("E", "Piecewise"); model.material("mat5").propertyGroup("Enu").func() .create("nu", "Piecewise"); model.material("mat5").selection().named("uni2"); */ /* model.material("mat5").label("Aluminum [solid,bulk]"); model.material("mat5").propertyGroup("def").func("dL_solid_1") .set("pieces", new String[][]{{"20.0", "188.0", "-0.004116601-4.000347E-6*T^1+5.370388E-8*T^2+3.714324E-10*T^3-1.45073E-12*T^4"}, {"188.0", "933.0", "-0.006312089+2.156284E-5*T^1-4.744254E-9*T^2+1.811015E-11*T^3-7.336673E-15*T^4"}}); model.material("mat5").propertyGroup("def").func("dL_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("CTE_solid_1") .set("pieces", new String[][]{{"20.0", "79.0", "-3.317274E-6+3.068688E-7*T^1-1.004816E-8*T^2+1.724768E-10*T^3-8.846061E-13*T^4"}, {"79.0", "230.0", "-2.288239E-5+6.674915E-7*T^1-4.402622E-9*T^2+1.455358E-11*T^3-1.910622E-14*T^4"}, {"230.0", "900.0", "1.243109E-5+5.050772E-8*T^1-5.806556E-11*T^2+3.014305E-14*T^3"}}); model.material("mat5").propertyGroup("def").func("CTE_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("k_solid_bulk_1") .set("pieces", new String[][]{{"0.0", "14.0", "3895.7*T^1+203.42*T^2-56.434*T^3+2.0664*T^4"}, {"14.0", "50.0", "49148.0-2950.9*T^1+63.175*T^2-0.46605*T^3"}, {"50.0", "82.0", "15117.0-626.0*T^1+10.348*T^2-0.078676*T^3+2.2917E-4*T^4"}, {"82.0", "297.0", "913.09-12.076*T^1+0.080875*T^2-2.3988E-4*T^3+2.6487E-7*T^4"}, {"297.0", "933.0", "39.646+1.684*T^1-0.0054134*T^2+8.4313E-6*T^3-6.537E-9*T^4+2.002E-12*T^5"}}); model.material("mat5").propertyGroup("def").func("k_solid_bulk_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("res_solid_1") .set("pieces", new String[][]{{"1.0", "20.0", "1.091612E-12-1.10726E-13*T^1+3.696901E-14*T^2-2.781934E-15*T^3+1.008733E-16*T^4"}, {"20.0", "50.0", "-3.323487E-11+7.29041E-12*T^1-4.771551E-13*T^2+1.071535E-14*T^3"}, {"50.0", "200.0", "1.046556E-10-3.988929E-11*T^1+1.061978E-12*T^2-2.337666E-15*T^3"}, {"200.0", "933.0", "-1.037048E-8+1.451201E-10*T^1-8.192563E-14*T^2+6.619834E-17*T^3"}}); model.material("mat5").propertyGroup("def").func("res_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("alpha_solid_1") .set("pieces", new String[][]{{"20.0", "220.0", "1.371347E-5+7.808536E-8*T^1-2.568882E-10*T^2+3.615726E-13*T^3"}, {"220.0", "610.0", "5.760185E-6+1.707141E-7*T^1-6.548135E-10*T^2+1.220625E-12*T^3-1.064883E-15*T^4+3.535918E-19*T^5"}, {"610.0", "933.0", "1.9495E-5+9.630182E-9*T^1+9.462013E-13*T^2"}}); model.material("mat5").propertyGroup("def").func("alpha_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("C_solid_1") .set("pieces", new String[][]{{"100.0", "320.0", "-290.4161+11.181*T^1-0.04125401*T^2+7.112754E-5*T^3-4.60822E-8*T^4"}, {"320.0", "933.0", "595.6585+1.513029*T^1-0.002070065*T^2+1.303608E-6*T^3"}}); model.material("mat5").propertyGroup("def").func("C_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("HC_solid_1") .set("pieces", new String[][]{{"100.0", "320.0", "-7.835862+0.3016802*T^1-0.001113095*T^2+1.919128E-6*T^3-1.243367E-9*T^4"}, {"320.0", "933.0", "16.07176+0.04082379*T^1-5.585347E-5*T^2+3.517331E-8*T^3"}}); model.material("mat5").propertyGroup("def").func("HC_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("mu") .set("pieces", new String[][]{{"0.0", "773.0", "2.894653E10-120032.4*T^1-69037.36*T^2+158.6722*T^3-0.1348974*T^4"}}); model.material("mat5").propertyGroup("def").func("mu").set("arg", "T"); model.material("mat5").propertyGroup("def").func("sigma_solid_1") .set("pieces", new String[][]{{"1.0", "20.0", "1/(1.008733E-16*T^4-2.781934E-15*T^3+3.696901E-14*T^2-1.107260E-13*T+1.091612E-12)"}, {"20.0", "50.0", "1/(1.071535E-14*T^3-4.771551E-13*T^2+7.290410E-12*T-3.323487E-11)"}, {"50.0", "200.0", "1/(-2.337666E-15*T^3+1.061978E-12*T^2-3.988929E-11*T+1.0465563E-10)"}, {"200.0", "933.0", "1/(6.619834E-17*T^3-8.192563E-14*T^2+1.451201E-10*T-1.037048E-08)"}}); model.material("mat5").propertyGroup("def").func("sigma_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("rho_solid_1") .set("pieces", new String[][]{{"20.0", "130.0", "2734.317-0.02751647*T^1+0.001016054*T^2-1.700864E-5*T^3+5.734155E-8*T^4"}, {"130.0", "933.0", "2736.893-0.006011681*T^1-7.012444E-4*T^2+1.3582E-6*T^3-1.367828E-9*T^4+5.177991E-13*T^5"}}); model.material("mat5").propertyGroup("def").func("rho_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("VP_solid_1") .set("pieces", new String[][]{{"293.0", "933.0", "(exp((-1.734200e+004/T-7.927000e-001*log10(T)+1.233981e+001)*log(10.0)))*1.333200e+002"}}); model.material("mat5").propertyGroup("def").func("VP_solid_1") .set("arg", "T"); model.material("mat5").propertyGroup("def").func("kappa") .set("pieces", new String[][]{{"0.0", "773.0", "7.252413E10+1872882.0*T^1-71106.44*T^2+52.7109*T^3"}}); model.material("mat5").propertyGroup("def").func("kappa").set("arg", "T"); model.material("mat5").propertyGroup("def") .set("dL", "(dL_solid_1(T[1/K])-dL_solid_1(Tempref[1/K]))/(1+dL_solid_1(Tempref[1/K]))"); model.material("mat5").propertyGroup("def") .set("CTE", "CTE_solid_1(T[1/K])[1/K]"); model.material("mat5").propertyGroup("def") .set("thermalconductivity", new String[]{"k_solid_bulk_1(T[1/K])[W/(m*K)]", "0", "0", "0", "k_solid_bulk_1(T[1/K])[W/(m*K)]", "0", "0", "0", "k_solid_bulk_1(T[1/K])[W/(m*K)]"}); model.material("mat5").propertyGroup("def") .set("resistivity", new String[]{"res_solid_1(T[1/K])[ohm*m]", "0", "0", "0", "res_solid_1(T[1/K])[ohm*m]", "0", "0", "0", "res_solid_1(T[1/K])[ohm*m]"}); model.material("mat5").propertyGroup("def") .set("thermalexpansioncoefficient", new String[]{"(alpha_solid_1(T[1/K])[1/K]+(Tempref-293[K])*if(abs(T-Tempref)>1e-3,(alpha_solid_1(T[1/K])[1/K]-alpha_solid_1(Tempref[1/K])[1/K])/(T-Tempref),d(alpha_solid_1(T[1/K]),T)[1/K]))/(1+alpha_solid_1(Tempref[1/K])[1/K]*(Tempref-293[K]))", "0", "0", "0", "(alpha_solid_1(T[1/K])[1/K]+(Tempref-293[K])*if(abs(T-Tempref)>1e-3,(alpha_solid_1(T[1/K])[1/K]-alpha_solid_1(Tempref[1/K])[1/K])/(T-Tempref),d(alpha_solid_1(T[1/K]),T)[1/K]))/(1+alpha_solid_1(Tempref[1/K])[1/K]*(Tempref-293[K]))", "0", "0", "0", "(alpha_solid_1(T[1/K])[1/K]+(Tempref-293[K])*if(abs(T-Tempref)>1e-3,(alpha_solid_1(T[1/K])[1/K]-alpha_solid_1(Tempref[1/K])[1/K])/(T-Tempref),d(alpha_solid_1(T[1/K]),T)[1/K]))/(1+alpha_solid_1(Tempref[1/K])[1/K]*(Tempref-293[K]))"}); model.material("mat5").propertyGroup("def") .set("heatcapacity", "C_solid_1(T[1/K])[J/(kg*K)]"); model.material("mat5").propertyGroup("def") .set("HC", "HC_solid_1(T[1/K])[J/(mol*K)]"); model.material("mat5").propertyGroup("def").set("mu", "mu(T[1/K])[Pa]"); model.material("mat5").propertyGroup("def") .set("electricconductivity", new String[]{"sigma_solid_1(T[1/K])[S/m]", "0", "0", "0", "sigma_solid_1(T[1/K])[S/m]", "0", "0", "0", "sigma_solid_1(T[1/K])[S/m]"}); model.material("mat5").propertyGroup("def") .set("density", "rho_solid_1(T[1/K])[kg/m^3]"); model.material("mat5").propertyGroup("def") .set("VP", "VP_solid_1(T[1/K])[Pa]"); model.material("mat5").propertyGroup("def") .set("kappa", "kappa(T[1/K])[Pa]"); model.material("mat5").propertyGroup("def") .set("relpermittivity", new String[]{"1e9", "0", "0", "0", "1e9", "0", "0", "0", "1e9"}); model.material("mat5").propertyGroup("def").addInput("temperature"); model.material("mat5").propertyGroup("def") .addInput("strainreferencetemperature"); model.material("mat5").propertyGroup("Enu").func("E") .set("pieces", new String[][]{{"0.0", "773.0", "7.659324E10+2007396.0*T^1-186458.4*T^2+419.2175*T^3-0.3495083*T^4"}}); model.material("mat5").propertyGroup("Enu").func("E").set("arg", "T"); model.material("mat5").propertyGroup("Enu").func("nu") .set("pieces", new String[][]{{"0.0", "773.0", "0.3238668+3.754548E-6*T^1+2.213647E-7*T^2-6.565023E-10*T^3+4.21277E-13*T^4+3.170505E-16*T^5"}}); model.material("mat5").propertyGroup("Enu").func("nu").set("arg", "T"); model.material("mat5").propertyGroup("Enu") .set("youngsmodulus", "E(T[1/K])[Pa]"); model.material("mat5").propertyGroup("Enu") .set("poissonsratio", "nu(T[1/K])"); model.material("mat5").propertyGroup("Enu").addInput("temperature"); */ /* */ } static void addStripPotentials() { //set potentials of field strips int scounter; int strip_off=1; double stamp=System.currentTimeMillis(); for (int row=0;row<4;row++) { scounter=0; System.out.println("adding potential to row: "+Integer.toString(row)); if (row==3) {strip_off=3;} else {strip_off=1;} for (int st=0;st<=nofStr-strip_off;st++) { System.out.print("At strip "+Integer.toString(st)+" of "+Integer.toString(nofStr-strip_off)+"\r"); String sname="r" +Integer.toString(row)+"s"+Integer.toString(st); String selname="sel_"+sname; model.physics("es").feature().create(sname, "ElectricPotential", 1); model.physics("es").feature(sname).selection().named(selname); model.physics("es").feature(sname).label(sname); String potS=""; String VstepS=""; if (row==0|row==1) { VstepS="Vstepi"; } else { VstepS="Vstepo"; } //this is for creating a shortcut in the middle of outer fieldcage if (midshort==1) { if (row==2) { if(st==Math.ceil(nofStr/2)) scounter--; } } //end shortcut if (row==0) {potS="Vls+"+VstepS+"*"+Integer.toString(scounter);} if (row==1) {potS="Vls+"+VstepS+"/2.+"+VstepS+"*"+Integer.toString(scounter);} if (row==2) {potS="Vls+"+VstepS+"*"+Integer.toString(scounter);} if (row==3) {potS="Vls+"+VstepS+"/2.+"+VstepS+"*"+Integer.toString(scounter);} potS="("+potS+")*( ("+potS+")>Vd)+Vd*(("+potS+")<=Vd) "; model.physics("es").feature(sname).set("V0", potS); scounter++; } } System.out.println(""); System.out.println("Adding Stip potentials needed: "+Double.toString((System.currentTimeMillis()-stamp)/1000)+" s"); } static void addPotentials() { double stamp=System.currentTimeMillis(); System.out.println("adding physics"); model.physics().create("es", "Electrostatics", "geom1"); //set potential of drift System.out.println("Adding drift potential"); model.physics("es").feature().create("Vdrift", "ElectricPotential", 1); model.physics("es").feature("Vdrift").selection().named("sel_cathode"); model.physics("es").feature("Vdrift").label("Vdrift"); model.physics("es").feature("Vdrift").set("V0", "Vd"); //set gem potential System.out.println("adding gem potential"); model.physics("es").feature().create("Vgem", "ElectricPotential", 1); model.physics("es").feature("Vgem").selection().named("sel_Anod"); model.physics("es").feature("Vgem").label("Vgem"); model.physics("es").feature("Vgem").set("V0", "Vg"); //model.physics("es").feature().create("gnd1", "Ground", 1); //model.physics("es").feature("gnd1").selection().named("uni3"); //set strip potentials addStripPotentials(); System.out.println("Adding Physics needed: "+Double.toString((System.currentTimeMillis()-stamp)/1000)+" s"); } static void addMesh() { System.out.println("adding mesh"); model.mesh().create("mesh1", "geom1"); //model.mesh("mesh1").feature().create("sca1", "Scale"); model.mesh("mesh1").feature().create("scale_insu", "Scale"); model.mesh("mesh1").feature().create("ftri1", "FreeTri"); model.mesh("mesh1").feature("size").set("hauto", 4); model.mesh("mesh1").feature("size").set("hmax", "100"); model.mesh("mesh1").feature("size").set("hmin", "15"); model.mesh("mesh1").feature("size").set("hcurve", "1"); model.mesh("mesh1").feature("size").set("hgrad", "1.2"); model.mesh("mesh1").feature("size").set("hnarrow", "0.05"); model.mesh("mesh1").feature("ftri1").set("xscale", "15"); model.mesh("mesh1").feature("ftri1").set("yscale", "10"); //model.mesh("mesh1").feature("sca1").selection().named("uni1"); model.mesh("mesh1").feature("scale_insu").selection().named("sel_Insu"); if(stud) model.mesh().run(); } static void addStudy() { if (stud) { System.out.println("adding study"); model.study().create("std1"); model.study("std1").feature().create("stat", "Stationary"); System.out.println("start meshing"); model.mesh("mesh1").run(); System.out.println("creating solution"); model.sol().create("sol1"); model.sol("sol1").study("std1"); model.sol("sol1").attach("std1"); System.out.println("start study"); model.study("std1").run(); System.out.println("Creating fieldmatrix"); model.result().dataset().create("cpt1", "CutPoint2D"); model.result().dataset("cpt1").set("method", "grid"); model.result().dataset("cpt1").label("field grid"); model.result().dataset("cpt1").set("gridx", "range("+Double.toString(innerf_rad_gas)+",0.5,"+Double.toString(outerf_rad_gas)+")"); model.result().dataset("cpt1").set("gridy", "range(0,0.5,Cz)"); model.result().dataset("cpt1").run(); System.out.println("adding result"); model.result().export().create("data1", "Data"); model.result().export("data1").set("data", "cpt1"); model.result().export("data1").setIndex("expr", "es.Er", 0); model.result().export("data1").setIndex("expr", "es.Ez", 1); model.result().export("data1").setIndex("expr", "V", 2); model.result().export("data1").setIndex("unit", "V/cm", 0); model.result().export("data1").setIndex("unit", "V/cm", 1); model.result().export("data1").setIndex("unit", "V", 2); model.result().export("data1").set("filename", outpath+"/"+fieldf+".txt"); System.out.println("exporting result to "+outpath+"/"+fieldf+".txt"); model.result().export("data1").run(); } } static void addPlots() { if (dbgplots && stud) { System.out.println("adding study 2"); model.study().create("std2"); model.study("std2").feature().create("param", "Parametric"); model.study("std2").feature().create("stat", "Stationary"); model.study("std2").feature("stat").set("initstudyhide", "on"); model.study("std2").feature("stat").set("initsolhide", "on"); model.study("std2").feature("stat").set("notstudyhide", "on"); model.study("std2").feature("stat").set("notsolhide", "on"); model.study("std2").feature("stat").set("initstudyhide", "on"); model.study("std2").feature("stat").set("initsolhide", "on"); model.study("std2").feature("stat").set("notstudyhide", "on"); model.study("std2").feature("stat").set("notsolhide", "on"); model.study("std2").label("Real Pot with Shorts"); model.study("std2").feature("param").set("pname", new String[]{"shortsi", "shortso", "Vg", "Vls", "Vd"}); model.study("std2").feature("param").set("plistarr", new String[]{"4", "3", "-3458.6", "-3528.6", "-25940"}); System.out.println("creating solution 2"); model.sol().create("sol2"); model.sol("sol2").study("std2"); model.sol("sol2").attach("std2"); System.out.println("Runnung study 2"); model.study("std2").run(); //create all views System.out.println("adding views"); model.view().create("view4", "geom1"); model.view("view4").label("close to strips inner"); model.view("view4").set("locked", true); model.view("view4").axis().set("xmin", "52"); model.view("view4").axis().set("xmax", "105"); model.view("view4").axis().set("ymin", "430"); model.view("view4").axis().set("ymax", "460"); model.view("view4").axis().set("manualgrid", "on"); model.view("view4").axis().set("yspacing", "0.5"); model.view().create("view5", "geom1"); model.view("view5").label("close to cathode corner"); model.view("view5").set("locked", true); model.view("view5").axis().set("xmin", "52"); model.view("view5").axis().set("xmax", "105"); model.view("view5").axis().set("ymin", "695"); model.view("view5").axis().set("ymax", "725"); model.view("view5").axis().set("manualgrid", "on"); model.view().create("view6", "geom1"); model.view("view6").label("close to last strip"); model.view("view6").set("locked", true); model.view("view6").axis().set("xmin", "52"); model.view("view6").axis().set("xmax", "105"); model.view("view6").axis().set("ymin", "-5"); model.view("view6").axis().set("ymax", "25"); model.view("view6").axis().set("manualgrid", "on"); model.view().create("view7", "geom1"); model.view("view7").label("fieldcage soldering"); model.view("view7").set("locked", true); model.view("view7").axis().set("xmin", "75"); model.view("view7").axis().set("xmax", "155"); model.view("view7").axis().set("ymin", "330"); model.view("view7").axis().set("ymax", "400"); model.view("view7").axis().set("manualgrid", "on"); //create datasets System.out.println("creating datasets"); System.out.println("adding cutlines left"); model.result().dataset().create("cln1", "CutLine2D"); model.result().dataset("cln1").label("left"); model.result().dataset("cln1").set("genpoints", new String[][]{{"51", "0"}, {"51", "1000"}}); model.result().dataset("cln1").set("genparaactive", "on"); model.result().dataset("cln1").set("genparadist", "range(0,-0.05,-50)"); System.out.println("adding cutline right"); model.result().dataset().create("cln2", "CutLine2D"); model.result().dataset("cln2").label("right"); model.result().dataset("cln2").set("genpoints", new String[][]{{"155+12.5e-3", "0"}, {"155+12.5e-3", "1000"}}); System.out.println("adding cutline last strip"); model.result().dataset().create("cln4", "CutLine2D"); model.result().dataset("cln4").label("Last Strip"); model.result().dataset("cln4").set("genpoints", new String[][]{{"49", "dLs+0.5"}, {"156", "dLs+0.5"}}); System.out.println("adding cutline last strip 1"); model.result().dataset().create("cln5", "CutLine2D"); model.result().dataset("cln5").set("data", "dset2"); model.result().dataset("cln5").label("Last Strip 1"); model.result().dataset("cln5").set("spacevars", new String[]{"cln4x"}); model.result().dataset("cln5").set("genpoints", new String[][]{{"49", "dLs+0.5"}, {"156", "dLs+0.5"}}); System.out.println("adding cutline middle"); model.result().dataset().create("cln6", "CutLine2D"); model.result().dataset("cln6").label("middle"); model.result().dataset("cln6").set("genpoints", new String[][]{{"49", "350"}, {"156", "350"}}); System.out.println("adding cutline middle 1"); model.result().dataset().create("cln7", "CutLine2D"); model.result().dataset("cln7").set("data", "dset2"); model.result().dataset("cln7").label("middle 1"); model.result().dataset("cln7").set("spacevars", new String[]{"cln6x"}); model.result().dataset("cln7").set("genpoints", new String[][]{{"49", "350"}, {"156", "350"}}); System.out.println("adding plotgroup potential"); model.result().create("pg_pot", "PlotGroup2D"); model.result("pg_pot").feature().create("surf1", "Surface"); model.result("pg_pot").feature().create("con1", "Contour"); model.result("pg_pot").label("Potential"); //model.result("pg_pot").set("solnum", "4"); model.result("pg_pot").feature("con1").set("number", "80"); model.result("pg_pot").feature("con1").set("color", "black"); model.result("pg_pot").feature("con1").set("coloring", "uniform"); model.result("pg_pot").feature("con1").set("colorlegend", false); System.out.println("adding plotgroup radial field"); model.result().create("pg_er", "PlotGroup2D"); model.result("pg_er").feature().create("surf1", "Surface"); model.result("pg_er").label("Radial Field"); model.result("pg_er").set("xlabelactive", true); model.result("pg_er").set("window", "window2"); model.result("pg_er").set("ylabelactive", true); model.result("pg_er").set("titletype", "custom"); model.result("pg_er").set("solutionintitle", false); model.result("pg_er").set("typeintitle", false); model.result("pg_er").set("ylabel", "Z (mm)"); model.result("pg_er").set("windowtitleactive", true); model.result("pg_er").set("xlabel", "Radius (mm)"); //model.result("pg_er").set("solnum", "4"); model.result("pg_er").set("windowtitle", "Radial Field"); model.result("pg_er").feature("surf1").set("descr", "Electric field, r component"); model.result("pg_er").feature("surf1").set("rangecolormax", "20"); model.result("pg_er").feature("surf1").set("expr", "es.Er"); model.result("pg_er").feature("surf1").set("rangecoloractive", "on"); model.result("pg_er").feature("surf1").set("resolution", "fine"); model.result("pg_er").feature("surf1").set("rangecolormin", "-20"); model.result("pg_er").feature("surf1").set("unit", "V/cm"); System.out.println("adding plotgroup drift field"); model.result().create("pg_ez", "PlotGroup2D"); model.result("pg_ez").feature().create("surf1", "Surface"); model.result("pg_ez").label("Drift Field"); model.result("pg_ez").set("xlabelactive", true); model.result("pg_ez").set("window", "window3"); model.result("pg_ez").set("ylabelactive", true); model.result("pg_ez").set("titletype", "custom"); model.result("pg_ez").set("solutionintitle", false); model.result("pg_ez").set("typeintitle", false); model.result("pg_ez").set("ylabel", "Z (mm)"); model.result("pg_ez").set("windowtitleactive", true); model.result("pg_ez").set("xlabel", "Radius (mm)"); // model.result("pg_ez").set("solnum", "4"); model.result("pg_ez").set("windowtitle", "Drift Field"); model.result("pg_ez").feature("surf1") .set("descr", "Electric field, z component"); model.result("pg_ez").feature("surf1").set("rangecolormax", "400"); model.result("pg_ez").feature("surf1").set("expr", "es.Ez"); model.result("pg_ez").feature("surf1").set("rangecoloractive", "on"); model.result("pg_ez").feature("surf1").set("resolution", "fine"); model.result("pg_ez").feature("surf1").set("rangecolormin", "200"); model.result("pg_ez").feature("surf1").set("unit", "V/cm"); System.out.println("adding plotgroup abs field"); model.result().create("pg_e", "PlotGroup2D"); model.result("pg_e").feature().create("surf1", "Surface"); model.result("pg_e").label("Abs Field"); model.result("pg_e").set("xlabelactive", true); model.result("pg_e").set("window", "window4"); model.result("pg_e").set("ylabelactive", true); model.result("pg_e").set("titletype", "custom"); model.result("pg_e").set("solutionintitle", false); model.result("pg_e").set("typeintitle", false); model.result("pg_e").set("ylabel", "Z (mm)"); model.result("pg_e").set("windowtitleactive", true); model.result("pg_e").set("xlabel", "Radius (mm)"); // model.result("pg_e").set("solnum", "4"); model.result("pg_e").set("windowtitle", "Absolute Field"); model.result("pg_e").feature("surf1").set("descr", "Electric field norm"); model.result("pg_e").feature("surf1").set("rangecolormax", "400"); model.result("pg_e").feature("surf1").set("expr", "es.normE"); model.result("pg_e").feature("surf1").set("rangecoloractive", "on"); model.result("pg_e").feature("surf1").set("resolution", "fine"); model.result("pg_e").feature("surf1").set("rangecolormin", "200"); model.result("pg_e").feature("surf1").set("unit", "V/cm"); System.out.println("adding plotgroup along strips (left)"); model.result().create("pg4", "PlotGroup1D"); model.result("pg4").feature().create("lngr1", "LineGraph"); model.result("pg4").feature().create("lngr2", "LineGraph"); model.result("pg4").label("Potential along strips"); model.result("pg4").set("ylabel", "Electric potential (V)"); model.result("pg4").set("xlabel", "Arc length"); model.result("pg4").set("ylabelactive", false); model.result("pg4").set("xlabelactive", false); model.result("pg4").feature("lngr1").set("data", "cln1"); model.result("pg4").feature("lngr1").set("solrepresentation", "solnum"); model.result("pg4").feature("lngr1").set("legend", true); model.result("pg4").feature("lngr2").set("data", "cln2"); model.result("pg4").feature("lngr2").set("solrepresentation", "solnum"); model.result("pg4").feature("lngr2").set("legend", true); System.out.println("adding plotgroup Ez along z"); model.result().create("pg8", "PlotGroup1D"); model.result("pg8").feature().create("lngr2", "LineGraph"); model.result("pg8").label("Ez along z"); // model.result("pg8").set("solnum", new String[]{"4"}); model.result("pg8").set("ylabel", "dEz/Ez"); model.result("pg8").set("titletype", "custom"); model.result("pg8").set("windowtitleactive", true); model.result("pg8").set("ylabelactive", true); model.result("pg8").set("typeintitle", false); model.result("pg8").set("xlabel", "Z (cm)"); model.result("pg8").set("windowtitle", "Ez along Z"); model.result("pg8").set("window", "window8"); model.result("pg8").set("xlabelactive", true); model.result("pg8").set("innerinput", "manual"); model.result("pg8").feature("lngr2").label("Ez"); model.result("pg8").feature("lngr2").set("data", "cln1"); model.result("pg8").feature("lngr2").set("titletype", "custom"); model.result("pg8").feature("lngr2").set("solrepresentation", "solnum"); model.result("pg8").feature("lngr2").set("unit", "1"); model.result("pg8").feature("lngr2").set("typeintitle", false); model.result("pg8").feature("lngr2") .set("expr", "abs( (es.Ez- (Vg-Vd)/(Cz) ) / ( (Vg-Vd)/(Cz) ) )"); model.result("pg8").feature("lngr2") .set("descr", "Relative deviation from nominal drift field"); model.result("pg8").feature("lngr2").set("unitintitle", false); // model.result("pg8").feature("lngr2").set("solnum", new String[]{"4"}); model.result("pg8").feature("lngr2").set("innerinput", "manual"); model.result("pg8").feature("lngr2").set("descractive", true); model.result("pg8").feature("lngr2").set("legend", true); System.out.println("adding plotgroup Er along z"); model.result().create("pg11", "PlotGroup1D"); model.result("pg11").feature().create("lngr1", "LineGraph"); model.result("pg11").label("Er along z"); model.result("pg11").feature("lngr1").label("Er"); model.result("pg11").feature("lngr1").set("data", "cln1"); model.result("pg11").feature("lngr1").set("solrepresentation", "solnum"); model.result("pg11").feature("lngr1").set("unit", "V/m"); model.result("pg11").feature("lngr1").set("expr", "es.Er"); model.result("pg11").feature("lngr1") .set("descr", "Electric field, r component"); // model.result("pg11").feature("lngr1").set("solnum", new String[]{"4"}); model.result("pg11").feature("lngr1").set("innerinput", "manual"); model.result("pg11").feature("lngr1").set("legend", true); System.out.println("adding plotgroup Er along last strip"); model.result().create("pg9", "PlotGroup1D"); model.result("pg9").feature().create("lngr1", "LineGraph"); model.result("pg9").label("Er along last strip"); model.result("pg9").set("data", "cln4"); model.result("pg9").set("ylabel", "Electric field, r component (V/cm)"); model.result("pg9").set("windowtitleactive", true); model.result("pg9").set("xlabel", "Arc length"); model.result("pg9").set("windowtitle", "Er along ls"); model.result("pg9").set("window", "window7"); model.result("pg9").set("ylabelactive", false); model.result("pg9").set("xlabelactive", false); model.result("pg9").feature("lngr1").set("unit", "V/cm"); model.result("pg9").feature("lngr1").set("expr", "es.Er"); model.result("pg9").feature("lngr1") .set("descr", "Electric field, r component"); model.result("pg9").feature("lngr1").set("resolution", "fine"); model.result("pg9").feature("lngr1").set("legend", true); System.out.println("adding plotgroup Ez along last strip"); model.result().create("pg10", "PlotGroup1D"); model.result("pg10").feature().create("lngr1", "LineGraph"); model.result("pg10").label("Ez along last strip"); model.result("pg10").set("ylabel", "Electric field, z component (V/cm)"); model.result("pg10").set("windowtitleactive", true); model.result("pg10").set("xlabel", "Arc length"); model.result("pg10").set("windowtitle", "Ez along ls"); model.result("pg10").set("window", "window8"); model.result("pg10").set("ylabelactive", false); model.result("pg10").set("xlabelactive", false); model.result("pg10").feature("lngr1").set("data", "cln4"); model.result("pg10").feature("lngr1").set("solrepresentation", "solnum"); model.result("pg10").feature("lngr1").set("unit", "V/cm"); model.result("pg10").feature("lngr1").set("expr", "es.Ez"); model.result("pg10").feature("lngr1") .set("descr", "Electric field, z component"); model.result("pg10").feature("lngr1").set("legend", true); System.out.println("adding plotgroup Er along middle"); model.result().create("pg12", "PlotGroup1D"); model.result("pg12").feature().create("lngr1", "LineGraph"); model.result("pg12").label("Er alonng middle"); model.result("pg12").set("data", "cln6"); model.result("pg12").set("ylabel", "Electric field, r component (V/cm)"); model.result("pg12").set("xlabel", "Arc length"); model.result("pg12").set("ylog", true); model.result("pg12").set("ylabelactive", false); model.result("pg12").set("xlabelactive", false); model.result("pg12").feature("lngr1").set("unit", "V/cm"); model.result("pg12").feature("lngr1").set("expr", "es.Er"); model.result("pg12").feature("lngr1") .set("descr", "Electric field, r component"); model.result("pg12").feature("lngr1").set("resolution", "extrafine"); System.out.println("adding plotgroup radial field 1"); model.result().create("pg_er1", "PlotGroup2D"); model.result("pg_er1").feature().create("surf1", "Surface"); model.result("pg_er1").label("Radial Field 1"); model.result("pg_er1").set("data", "dset2"); model.result("pg_er1").set("xlabelactive", true); model.result("pg_er1").set("window", "window2"); model.result("pg_er1").set("ylabelactive", true); model.result("pg_er1").set("titletype", "custom"); model.result("pg_er1").set("solrepresentation", "solutioninfo"); model.result("pg_er1").set("solutionintitle", false); model.result("pg_er1").set("typeintitle", false); model.result("pg_er1").set("ylabel", "Z (mm)"); model.result("pg_er1").set("windowtitleactive", true); //model.result("pg_er1").set("looplevel", new String[]{"1"}); model.result("pg_er1").set("xlabel", "Radius (mm)"); model.result("pg_er1").set("windowtitle", "Radial Field"); model.result("pg_er1").feature("surf1") .set("descr", "Electric field, r component"); model.result("pg_er1").feature("surf1").set("rangecolormax", "20"); model.result("pg_er1").feature("surf1").set("expr", "es.Er"); model.result("pg_er1").feature("surf1").set("rangecoloractive", "on"); model.result("pg_er1").feature("surf1").set("resolution", "fine"); model.result("pg_er1").feature("surf1").set("rangecolormin", "-20"); model.result("pg_er1").feature("surf1").set("unit", "V/cm"); System.out.println("adding plotgroup drift field 1"); model.result().create("pg_ez1", "PlotGroup2D"); model.result("pg_ez1").feature().create("surf1", "Surface"); model.result("pg_ez1").label("Drift Field 1"); model.result("pg_ez1").set("data", "dset2"); model.result("pg_ez1").set("xlabelactive", true); model.result("pg_ez1").set("window", "window3"); model.result("pg_ez1").set("ylabelactive", true); model.result("pg_ez1").set("titletype", "custom"); model.result("pg_ez1").set("solrepresentation", "solutioninfo"); model.result("pg_ez1").set("solutionintitle", false); model.result("pg_ez1").set("typeintitle", false); model.result("pg_ez1").set("ylabel", "Z (mm)"); model.result("pg_ez1").set("windowtitleactive", true); //model.result("pg_ez1").set("looplevel", new String[]{"1"}); model.result("pg_ez1").set("xlabel", "Radius (mm)"); model.result("pg_ez1").set("windowtitle", "Drift Field"); model.result("pg_ez1").feature("surf1") .set("descr", "Electric field, z component"); model.result("pg_ez1").feature("surf1").set("rangecolormax", "400"); model.result("pg_ez1").feature("surf1").set("expr", "es.Ez"); model.result("pg_ez1").feature("surf1").set("rangecoloractive", "on"); model.result("pg_ez1").feature("surf1").set("resolution", "fine"); model.result("pg_ez1").feature("surf1").set("rangecolormin", "200"); model.result("pg_ez1").feature("surf1").set("unit", "V/cm"); System.out.println("adding plotgroup abs field 1"); model.result().create("pg_e1", "PlotGroup2D"); model.result("pg_e1").feature().create("surf1", "Surface"); model.result("pg_e1").label("Abs Field 1"); model.result("pg_e1").set("data", "dset2"); model.result("pg_e1").set("xlabelactive", true); model.result("pg_e1").set("window", "window4"); model.result("pg_e1").set("ylabelactive", true); model.result("pg_e1").set("titletype", "custom"); model.result("pg_e1").set("solrepresentation", "solutioninfo"); model.result("pg_e1").set("solutionintitle", false); model.result("pg_e1").set("typeintitle", false); model.result("pg_e1").set("ylabel", "Z (mm)"); model.result("pg_e1").set("windowtitleactive", true); // model.result("pg_e1").set("looplevel", new String[]{"1"}); model.result("pg_e1").set("xlabel", "Radius (mm)"); model.result("pg_e1").set("windowtitle", "Absolute Field"); model.result("pg_e1").feature("surf1") .set("descr", "Electric field norm"); model.result("pg_e1").feature("surf1").set("rangecolormax", "400"); model.result("pg_e1").feature("surf1").set("expr", "es.normE"); model.result("pg_e1").feature("surf1").set("rangecoloractive", "on"); model.result("pg_e1").feature("surf1").set("resolution", "fine"); model.result("pg_e1").feature("surf1").set("rangecolormin", "200"); model.result("pg_e1").feature("surf1").set("unit", "V/cm"); System.out.println("adding plotgroup ez along middle"); model.result().create("pg13", "PlotGroup1D"); model.result("pg13").feature().create("lngr1", "LineGraph"); model.result("pg13").feature().create("lngr2", "LineGraph"); model.result("pg13").feature().create("lngr3", "LineGraph"); model.result("pg13").label("Ez diff along middle"); model.result("pg13").set("data", "cln6"); // model.result("pg13").set("solnum", new String[]{"3", "4", "5", "6"}); model.result("pg13") .set("ylabel", "abs( (es.Ez - (Vg-Vd)/Cz ) / ( ( Vg-Vd)/Cz ) ) (1)"); model.result("pg13").set("xlabel", "Reversed arc length"); model.result("pg13").set("innerinput", "manual"); model.result("pg13").set("ylog", true); model.result("pg13").set("ylabelactive", false); model.result("pg13").set("xlabelactive", false); model.result("pg13").feature("lngr1").set("unit", "1"); model.result("pg13").feature("lngr1").set("xdata", "reversedarc"); model.result("pg13").feature("lngr1") .set("expr", "abs( (es.Ez - (Vg-Vd)/Cz ) / ( ( Vg-Vd)/Cz ) )"); model.result("pg13").feature("lngr1") .set("descr", "abs( (es.Ez - (Vg-Vd)/Cz ) / ( ( Vg-Vd)/Cz ) )"); model.result("pg13").feature("lngr1").set("legend", true); model.result("pg13").feature("lngr2").active(false); model.result("pg13").feature("lngr2").set("unit", "V/m"); model.result("pg13").feature("lngr2").set("expr", "(Vg-Vd)/(Cz)"); model.result("pg13").feature("lngr2").set("descr", "(Vg-Vd)/(Cz)"); model.result("pg13").feature("lngr3").active(false); model.result("pg13").feature("lngr3").set("unit", "cV/m"); model.result("pg13").feature("lngr3").set("expr", "es.Ez"); model.result("pg13").feature("lngr3") .set("descr", "Electric field, z component"); model.result("pg13").feature("lngr3").set("legend", true); //add exports System.out.println("adding export Erlines"); model.result().export().create("plot2", "Plot"); model.result().export("plot2").active(false); model.result().export("plot2").label("Erlines"); model.result().export("plot2") .set("filename", outpath+"field_sim/fieldlines_full_field_-341.00_-312.90_0s0_4.700_727.951sh0.000_0.0000_perfect__Er_lines.txt"); model.result().export("plot2").set("plotgroup", "pg8"); System.out.println("adding export Ez_diff"); model.result().export().create("plot3", "Plot"); model.result().export("plot2").set("plot", "lngr2"); model.result().export("plot3").active(false); model.result().export("plot3").label("Ez_diff"); model.result().export("plot3") .set("filename", outpath+"field_sim/fieldlines_full_field_-341.00_-312.90_0s0_4.700_727.951sh0.000_0.0000_perfect__Ezdiff_lines.txt"); model.result().export("plot3").set("plotgroup", "pg8"); model.result().export("plot3").set("plot", "lngr2"); System.out.println("adding export Er inner perfect"); model.result().export().create("img1", "Image2D"); model.result().export("img1").label("Er inner perfect"); model.result().export("img1").set("pngfilename", outpath+"/field_radial_strips.png"); model.result().export("img1").set("sizedesc", "102 x 51 mm"); model.result().export("img1").set("view", "view4"); model.result().export("img1").set("plotgroup", "pg_er"); model.result().export("img1").set("unit", "px"); model.result().export("img1").set("height", "1400"); model.result().export("img1").set("width", "2400"); model.result().export("img1").set("lockratio", "off"); model.result().export("img1").set("resolution", "600"); //model.result().export("img1").set("size", "manual"); model.result().export("img1").set("antialias", "on"); model.result().export("img1").set("title", "on"); model.result().export("img1").set("legend", "on"); model.result().export("img1").set("logo", "off"); model.result().export("img1").set("options", "on"); model.result().export("img1").set("fontsize", "5"); model.result().export("img1").set("customcolor", new double[]{1, 1, 1}); model.result().export("img1").set("background", "color"); model.result().export("img1").set("qualitylevel", "92"); model.result().export("img1").set("qualityactive", "off"); model.result().export("img1").set("imagetype", "png"); model.result().export("img1").set("axes", "on"); System.out.println("adding export Ez inner perfect"); model.result().export().create("img2", "Image2D"); model.result().export("img2").label("Ez inner perfect"); model.result().export("img2").set("pngfilename", outpath+"/field_z_strips.png"); model.result().export("img2").set("sizedesc", "102 x 51 mm"); model.result().export("img2").set("view", "view4"); model.result().export("img2").set("plotgroup", "pg_ez"); model.result().export("img2").set("unit", "px"); model.result().export("img2").set("height", "1400"); model.result().export("img2").set("width", "2400"); model.result().export("img2").set("lockratio", "off"); model.result().export("img2").set("resolution", "600"); //model.result().export("img2").set("size", "manual"); model.result().export("img2").set("antialias", "on"); model.result().export("img2").set("title", "on"); model.result().export("img2").set("legend", "on"); model.result().export("img2").set("logo", "off"); model.result().export("img2").set("options", "on"); model.result().export("img2").set("fontsize", "5"); model.result().export("img2").set("customcolor", new double[]{1, 1, 1}); model.result().export("img2").set("background", "color"); model.result().export("img2").set("qualitylevel", "92"); model.result().export("img2").set("qualityactive", "off"); model.result().export("img2").set("imagetype", "png"); model.result().export("img2").set("axes", "on"); System.out.println("adding export E inner perfect"); model.result().export().create("img3", "Image2D"); model.result().export("img3").label("E inner perfect"); model.result().export("img3").set("pngfilename", outpath+"/field_abs_strips.png"); model.result().export("img3").set("sizedesc", "102 x 51 mm"); model.result().export("img3").set("view", "view4"); model.result().export("img3").set("plotgroup", "pg_e"); model.result().export("img3").set("unit", "px"); model.result().export("img3").set("height", "1400"); model.result().export("img3").set("width", "2400"); model.result().export("img3").set("lockratio", "off"); model.result().export("img3").set("resolution", "600"); //model.result().export("img3").set("size", "manual"); model.result().export("img3").set("antialias", "on"); model.result().export("img3").set("title", "on"); model.result().export("img3").set("legend", "on"); model.result().export("img3").set("logo", "off"); model.result().export("img3").set("options", "on"); model.result().export("img3").set("fontsize", "5"); model.result().export("img3").set("customcolor", new double[]{1, 1, 1}); model.result().export("img3").set("background", "color"); model.result().export("img3").set("qualitylevel", "92"); model.result().export("img3").set("qualityactive", "off"); model.result().export("img3").set("imagetype", "png"); model.result().export("img3").set("axes", "on"); System.out.println("adding export Er cathode perfect"); model.result().export().create("img4", "Image2D"); model.result().export("img4").label("Er cathode perfect"); model.result().export("img4") .set("pngfilename", outpath+"/field_radial_cathode.png"); model.result().export("img4").set("sizedesc", "102 x 51 mm"); model.result().export("img4").set("view", "view5"); model.result().export("img4").set("plotgroup", "pg_er"); model.result().export("img4").set("unit", "px"); model.result().export("img4").set("height", "1400"); model.result().export("img4").set("width", "2400"); model.result().export("img4").set("lockratio", "off"); model.result().export("img4").set("resolution", "600"); //model.result().export("img4").set("size", "manual"); model.result().export("img4").set("antialias", "on"); model.result().export("img4").set("title", "on"); model.result().export("img4").set("legend", "on"); model.result().export("img4").set("logo", "off"); model.result().export("img4").set("options", "on"); model.result().export("img4").set("fontsize", "5"); model.result().export("img4").set("customcolor", new double[]{1, 1, 1}); model.result().export("img4").set("background", "color"); model.result().export("img4").set("qualitylevel", "92"); model.result().export("img4").set("qualityactive", "off"); model.result().export("img4").set("imagetype", "png"); model.result().export("img4").set("axes", "on"); System.out.println("adding export Ez cathode perfect"); model.result().export().create("img5", "Image2D"); model.result().export("img5").label("Ez cathode perfect"); model.result().export("img5") .set("pngfilename", outpath+"/field_z_cathode.png"); model.result().export("img5").set("sizedesc", "102 x 51 mm"); model.result().export("img5").set("view", "view5"); model.result().export("img5").set("plotgroup", "pg_ez"); model.result().export("img5").set("unit", "px"); model.result().export("img5").set("height", "1400"); model.result().export("img5").set("width", "2400"); model.result().export("img5").set("lockratio", "off"); model.result().export("img5").set("resolution", "600"); //model.result().export("img5").set("size", "manual"); model.result().export("img5").set("antialias", "on"); model.result().export("img5").set("title", "on"); model.result().export("img5").set("legend", "on"); model.result().export("img5").set("logo", "off"); model.result().export("img5").set("options", "on"); model.result().export("img5").set("fontsize", "5"); model.result().export("img5").set("customcolor", new double[]{1, 1, 1}); model.result().export("img5").set("background", "color"); model.result().export("img5").set("qualitylevel", "92"); model.result().export("img5").set("qualityactive", "off"); model.result().export("img5").set("imagetype", "png"); model.result().export("img5").set("axes", "on"); System.out.println("adding export E cathode perfect"); model.result().export().create("img6", "Image2D"); model.result().export("img6").label("E cathode perfect"); model.result().export("img6") .set("pngfilename", outpath+"/field_abs_cathode.png"); model.result().export("img6").set("sizedesc", "102 x 51 mm"); model.result().export("img6").set("view", "view5"); model.result().export("img6").set("plotgroup", "pg_e"); model.result().export("img6").set("unit", "px"); model.result().export("img6").set("height", "1400"); model.result().export("img6").set("width", "2400"); model.result().export("img6").set("lockratio", "off"); model.result().export("img6").set("resolution", "600"); //model.result().export("img6").set("size", "manual"); model.result().export("img6").set("antialias", "on"); model.result().export("img6").set("title", "on"); model.result().export("img6").set("legend", "on"); model.result().export("img6").set("logo", "off"); model.result().export("img6").set("options", "on"); model.result().export("img6").set("fontsize", "5"); model.result().export("img6").set("customcolor", new double[]{1, 1, 1}); model.result().export("img6").set("background", "color"); model.result().export("img6").set("qualitylevel", "92"); model.result().export("img6").set("qualityactive", "off"); model.result().export("img6").set("imagetype", "png"); model.result().export("img6").set("axes", "on"); System.out.println("adding export Er ls perfect"); model.result().export().create("img13", "Image2D"); model.result().export("img13").label("Er ls perfect"); model.result().export("img13") .set("pngfilename", outpath+"/field_radial_ls.png"); model.result().export("img13").set("sizedesc", "102 x 51 mm"); model.result().export("img13").set("view", "view6"); model.result().export("img13").set("plotgroup", "pg_er"); model.result().export("img13").set("unit", "px"); model.result().export("img13").set("height", "1400"); model.result().export("img13").set("width", "2400"); model.result().export("img13").set("lockratio", "off"); model.result().export("img13").set("resolution", "600"); //model.result().export("img13").set("size", "manual"); model.result().export("img13").set("antialias", "on"); model.result().export("img13").set("title", "on"); model.result().export("img13").set("legend", "on"); model.result().export("img13").set("logo", "off"); model.result().export("img13").set("options", "on"); model.result().export("img13").set("fontsize", "5"); model.result().export("img13").set("customcolor", new double[]{1, 1, 1}); model.result().export("img13").set("background", "color"); model.result().export("img13").set("qualitylevel", "92"); model.result().export("img13").set("qualityactive", "off"); model.result().export("img13").set("imagetype", "png"); model.result().export("img13").set("axes", "on"); System.out.println("adding export Ez ls perfect"); model.result().export().create("img14", "Image2D"); model.result().export("img14").label("Ez ls perfect"); model.result().export("img14") .set("pngfilename", outpath+"/field_z_ls.png"); model.result().export("img14").set("sizedesc", "102 x 51 mm"); model.result().export("img14").set("view", "view6"); model.result().export("img14").set("plotgroup", "pg_ez"); model.result().export("img14").set("unit", "px"); model.result().export("img14").set("height", "1400"); model.result().export("img14").set("width", "2400"); model.result().export("img14").set("lockratio", "off"); model.result().export("img14").set("resolution", "600"); //model.result().export("img14").set("size", "manual"); model.result().export("img14").set("antialias", "on"); model.result().export("img14").set("title", "on"); model.result().export("img14").set("legend", "on"); model.result().export("img14").set("logo", "off"); model.result().export("img14").set("options", "on"); model.result().export("img14").set("fontsize", "5"); model.result().export("img14").set("customcolor", new double[]{1, 1, 1}); model.result().export("img14").set("background", "color"); model.result().export("img14").set("qualitylevel", "92"); model.result().export("img14").set("qualityactive", "off"); model.result().export("img14").set("imagetype", "png"); model.result().export("img14").set("axes", "on"); System.out.println("adding export E ls perfect"); model.result().export().create("img15", "Image2D"); model.result().export("img15").label("E ls perfect"); model.result().export("img15") .set("pngfilename", outpath+"/field_abs_ls.png"); model.result().export("img15").set("sizedesc", "102 x 51 mm"); model.result().export("img15").set("view", "view6"); model.result().export("img15").set("plotgroup", "pg_e"); model.result().export("img15").set("unit", "px"); model.result().export("img15").set("height", "1400"); model.result().export("img15").set("width", "2400"); model.result().export("img15").set("lockratio", "off"); model.result().export("img15").set("resolution", "600"); //model.result().export("img15").set("size", "manual"); model.result().export("img15").set("antialias", "on"); model.result().export("img15").set("title", "on"); model.result().export("img15").set("legend", "on"); model.result().export("img15").set("logo", "off"); model.result().export("img15").set("options", "on"); model.result().export("img15").set("fontsize", "5"); model.result().export("img15").set("customcolor", new double[]{1, 1, 1}); model.result().export("img15").set("background", "color"); model.result().export("img15").set("qualitylevel", "92"); model.result().export("img15").set("qualityactive", "off"); model.result().export("img15").set("imagetype", "png"); model.result().export("img15").set("axes", "on"); System.out.println("adding export Er solder perfect"); model.result().export().create("img19", "Image2D"); model.result().export("img19").label("Er solder perfect"); model.result().export("img19") .set("pngfilename", outpath+"/field_radial_solder.png"); model.result().export("img19").set("sizedesc", "102 x 51 mm"); model.result().export("img19").set("view", "view7"); model.result().export("img19").set("plotgroup", "pg_er"); model.result().export("img19").set("unit", "px"); model.result().export("img19").set("height", "1400"); model.result().export("img19").set("width", "2400"); model.result().export("img19").set("lockratio", "off"); model.result().export("img19").set("resolution", "600"); //model.result().export("img19").set("size", "manual"); model.result().export("img19").set("antialias", "on"); model.result().export("img19").set("title", "on"); model.result().export("img19").set("legend", "on"); model.result().export("img19").set("logo", "off"); model.result().export("img19").set("options", "on"); model.result().export("img19").set("fontsize", "5"); model.result().export("img19").set("customcolor", new double[]{1, 1, 1}); model.result().export("img19").set("background", "color"); model.result().export("img19").set("qualitylevel", "92"); model.result().export("img19").set("qualityactive", "off"); model.result().export("img19").set("imagetype", "png"); model.result().export("img19").set("axes", "on"); //chage image export attributes! System.out.println("adding export Ez solder perfect"); model.result().export().create("img20", "Image2D"); model.result().export("img20").label("Ez solder perfect"); model.result().export("img20") .set("pngfilename", outpath+"/field_z_solder.png"); model.result().export("img20").set("sizedesc", "102 x 51 mm"); model.result().export("img20").set("view", "view7"); model.result().export("img20").set("plotgroup", "pg_ez"); model.result().export("img20").set("unit", "px"); model.result().export("img20").set("height", "1400"); model.result().export("img20").set("width", "2400"); model.result().export("img20").set("lockratio", "off"); model.result().export("img20").set("resolution", "600"); //model.result().export("img20").set("size", "manual"); model.result().export("img20").set("antialias", "on"); model.result().export("img20").set("title", "on"); model.result().export("img20").set("legend", "on"); model.result().export("img20").set("logo", "off"); model.result().export("img20").set("options", "on"); model.result().export("img20").set("fontsize", "5"); model.result().export("img20").set("customcolor", new double[]{1, 1, 1}); model.result().export("img20").set("background", "color"); model.result().export("img20").set("qualitylevel", "92"); model.result().export("img20").set("qualityactive", "off"); model.result().export("img20").set("imagetype", "png"); model.result().export("img20").set("axes", "on"); System.out.println("adding export E solder perfect"); model.result().export().create("img21", "Image2D"); model.result().export("img21").label("E solder perfect"); model.result().export("img21") .set("pngfilename", outpath+"/field_abs_solder.png"); model.result().export("img21").set("sizedesc", "102 x 51 mm"); model.result().export("img21").set("view", "view7"); model.result().export("img21").set("plotgroup", "pg_e"); model.result().export("img21").set("unit", "px"); model.result().export("img21").set("height", "1400"); model.result().export("img21").set("width", "2400"); model.result().export("img21").set("lockratio", "off"); model.result().export("img21").set("resolution", "600"); //model.result().export("img21").set("size", "manual"); model.result().export("img21").set("antialias", "on"); model.result().export("img21").set("title", "on"); model.result().export("img21").set("legend", "on"); model.result().export("img21").set("logo", "off"); model.result().export("img21").set("options", "on"); model.result().export("img21").set("fontsize", "5"); model.result().export("img21").set("customcolor", new double[]{1, 1, 1}); model.result().export("img21").set("background", "color"); model.result().export("img21").set("qualitylevel", "92"); model.result().export("img21").set("qualityactive", "off"); model.result().export("img21").set("imagetype", "png"); model.result().export("img21").set("axes", "on"); System.out.println("adding export Er inner real"); model.result().export().create("img7", "Image2D"); model.result().export("img7").label("Er inner real"); model.result().export("img7") .set("pngfilename", outpath+"/field_radial_strips_shorts.png"); model.result().export("img7").set("sizedesc", "102 x 51 mm"); model.result().export("img7").set("view", "view4"); model.result().export("img7").set("plotgroup", "pg_er1"); model.result().export("img7").set("unit", "px"); model.result().export("img7").set("height", "1400"); model.result().export("img7").set("width", "2400"); model.result().export("img7").set("lockratio", "off"); model.result().export("img7").set("resolution", "600"); //model.result().export("img7").set("size", "manual"); model.result().export("img7").set("antialias", "on"); model.result().export("img7").set("title", "on"); model.result().export("img7").set("legend", "on"); model.result().export("img7").set("logo", "off"); model.result().export("img7").set("options", "on"); model.result().export("img7").set("fontsize", "5"); model.result().export("img7").set("customcolor", new double[]{1, 1, 1}); model.result().export("img7").set("background", "color"); model.result().export("img7").set("qualitylevel", "92"); model.result().export("img7").set("qualityactive", "off"); model.result().export("img7").set("imagetype", "png"); model.result().export("img7").set("axes", "on"); System.out.println("adding export Ez inner real"); model.result().export().create("img8", "Image2D"); model.result().export("img8").label("Ez inner real"); model.result().export("img8") .set("pngfilename", outpath+"/field_z_strips_shorts.png"); model.result().export("img8").set("sizedesc", "102 x 51 mm"); model.result().export("img8").set("view", "view4"); model.result().export("img8").set("plotgroup", "pg_ez1"); model.result().export("img8").set("unit", "px"); model.result().export("img8").set("height", "1400"); model.result().export("img8").set("width", "2400"); model.result().export("img8").set("lockratio", "off"); model.result().export("img8").set("resolution", "600"); //model.result().export("img8").set("size", "manual"); model.result().export("img8").set("antialias", "on"); model.result().export("img8").set("title", "on"); model.result().export("img8").set("legend", "on"); model.result().export("img8").set("logo", "off"); model.result().export("img8").set("options", "on"); model.result().export("img8").set("fontsize", "5"); model.result().export("img8").set("customcolor", new double[]{1, 1, 1}); model.result().export("img8").set("background", "color"); model.result().export("img8").set("qualitylevel", "92"); model.result().export("img8").set("qualityactive", "off"); model.result().export("img8").set("imagetype", "png"); model.result().export("img8").set("axes", "on"); System.out.println("adding export E inner real"); model.result().export().create("img9", "Image2D"); model.result().export("img9").label("E inner real"); model.result().export("img9") .set("pngfilename", outpath+"/field_abs_strips_shorts.png"); model.result().export("img9").set("sizedesc", "102 x 51 mm"); model.result().export("img9").set("view", "view4"); model.result().export("img9").set("plotgroup", "pg_e1"); model.result().export("img9").set("unit", "px"); model.result().export("img9").set("height", "1400"); model.result().export("img9").set("width", "2400"); model.result().export("img9").set("lockratio", "off"); model.result().export("img9").set("resolution", "600"); //model.result().export("img9").set("size", "manual"); model.result().export("img9").set("antialias", "on"); model.result().export("img9").set("title", "on"); model.result().export("img9").set("legend", "on"); model.result().export("img9").set("logo", "off"); model.result().export("img9").set("options", "on"); model.result().export("img9").set("fontsize", "5"); model.result().export("img9").set("customcolor", new double[]{1, 1, 1}); model.result().export("img9").set("background", "color"); model.result().export("img9").set("qualitylevel", "92"); model.result().export("img9").set("qualityactive", "off"); model.result().export("img9").set("imagetype", "png"); model.result().export("img9").set("axes", "on"); System.out.println("adding export Er cathode real"); model.result().export().create("img10", "Image2D"); model.result().export("img10").label("Er cathode real"); model.result().export("img10") .set("pngfilename", outpath+"/field_radial_cathode_shorts.png"); model.result().export("img10").set("sizedesc", "102 x 51 mm"); model.result().export("img10").set("view", "view5"); model.result().export("img10").set("plotgroup", "pg_er1"); model.result().export("img10").set("unit", "px"); model.result().export("img10").set("height", "1400"); model.result().export("img10").set("width", "2400"); model.result().export("img10").set("lockratio", "off"); model.result().export("img10").set("resolution", "600"); //model.result().export("img10").set("size", "manual"); model.result().export("img10").set("antialias", "on"); model.result().export("img10").set("title", "on"); model.result().export("img10").set("legend", "on"); model.result().export("img10").set("logo", "off"); model.result().export("img10").set("options", "on"); model.result().export("img10").set("fontsize", "5"); model.result().export("img10").set("customcolor", new double[]{1, 1, 1}); model.result().export("img10").set("background", "color"); model.result().export("img10").set("qualitylevel", "92"); model.result().export("img10").set("qualityactive", "off"); model.result().export("img10").set("imagetype", "png"); model.result().export("img10").set("axes", "on"); System.out.println("adding export Ez cathode real"); model.result().export().create("img11", "Image2D"); model.result().export("img11").label("Ez cathode real"); model.result().export("img11") .set("pngfilename", outpath+"/field_z_cathode_shorts.png"); model.result().export("img11").set("sizedesc", "102 x 51 mm"); model.result().export("img11").set("view", "view5"); model.result().export("img11").set("plotgroup", "pg_ez1"); model.result().export("img11").set("unit", "px"); model.result().export("img11").set("height", "1400"); model.result().export("img11").set("width", "2400"); model.result().export("img11").set("lockratio", "off"); model.result().export("img11").set("resolution", "600"); //model.result().export("img11").set("size", "manual"); model.result().export("img11").set("antialias", "on"); model.result().export("img11").set("title", "on"); model.result().export("img11").set("legend", "on"); model.result().export("img11").set("logo", "off"); model.result().export("img11").set("options", "on"); model.result().export("img11").set("fontsize", "5"); model.result().export("img11").set("customcolor", new double[]{1, 1, 1}); model.result().export("img11").set("background", "color"); model.result().export("img11").set("qualitylevel", "92"); model.result().export("img11").set("qualityactive", "off"); model.result().export("img11").set("imagetype", "png"); model.result().export("img11").set("axes", "on"); System.out.println("adding export E cathode real"); model.result().export().create("img12", "Image2D"); model.result().export("img12").label("E cathode real"); model.result().export("img12") .set("pngfilename", outpath+"/field_abs_cathode_shorts.png"); model.result().export("img12").set("sizedesc", "102 x 51 mm"); model.result().export("img12").set("view", "view5"); model.result().export("img12").set("plotgroup", "pg_e1"); model.result().export("img12").set("unit", "px"); model.result().export("img12").set("height", "1400"); model.result().export("img12").set("width", "2400"); model.result().export("img12").set("lockratio", "off"); model.result().export("img12").set("resolution", "600"); //model.result().export("img12").set("size", "manual"); model.result().export("img12").set("antialias", "on"); model.result().export("img12").set("title", "on"); model.result().export("img12").set("legend", "on"); model.result().export("img12").set("logo", "off"); model.result().export("img12").set("options", "on"); model.result().export("img12").set("fontsize", "5"); model.result().export("img12").set("customcolor", new double[]{1, 1, 1}); model.result().export("img12").set("background", "color"); model.result().export("img12").set("qualitylevel", "92"); model.result().export("img12").set("qualityactive", "off"); model.result().export("img12").set("imagetype", "png"); model.result().export("img12").set("axes", "on"); System.out.println("adding export Er ls real"); model.result().export().create("img16", "Image2D"); model.result().export("img16").label("Er ls real"); model.result().export("img16") .set("pngfilename", outpath+"/field_radial_ls_shorts.png"); model.result().export("img16").set("sizedesc", "102 x 51 mm"); model.result().export("img16").set("view", "view6"); model.result().export("img16").set("plotgroup", "pg_er1"); model.result().export("img16").set("unit", "px"); model.result().export("img16").set("height", "1400"); model.result().export("img16").set("width", "2400"); model.result().export("img16").set("lockratio", "off"); model.result().export("img16").set("resolution", "600"); //model.result().export("img16").set("size", "manual"); model.result().export("img16").set("antialias", "on"); model.result().export("img16").set("title", "on"); model.result().export("img16").set("legend", "on"); model.result().export("img16").set("logo", "off"); model.result().export("img16").set("options", "on"); model.result().export("img16").set("fontsize", "5"); model.result().export("img16").set("customcolor", new double[]{1, 1, 1}); model.result().export("img16").set("background", "color"); model.result().export("img16").set("qualitylevel", "92"); model.result().export("img16").set("qualityactive", "off"); model.result().export("img16").set("imagetype", "png"); model.result().export("img16").set("axes", "on"); System.out.println("adding export Ez ls real"); model.result().export().create("img17", "Image2D"); model.result().export("img17").label("Ez ls real"); model.result().export("img17") .set("pngfilename", outpath+"/field_z_ls_shorts.png"); model.result().export("img17").set("sizedesc", "102 x 51 mm"); model.result().export("img17").set("view", "view6"); model.result().export("img17").set("plotgroup", "pg_ez1"); model.result().export("img17").set("unit", "px"); model.result().export("img17").set("height", "1400"); model.result().export("img17").set("width", "2400"); model.result().export("img17").set("lockratio", "off"); model.result().export("img17").set("resolution", "600"); //model.result().export("img17").set("size", "manual"); model.result().export("img17").set("antialias", "on"); model.result().export("img17").set("title", "on"); model.result().export("img17").set("legend", "on"); model.result().export("img17").set("logo", "off"); model.result().export("img17").set("options", "on"); model.result().export("img17").set("fontsize", "5"); model.result().export("img17").set("customcolor", new double[]{1, 1, 1}); model.result().export("img17").set("background", "color"); model.result().export("img17").set("qualitylevel", "92"); model.result().export("img17").set("qualityactive", "off"); model.result().export("img17").set("imagetype", "png"); model.result().export("img17").set("axes", "on"); System.out.println("adding export E ls real"); model.result().export().create("img18", "Image2D"); model.result().export("img18").label("E ls real"); model.result().export("img18") .set("pngfilename", outpath+"/field_abs_ls_shorts.png"); model.result().export("img18").set("sizedesc", "102 x 51 mm"); model.result().export("img18").set("view", "view6"); model.result().export("img18").set("plotgroup", "pg_e1"); model.result().export("img18").set("unit", "px"); model.result().export("img18").set("height", "1400"); model.result().export("img18").set("width", "2400"); model.result().export("img18").set("lockratio", "off"); model.result().export("img18").set("resolution", "600"); //model.result().export("img18").set("size", "manual"); model.result().export("img18").set("antialias", "on"); model.result().export("img18").set("title", "on"); model.result().export("img18").set("legend", "on"); model.result().export("img18").set("logo", "off"); model.result().export("img18").set("options", "on"); model.result().export("img18").set("fontsize", "5"); model.result().export("img18").set("customcolor", new double[]{1, 1, 1}); model.result().export("img18").set("background", "color"); model.result().export("img18").set("qualitylevel", "92"); model.result().export("img18").set("qualityactive", "off"); model.result().export("img18").set("imagetype", "png"); model.result().export("img18").set("axes", "on"); System.out.println("adding export data along left"); model.result().export().create("data2", "Data"); model.result().export("data2").set("data", "cln1"); model.result().export("data2") .set("expr", new String[]{"es.Er", "es.Ez"}); model.result().export("data2").set("level", "line"); model.result().export("data2").set("unit", new String[]{"V/cm", "V/m"}); model.result().export("data2").set("resolution", "finer"); model.result().export("data2") .set("filename", outpath+"/tpc_field_COMSOL/exports/field_along_lines2.txt"); model.result().export("data2") .set("descr", new String[]{"Electric field, r component", "Electric field, z component"}); } } }