From 0aa51055d3f4370ff4c8f33f185bee618108312f Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Tue, 8 Dec 2015 16:25:16 -0500 Subject: [PATCH 01/13] Made Sure Selections and Terminals are Good for Inner Strips Selections and Terminals are created correctly for inner strips, but resistors have not been configured to connect inner strips to anode, cathode and each other. --- src/TPC.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index a9e00b6..23d85af 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips. - public int FSENumber = 80; // Number of strips, 80, changed to 4 to load faster + public int FSENumber = 4; // Number of strips, 80, changed to 4 to load faster public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -175,11 +175,11 @@ public void makeBoxSelection(String name, double rmin, double zmin, double rmax, public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,6,8,328,330}); // Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,6,8,24,26}); //,2,4,6,8,328,330}); // Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ - makeFSETerminal(i); - //makeInnerFSE(i); + makeFSETerminal(i); + makeInnerFSE(i); } this.makeCathodeTerminal(); //this.makeGroundStripTerminal(); @@ -229,7 +229,7 @@ public void makeCircuit(){ this.connectCathode(); for(int i = 1; i < FSENumber; i++){ this.addResistor("Resistor"+i,i+"",i+1+"",Resistance+"[\u03a9]"); - this.addItoU("ItoU"+i,i+1+"","G",i+1); + this.addItoU("ItoU"+i,i+1+"","G",2*i+1); //this.addResistor("ResistorTwo"+i,"inner"+i, "inner"+(i+1), Resistance+"[\u03a9]"); //this.addItoU("ItoUTwo"+i,"inner"+(i+1),"G",2*i+2); } @@ -249,7 +249,7 @@ public void connectAnode(){ } public void connectCathode(){ this.addResistor("zeroResistor2outer","C1","C2","0[\u03a9]"); - this.addItoU("ItoUC","C1","G",FSENumber+1); + this.addItoU("ItoUC","C1","G",2*FSENumber+1); this.addResistor("Resistor"+FSENumber,FSENumber+"","C2",Resistance+"[\u03a9]"); //this.addResistor("zeroResistor2inner","C1","C2","0[\u03a9]"); @@ -280,7 +280,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,6,8,328,330}); // Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,6,8,24,26}); //328,330}); // Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From 3470624acc36bb2f6b44059ad1a20c6695e98eb0 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Fri, 11 Dec 2015 16:11:50 -0500 Subject: [PATCH 02/13] Successful Circuitry with FSENumber=4 This computes (finally) with added left hand side resistors. FSENumber=4 though, so we now need to ground the grounding strips and change FSENumber to 80. --- src/TPC.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index 23d85af..7fd3a95 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -230,8 +230,8 @@ public void makeCircuit(){ for(int i = 1; i < FSENumber; i++){ this.addResistor("Resistor"+i,i+"",i+1+"",Resistance+"[\u03a9]"); this.addItoU("ItoU"+i,i+1+"","G",2*i+1); - //this.addResistor("ResistorTwo"+i,"inner"+i, "inner"+(i+1), Resistance+"[\u03a9]"); - //this.addItoU("ItoUTwo"+i,"inner"+(i+1),"G",2*i+2); + this.addResistor("InnerResistor"+i,"inner"+i, "inner"+(i+1), Resistance+"[\u03a9]"); + this.addItoU("InnerItoU"+i,"inner"+(i+1),"G",2*i+2); } this.connectVoltageSource(); } @@ -242,19 +242,19 @@ public void connectAnode(){ this.addItoU("ItoU0","0","G",1); this.addResistor("Resistor0","1","G",Resistance+"[\u03a9]"); - //this.addResistor("zeroResistor1inner","inner0","1","0[\u03a9]"); // attempt here to connect inner FSE's to anode - //this.addItoU("ItoU0inner","inner0","G",2); // not sure if this works - //this.addResistor("InnerFSEtoAnode","inner"+1,"G",Resistance+"[\u03a9]"); // same may have to be done for cathode + this.addResistor("zeroResistor1inner","inner0","inner1","0[\u03a9]"); // attempt here to connect inner FSE's to anode + this.addItoU("ItoU0inner","inner0","G",2); // not sure if this works + this.addResistor("InnerFSEtoAnode","inner"+1,"G",Resistance+"[\u03a9]"); // same may have to be done for cathode } public void connectCathode(){ this.addResistor("zeroResistor2outer","C1","C2","0[\u03a9]"); - this.addItoU("ItoUC","C1","G",2*FSENumber+1); + this.addItoU("ItoUC","C1","G",2*FSENumber+1); //2*FSENumber+2*(FSENumber-1)-1 or 2*FSENumber+1 this.addResistor("Resistor"+FSENumber,FSENumber+"","C2",Resistance+"[\u03a9]"); //this.addResistor("zeroResistor2inner","C1","C2","0[\u03a9]"); - //this.addItoU("ItoUCinner","C1","G",2*FSENumber); - //this.addResistor("InnerFSEtoCathode","inner"+FSENumber,"C2",Resistance+"[\u03a9]"); + //this.addItoU("ItoUCinner","C1","G",2*FSENumber+1); if doesn't work add innerC1 to G here + this.addResistor("InnerFSEtoCathode","inner"+FSENumber,"C2",Resistance+"[\u03a9]"); } @SuppressWarnings("deprecation") public void addResistor(String name, String node1, String node2, String value){ From 308c979f3ed9044cd11d210a03231681585ab681 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Fri, 11 Dec 2015 16:29:06 -0500 Subject: [PATCH 03/13] Ground Strips Grounded Selections were made for ground strips and they were grounded. --- src/TPC.java | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index 7fd3a95..7c0adb2 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -113,10 +113,10 @@ public void addCircle(String name, double radius, double center){ public void makeSelections(){ this.makeAnodeSelection(); this.makeCathodeSelection(); - //this.makeGroundStripSelection("groundstripone",beampiperadius); - //this.makeGroundStripSelection("groundstriptwo",beampiperadius+FSEThickness+wallwidth); - //this.makeGroundStripSelection("groundstripthree",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth); - //this.makeGroundStripSelection("groundstripfour",TPCRadius+3*FSEThickness+FSErSpacing+insulationwidth+wallwidth); + this.makeGroundStripSelection("groundstripone",beampiperadius); + this.makeGroundStripSelection("groundstriptwo",beampiperadius+groundstripwidth+wallwidth); + this.makeGroundStripSelection("groundstripthree",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth); + this.makeGroundStripSelection("groundstripfour",TPCRadius+2*FSEThickness+groundstripwidth+FSErSpacing+insulationwidth+wallwidth); //this.makeInsulatorSelection(); for(int i = 0; i < FSENumber; i++){ this.makeFSESelection(i); @@ -162,9 +162,9 @@ public void makeBoxSelection(String name, double rmin, double zmin, double rmax, this.model.selection(name).set("xmax",rmax); this.model.selection(name).set("ymax",zmax); } - //public void makeGroundStripSelection(String name, double radius){ - //this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+FSEThickness+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4); - //} + public void makeGroundStripSelection(String name, double radius){ + this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4); + } //public void makeCageSelection(){ //this.model.selection().create("cageVolumeSelection", "Explicit"); @@ -182,7 +182,7 @@ public void makeTerminals(){ makeInnerFSE(i); } this.makeCathodeTerminal(); - //this.makeGroundStripTerminal(); + this.makeGroundStripTerminal(); } public void makeAnodeTerminal(){ this.model.physics("current").feature().create("anodeTerminal", "Ground",1); @@ -209,18 +209,18 @@ public void makeFSETerminal(int actualNumber){ this.model.physics("current").feature(terminal).selection().named(selection); this.model.physics("current").feature(terminal).set("TerminalType",1,"Circuit"); } - //public void makeGroundStripTerminal(){ + public void makeGroundStripTerminal(){ //this.model.physics("current").feature().create("cageTerminal", "Ground", 1);//Here is the line where the connection between the faraday cage and anode terminal //this.model.physics("current").feature("cageTerminal").selection().named("cageEdgeSelecction"); - //this.model.physics("current").feature().create("GroundStripTerminalone", "Ground", 1); - //this.model.physics("current").feature("GroundStripTerminalone").selection().named("groundstripone"); - //this.model.physics("current").feature().create("GroundStripTerminaltwo", "Ground", 1); - //this.model.physics("current").feature("GroundStripTerminaltwo").selection().named("groundstriptwo"); - //this.model.physics("current").feature().create("GroundStripTerminalthree", "Ground", 1); - //this.model.physics("current").feature("GroundStripTerminalthree").selection().named("groundstripthree"); - //this.model.physics("current").feature().create("GroundStripTerminalfour", "Ground", 1); - //this.model.physics("current").feature("GroundStripTerminalfour").selection().named("groundstripfour"); - //} + this.model.physics("current").feature().create("GroundStripTerminalone", "Ground", 1); + this.model.physics("current").feature("GroundStripTerminalone").selection().named("groundstripone"); + this.model.physics("current").feature().create("GroundStripTerminaltwo", "Ground", 1); + this.model.physics("current").feature("GroundStripTerminaltwo").selection().named("groundstriptwo"); + this.model.physics("current").feature().create("GroundStripTerminalthree", "Ground", 1); + this.model.physics("current").feature("GroundStripTerminalthree").selection().named("groundstripthree"); + this.model.physics("current").feature().create("GroundStripTerminalfour", "Ground", 1); + this.model.physics("current").feature("GroundStripTerminalfour").selection().named("groundstripfour"); + } public void makeCircuit(){ this.model.physics().create("cir", "Circuit", "geom"); From 99e3af2c2e0db86139fe94b7277df64fe921172b Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Fri, 11 Dec 2015 16:54:38 -0500 Subject: [PATCH 04/13] Changed Number of FSE strips to 80, Opens in COMSOL 80 Strip geometry opens in COMSOL, we're now testing to see if Electric Field computes. --- src/TPC.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index 7c0adb2..cc1719a 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips. - public int FSENumber = 4; // Number of strips, 80, changed to 4 to load faster + public int FSENumber = 80; // Number of strips, 80, changed to 4 to load faster public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -175,7 +175,7 @@ public void makeGroundStripSelection(String name, double radius){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,6,8,24,26}); //,2,4,6,8,328,330}); // Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,6,8,328,330}); //,2,4,6,8,328,330}); // Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -280,7 +280,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,6,8,24,26}); //328,330}); // Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,6,8,328,330}); // Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From 882b8aa7c74e807ed648ae4ec3bd2eb72e6a30d2 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Sat, 12 Dec 2015 16:38:09 -0500 Subject: [PATCH 05/13] Made Domains of Physics and Materials Functions of FSENumber --- src/TPC.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index cc1719a..56f6c74 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips. - public int FSENumber = 80; // Number of strips, 80, changed to 4 to load faster + public int FSENumber = 20; // Number of strips, 80, changed to 4 to load faster public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -175,7 +175,7 @@ public void makeGroundStripSelection(String name, double radius){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,6,8,328,330}); //,2,4,6,8,328,330}); // Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //328,330}); //,2,4,6,8,328,330}); // Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -280,7 +280,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,6,8,328,330}); // Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //328,330}); // Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From e73e40b8cce472453c7af1c7164fda23a2cf4209 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Mon, 22 Feb 2016 15:01:09 -0500 Subject: [PATCH 06/13] Attempting to Create Upper Gound Strip Currently tring to create an upper ground strip to stop escaping field and potential. --- .classpath | 4 ++-- src/TPC.java | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.classpath b/.classpath index 593e184..1d486f2 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - + @@ -77,7 +77,7 @@ - + diff --git a/src/TPC.java b/src/TPC.java index 56f6c74..06be5a6 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -1,21 +1,20 @@ import com.comsol.model.*; import com.comsol.model.util.*; -public class TPC { - // private static final String GroundStrip = null; +public class TPC { public Model model; - public double TPCRadius = 800; // mm? Need to verify! - public double electrodeThickness = 1; + public double TPCRadius = 800; // in mm + public double electrodeThickness = 1; public double TPCLength(){ return (FSELength + FSEzSpacing) * (FSENumber)+2*(FSEzSpacing+FSELength/2)-FSEzSpacing; } public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } - // FSE is strips. - public int FSENumber = 20; // Number of strips, 80, changed to 4 to load faster + // FSE is strips (Field Shaping Elements). + public int FSENumber = 4; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -31,6 +30,7 @@ public double FSEOuterRadius(){ public double cageEndSpacing = 300; // second cage parameter public double cageSideSpacing = 150; // third cage parameter public double innerTPCradius = beampiperadius+wallwidth+insulationwidth+2*groundstripwidth; // radius before inner conductive strips + public double UpperGroundStripThickness = TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth+groundstripwidth-(beampiperadius+groundstripwidth+wallwidth); public double Resistance = 1000000; public double Conductivity = .000004; @@ -67,6 +67,7 @@ public void makeGeometry(){ this.addRect("anodeRect",innerTPCradius,-electrodeThickness,TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); this.addRect("cathodeRect",innerTPCradius,TPCLength(),TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); + this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth, -electrodeThickness+TPCLength()+2*electrodeThickness, UpperGroundStripThickness, groundstripwidth); this.addRect("BeamPipe",0 ,-electrodeThickness,beampiperadius , TPCLength()+2*electrodeThickness); this.addRect("GroundStrip1",beampiperadius ,-electrodeThickness,groundstripwidth , TPCLength()+2*electrodeThickness); @@ -113,6 +114,7 @@ public void addCircle(String name, double radius, double center){ public void makeSelections(){ this.makeAnodeSelection(); this.makeCathodeSelection(); + this.makeUpperGroundStripSelection("uppergroundstrip"); this.makeGroundStripSelection("groundstripone",beampiperadius); this.makeGroundStripSelection("groundstriptwo",beampiperadius+groundstripwidth+wallwidth); this.makeGroundStripSelection("groundstripthree",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth); @@ -165,6 +167,10 @@ public void makeBoxSelection(String name, double rmin, double zmin, double rmax, public void makeGroundStripSelection(String name, double radius){ this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4); } + public void makeUpperGroundStripSelection(String uppername){ + this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4); + } + //public void makeCageSelection(){ //this.model.selection().create("cageVolumeSelection", "Explicit"); @@ -175,7 +181,7 @@ public void makeGroundStripSelection(String name, double radius){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //328,330}); //,2,4,6,8,328,330}); // Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,7,9,25,27}); //last two used to be 2*FSENumber+10,2*FSENumber+12 //,2,4,6,8,328,330}); // Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -202,6 +208,7 @@ public void makeInnerFSE(int actualNumber){ this.model.physics("current").feature(terminal).selection().named(selection); this.model.physics("current").feature(terminal).set("TerminalType",1,"Circuit"); } + @SuppressWarnings("deprecation") public void makeFSETerminal(int actualNumber){ String terminal = "FSE"+actualNumber+"Terminal"; String selection = "FSE"+actualNumber+"Selection"; @@ -220,6 +227,8 @@ public void makeGroundStripTerminal(){ this.model.physics("current").feature("GroundStripTerminalthree").selection().named("groundstripthree"); this.model.physics("current").feature().create("GroundStripTerminalfour", "Ground", 1); this.model.physics("current").feature("GroundStripTerminalfour").selection().named("groundstripfour"); + this.model.physics("current").feature().create("GroundStripUpper","Ground",1); + this.model.physics("current").feature("GroundStripUpper").selection().named("uppergroundstrip"); } public void makeCircuit(){ @@ -280,7 +289,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //328,330}); // Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,7,9,25,27}); //328,330}); // Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From 045dafacfd9efa1a44de49d90ac0e2e47cc1a399 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Wed, 24 Feb 2016 14:24:36 -0500 Subject: [PATCH 07/13] Upper Grounding Strip Initial Attempt Initial attempt to create upper grounding strip. In COMSOL there is a meshing error. Also the physics and material domains need to be changed. --- src/TPC.java | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index 06be5a6..ab3d084 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -1,6 +1,11 @@ import com.comsol.model.*; import com.comsol.model.util.*; +// Attempted to create Upper Grounding Strip. +// Current code is NOT on github, could not commit for some reason. +// This needs to be committed to github. +// There's a currently a meshing problem. + public class TPC { public Model model; @@ -67,7 +72,7 @@ public void makeGeometry(){ this.addRect("anodeRect",innerTPCradius,-electrodeThickness,TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); this.addRect("cathodeRect",innerTPCradius,TPCLength(),TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); - this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth, -electrodeThickness+TPCLength()+2*electrodeThickness, UpperGroundStripThickness, groundstripwidth); + //this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth-1, -electrodeThickness+TPCLength()+2*electrodeThickness+3*FSErSpacing/4, UpperGroundStripThickness+2, groundstripwidth); this.addRect("BeamPipe",0 ,-electrodeThickness,beampiperadius , TPCLength()+2*electrodeThickness); this.addRect("GroundStrip1",beampiperadius ,-electrodeThickness,groundstripwidth , TPCLength()+2*electrodeThickness); @@ -114,7 +119,7 @@ public void addCircle(String name, double radius, double center){ public void makeSelections(){ this.makeAnodeSelection(); this.makeCathodeSelection(); - this.makeUpperGroundStripSelection("uppergroundstrip"); + //this.makeUpperGroundStripSelection("uppergroundstrip"); this.makeGroundStripSelection("groundstripone",beampiperadius); this.makeGroundStripSelection("groundstriptwo",beampiperadius+groundstripwidth+wallwidth); this.makeGroundStripSelection("groundstripthree",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth); @@ -167,9 +172,9 @@ public void makeBoxSelection(String name, double rmin, double zmin, double rmax, public void makeGroundStripSelection(String name, double radius){ this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4); } - public void makeUpperGroundStripSelection(String uppername){ - this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4); - } + //public void makeUpperGroundStripSelection(String uppername){ + // this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4-1, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+3*FSErSpacing/4, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4+1, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+3*FSErSpacing/4); + //} //public void makeCageSelection(){ @@ -181,7 +186,7 @@ public void makeUpperGroundStripSelection(String uppername){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,7,9,25,27}); //last two used to be 2*FSENumber+10,2*FSENumber+12 //,2,4,6,8,328,330}); // Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //last two used to be 2*FSENumber+10,2*FSENumber+12 //,2,4,6,8,328,330}); // Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -227,8 +232,8 @@ public void makeGroundStripTerminal(){ this.model.physics("current").feature("GroundStripTerminalthree").selection().named("groundstripthree"); this.model.physics("current").feature().create("GroundStripTerminalfour", "Ground", 1); this.model.physics("current").feature("GroundStripTerminalfour").selection().named("groundstripfour"); - this.model.physics("current").feature().create("GroundStripUpper","Ground",1); - this.model.physics("current").feature("GroundStripUpper").selection().named("uppergroundstrip"); + //this.model.physics("current").feature().create("GroundStripUpper","Ground",1); + //this.model.physics("current").feature("GroundStripUpper").selection().named("uppergroundstrip"); } public void makeCircuit(){ @@ -289,7 +294,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,7,9,25,27}); //328,330}); // Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //328,330}); // Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From c90f2dc8f07600807f479201a9c5cdf7fa1740e7 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Wed, 24 Feb 2016 15:16:18 -0500 Subject: [PATCH 08/13] Increased Height of Ground Strips 2 and 3, Added Upper Grounding Strip In this commit, the geometry, selections and terminal has been created for the upper grounding strip, and the heights of grounding strips 2 and 3 were increased to touch the upper gounding strip. --- src/TPC.java | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index ab3d084..990d4d3 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -1,12 +1,8 @@ import com.comsol.model.*; import com.comsol.model.util.*; -// Attempted to create Upper Grounding Strip. -// Current code is NOT on github, could not commit for some reason. -// This needs to be committed to github. -// There's a currently a meshing problem. -public class TPC { + public class TPC { public Model model; @@ -72,15 +68,15 @@ public void makeGeometry(){ this.addRect("anodeRect",innerTPCradius,-electrodeThickness,TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); this.addRect("cathodeRect",innerTPCradius,TPCLength(),TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); - //this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth-1, -electrodeThickness+TPCLength()+2*electrodeThickness+3*FSErSpacing/4, UpperGroundStripThickness+2, groundstripwidth); + this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth, UpperGroundStripThickness, groundstripwidth); this.addRect("BeamPipe",0 ,-electrodeThickness,beampiperadius , TPCLength()+2*electrodeThickness); this.addRect("GroundStrip1",beampiperadius ,-electrodeThickness,groundstripwidth , TPCLength()+2*electrodeThickness); this.addRect("InnerWall",beampiperadius+groundstripwidth ,-electrodeThickness,wallwidth ,TPCLength()+2*electrodeThickness ); - this.addRect("GroundStrip2",beampiperadius+groundstripwidth+wallwidth ,-electrodeThickness,groundstripwidth ,TPCLength()+2*electrodeThickness ); + this.addRect("GroundStrip2",beampiperadius+groundstripwidth+wallwidth ,-electrodeThickness,groundstripwidth ,TPCLength()+2*electrodeThickness+insulationwidth); this.addRect("InnerInsulator",beampiperadius+2*groundstripwidth+wallwidth ,-electrodeThickness,insulationwidth ,TPCLength()+2*electrodeThickness ); this.addRect("OuterInsulator",TPCRadius+2*FSEThickness+FSErSpacing ,-electrodeThickness, insulationwidth, TPCLength()+2*electrodeThickness); - this.addRect("GroundStrip3",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth ,-electrodeThickness ,groundstripwidth ,TPCLength()+2*electrodeThickness ); + this.addRect("GroundStrip3",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth ,-electrodeThickness ,groundstripwidth ,TPCLength()+2*electrodeThickness+insulationwidth); this.addRect("OuterWall",TPCRadius+2*FSEThickness+groundstripwidth+FSErSpacing+insulationwidth,-electrodeThickness,wallwidth, TPCLength()+2*electrodeThickness); this.addRect("GroundStrip4",TPCRadius+2*FSEThickness+groundstripwidth+FSErSpacing+insulationwidth+wallwidth ,-electrodeThickness ,groundstripwidth , TPCLength()+2*electrodeThickness); this.addFSEs(); @@ -119,7 +115,7 @@ public void addCircle(String name, double radius, double center){ public void makeSelections(){ this.makeAnodeSelection(); this.makeCathodeSelection(); - //this.makeUpperGroundStripSelection("uppergroundstrip"); + this.makeUpperGroundStripSelection("uppergroundstrip"); this.makeGroundStripSelection("groundstripone",beampiperadius); this.makeGroundStripSelection("groundstriptwo",beampiperadius+groundstripwidth+wallwidth); this.makeGroundStripSelection("groundstripthree",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth); @@ -170,11 +166,11 @@ public void makeBoxSelection(String name, double rmin, double zmin, double rmax, this.model.selection(name).set("ymax",zmax); } public void makeGroundStripSelection(String name, double radius){ - this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4); + this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4+insulationwidth); + } + public void makeUpperGroundStripSelection(String uppername){ + this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+insulationwidth, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+insulationwidth); } - //public void makeUpperGroundStripSelection(String uppername){ - // this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4-1, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+3*FSErSpacing/4, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4+1, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+3*FSErSpacing/4); - //} //public void makeCageSelection(){ @@ -232,8 +228,8 @@ public void makeGroundStripTerminal(){ this.model.physics("current").feature("GroundStripTerminalthree").selection().named("groundstripthree"); this.model.physics("current").feature().create("GroundStripTerminalfour", "Ground", 1); this.model.physics("current").feature("GroundStripTerminalfour").selection().named("groundstripfour"); - //this.model.physics("current").feature().create("GroundStripUpper","Ground",1); - //this.model.physics("current").feature("GroundStripUpper").selection().named("uppergroundstrip"); + this.model.physics("current").feature().create("GroundStripUpper","Ground",1); + this.model.physics("current").feature("GroundStripUpper").selection().named("uppergroundstrip"); } public void makeCircuit(){ From 56f477fcbf925b36abd2f0c788c5701acd32037b Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Wed, 24 Feb 2016 15:36:26 -0500 Subject: [PATCH 09/13] Upper Grounding Strip Seems Successfully Created Class file created by this code successfully creates upper grounding strip to removed external field. --- src/TPC.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index 990d4d3..b9230f9 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips (Field Shaping Elements). - public int FSENumber = 4; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) + public int FSENumber = 10; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -182,7 +182,7 @@ public void makeUpperGroundStripSelection(String uppername){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //last two used to be 2*FSENumber+10,2*FSENumber+12 //,2,4,6,8,328,330}); // Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,7,8,10,2*FSENumber+12,2*FSENumber+14}); //used to be {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}; Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -290,7 +290,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}); //328,330}); // Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,7,8,10,2*FSENumber+12,2*FSENumber+14}); //old: {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12} Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From 99aceabaabc3ab840403bd0d01dade6a81a311bf Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Sat, 27 Feb 2016 15:02:49 -0500 Subject: [PATCH 10/13] Changed Upper Grounding Strip Width Changed upper ground strip parameters: rmin=rmin+insulationwidth rmax=rmax-insulationwidth --- .classpath | 4 ++-- src/TPC.java | 31 ++++++++++++++++--------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.classpath b/.classpath index 1d486f2..593e184 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,7 @@ - + @@ -77,7 +77,7 @@ - + diff --git a/src/TPC.java b/src/TPC.java index b9230f9..e2b4a09 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips (Field Shaping Elements). - public int FSENumber = 10; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) + public int FSENumber = 80; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -31,7 +31,7 @@ public double FSEOuterRadius(){ public double cageEndSpacing = 300; // second cage parameter public double cageSideSpacing = 150; // third cage parameter public double innerTPCradius = beampiperadius+wallwidth+insulationwidth+2*groundstripwidth; // radius before inner conductive strips - public double UpperGroundStripThickness = TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth+groundstripwidth-(beampiperadius+groundstripwidth+wallwidth); + public double UpperGroundStripThickness = TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth+groundstripwidth-(beampiperadius+groundstripwidth+wallwidth)-2*insulationwidth; public double Resistance = 1000000; public double Conductivity = .000004; @@ -53,7 +53,7 @@ public TPC(){ this.makeTerminals(); this.makeCircuit(); this.setMaterials(); - this.makeDataSet(); + //this.makeDataSet(); this.makeSolver(); this.model.mesh().create("mesh1", "geom"); @@ -68,7 +68,7 @@ public void makeGeometry(){ this.addRect("anodeRect",innerTPCradius,-electrodeThickness,TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); this.addRect("cathodeRect",innerTPCradius,TPCLength(),TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); - this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth, UpperGroundStripThickness, groundstripwidth); + this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth+insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth, UpperGroundStripThickness, groundstripwidth); this.addRect("BeamPipe",0 ,-electrodeThickness,beampiperadius , TPCLength()+2*electrodeThickness); this.addRect("GroundStrip1",beampiperadius ,-electrodeThickness,groundstripwidth , TPCLength()+2*electrodeThickness); @@ -169,7 +169,7 @@ public void makeGroundStripSelection(String name, double radius){ this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4+insulationwidth); } public void makeUpperGroundStripSelection(String uppername){ - this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+insulationwidth, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+insulationwidth); + this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4+insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+insulationwidth, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4-insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+insulationwidth); } @@ -405,16 +405,16 @@ public void makeAir(int[] regions){ this.model.material("mat2").selection().set(regions); } - public void export(String file){ - this.makeDataSet(); + //public void export(String file){ + // this.makeDataSet(); - } - public void makeDataSet(){ - this.model.result().dataset().create("cpt1", "CutPoint2D"); - this.model.result().dataset("cpt1").set("method", "grid"); - this.model.result().dataset("cpt1").set("gridx", "range(0,1,359)"); - this.model.result().dataset("cpt1").set("gridy", "range(0,1,"+this.TPCLength()+")"); - } + //} + //public void makeDataSet(){ + // this.model.result().dataset().create("cpt1", "CutPoint2D"); + // this.model.result().dataset("cpt1").set("method", "grid"); + // this.model.result().dataset("cpt1").set("gridx", "range(0,1,359)"); + // this.model.result().dataset("cpt1").set("gridy", "range(0,1,"+this.TPCLength()+")"); + //} public void makeSolver(){ this.model.study().create("study"); @@ -422,4 +422,5 @@ public void makeSolver(){ this.model.study("study").feature("solver").activate("current", true); this.model.study("study").feature("solver").activate("cir", true); } -} \ No newline at end of file + } +//} \ No newline at end of file From 0e42caf60e7ea3413b9eead31812562c64c7c834 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Wed, 2 Mar 2016 16:58:12 -0500 Subject: [PATCH 11/13] Upper Grounding Strip Length Shortened, Domains for 60 Strip This successfully creates shortened upper grounding strip, however domains for materials and physics work ONLY for 60 strips. If FSENumber is changed, domains of materials and physics must be adjusted. Need universal domains that accountfor FSENumber. --- src/TPC.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index e2b4a09..93677ef 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips (Field Shaping Elements). - public int FSENumber = 80; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) + public int FSENumber = 60; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -182,7 +182,7 @@ public void makeUpperGroundStripSelection(String uppername){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,7,8,10,2*FSENumber+12,2*FSENumber+14}); //used to be {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}; Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,6,9,249,251}); //used to be {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}; Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -290,7 +290,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,7,8,10,2*FSENumber+12,2*FSENumber+14}); //old: {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12} Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,6,9,249,251}); //old: {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12} Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") From ec9ab12d5848c41b2dbf5f17f1bdbd8711cb2856 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Thu, 3 Mar 2016 16:26:05 -0500 Subject: [PATCH 12/13] Created New .java File for Creating Upper Ground Strips With Gaps UpperStrips.java will be used to create an array of upper grounding strips with gaps so we can observe the potential leaks with different ground strip setups. --- src/TPC.java | 6 +++--- src/TPCSingle.java | 17 +++++++++-------- src/UpperStrips.java | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 src/UpperStrips.java diff --git a/src/TPC.java b/src/TPC.java index 93677ef..0f430dc 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -15,7 +15,7 @@ public double FSEOuterRadius(){ return TPCRadius + 2*FSEThickness + FSErSpacing; } // FSE is strips (Field Shaping Elements). - public int FSENumber = 60; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) + public int FSENumber = 4; // Number of strips on both inner and outer, total strip number=2*(FSENumber+FSENumber-1) public double FSELength = 9.0; // Strip length, 9.0 (mm) public double FSEzSpacing = 1.0; // Strip spacing in z, 1 (mm) public double FSEThickness = .035; // Strip thickness, @@ -182,7 +182,7 @@ public void makeUpperGroundStripSelection(String uppername){ public void makeTerminals(){ this.model.physics().create("current", "ConductiveMedia", "geom"); - this.model.physics("current").selection().set(new int[] {1,2,4,6,9,249,251}); //used to be {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}; Domain Selection of electric current physics + this.model.physics("current").selection().set(new int[] {1,2,4,6,9,15,17}); //used to be {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12}; Domain Selection of electric current physics this.makeAnodeTerminal(); for(int i =0; i < FSENumber; i++){ makeFSETerminal(i); @@ -290,7 +290,7 @@ public void connectVoltageSource(){ public void setMaterials(){ this.makeCopper(); // Makes all domains copper. - this.makeAir(new int[] {1,2,4,6,9,249,251}); //old: {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12} Changes chosen domains from copper to air. + this.makeAir(new int[] {1,2,4,6,9,15,17}); //4 strips: {1,2,4,6,9,15,17}. 60 strips: {1,2,4,6,9,249,251} old: {1,2,4,6,8,2*FSENumber+10,2*FSENumber+12} Changes chosen domains from copper to air. } @SuppressWarnings("deprecation") diff --git a/src/TPCSingle.java b/src/TPCSingle.java index 8582918..49cc5d0 100755 --- a/src/TPCSingle.java +++ b/src/TPCSingle.java @@ -1,8 +1,8 @@ import com.comsol.model.Model; public class TPCSingle extends TPC { - public double FSEOuterRadius(){ - return TPCRadius + FSEThickness; + public double TPCLength(){ + return (FSELength + FSEzSpacing) * (FSENumber + 1)/2; } @@ -14,15 +14,16 @@ public static Model run(){ return new TPCSingle().model; } - public void addFSEs(){ - double z1 = FSEzSpacing+FSELength/2; - double r1 = TPCRadius; + public void addFSEs(){ //Add ground strips + //Create first upper grounding strip + double z1 = FSEzSpacing+FSELength/2; // z1=-electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth + double r1 = TPCRadius; // r1=beampiperadius+groundstripwidth+wallwidth+insulationwidth - this.addRect("FSE1Rect",r1,z1,FSEThickness,FSELength); - this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); + this.addRect("FSE1Rect",r1,z1,FSEThickness,FSELength); //Ground Strip Rectangle + this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); //Array of Ground strip rectangles } - public void makeFSESelection(int actualNumber){ + public void makeFSESelection(int actualNumber){ //make ground strips grounded. String name = "FSE"+actualNumber+"Selection"; double rmin = TPCRadius - FSErSpacing/4; diff --git a/src/UpperStrips.java b/src/UpperStrips.java new file mode 100644 index 0000000..6c4014f --- /dev/null +++ b/src/UpperStrips.java @@ -0,0 +1,20 @@ +import com.comsol.model.Model; + +public class UpperStrips extends TPC { + + + public static Model run(){ + return new TPCSingle().model; + } + + public void addGroundStrips(){ + double z1 = -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth; //z position of first strip + double r1 = beampiperadius+groundstripwidth+wallwidth+insulationwidth; //r position of first strip + + this.addRect("TopGroundStrip",r1,z1,FSEThickness,FSELength); //Create First Ground Strip + this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); //Array of Ground strip rectangles + } + + + +} From 4737bfbda096f60020f1d1680f9387576b2652c1 Mon Sep 17 00:00:00 2001 From: Abraham Tishelman-Charny Date: Thu, 3 Mar 2016 16:44:31 -0500 Subject: [PATCH 13/13] Saving This as a Checkpoint, Next Step Move UpperStrips.java to TPC.java Saving progress on UpperStrips.java to work on shortened upper ground strip. Next step on this front is to move upperstrips.java code to tpc.java so we can open TPCMirror.class with upper ground strip array created in TPC.java. --- src/TPC.java | 36 ++++++++++++++++++------------------ src/TPCMirror.java | 2 +- src/TPCSingle.java | 2 +- src/UpperStrips.java | 6 +++--- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/TPC.java b/src/TPC.java index 0f430dc..bffc149 100755 --- a/src/TPC.java +++ b/src/TPC.java @@ -68,7 +68,7 @@ public void makeGeometry(){ this.addRect("anodeRect",innerTPCradius,-electrodeThickness,TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); this.addRect("cathodeRect",innerTPCradius,TPCLength(),TPCRadius-innerTPCradius+2*FSEThickness+FSErSpacing,electrodeThickness); - this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth+insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth, UpperGroundStripThickness, groundstripwidth); + //this.addRect("UpperGroundStrip", beampiperadius+groundstripwidth+wallwidth+insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth, UpperGroundStripThickness, groundstripwidth); this.addRect("BeamPipe",0 ,-electrodeThickness,beampiperadius , TPCLength()+2*electrodeThickness); this.addRect("GroundStrip1",beampiperadius ,-electrodeThickness,groundstripwidth , TPCLength()+2*electrodeThickness); @@ -79,7 +79,7 @@ public void makeGeometry(){ this.addRect("GroundStrip3",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth ,-electrodeThickness ,groundstripwidth ,TPCLength()+2*electrodeThickness+insulationwidth); this.addRect("OuterWall",TPCRadius+2*FSEThickness+groundstripwidth+FSErSpacing+insulationwidth,-electrodeThickness,wallwidth, TPCLength()+2*electrodeThickness); this.addRect("GroundStrip4",TPCRadius+2*FSEThickness+groundstripwidth+FSErSpacing+insulationwidth+wallwidth ,-electrodeThickness ,groundstripwidth , TPCLength()+2*electrodeThickness); - this.addFSEs(); + this.addGroundStrips(); //double cagez =-electrodeThickness-cageEndSpacing; //double cagew = FSEOuterRadius()+cageSideSpacing; @@ -97,15 +97,15 @@ public void addRect(String name, double r, double z, double t, double h){ this.model.geom("geom").feature(name).set("pos",pos); this.model.geom("geom").feature(name).set("size",size); } - public void addFSEs(){}// THIS METHOD DOSES NOT FUNCITON AND MUST BE OVERRIDDEN - public void makeFSEArray(double offset,String[] inputs,int size){ - this.model.geom("geom").feature().create("FSEArray","Array"); - this.model.geom("geom").feature("FSEArray").selection("input").set(inputs); - this.model.geom("geom").feature("FSEArray").setIndex("displ","0",0); - this.model.geom("geom").feature("FSEArray").setIndex("displ",offset,1); - this.model.geom("geom").feature("FSEArray").setIndex("fullsize","1",0); - this.model.geom("geom").feature("FSEArray").setIndex("fullsize",size+"",1); - } + public void addGroundStrips(){}// THIS METHOD DOSES NOT FUNCITON AND MUST BE OVERRIDDEN + //public void makeFSEArray(double offset,String[] inputs,int size){ + //this.model.geom("geom").feature().create("FSEArray","Array"); + //this.model.geom("geom").feature("FSEArray").selection("input").set(inputs); + //this.model.geom("geom").feature("FSEArray").setIndex("displ","0",0); + //this.model.geom("geom").feature("FSEArray").setIndex("displ",offset,1); + //this.model.geom("geom").feature("FSEArray").setIndex("fullsize","1",0); + //this.model.geom("geom").feature("FSEArray").setIndex("fullsize",size+"",1); + //} public void addCircle(String name, double radius, double center){ this.model.geom("geom").feature().create(name,"Circle"); this.model.geom("geom").feature(name).set("r",radius); @@ -115,17 +115,17 @@ public void addCircle(String name, double radius, double center){ public void makeSelections(){ this.makeAnodeSelection(); this.makeCathodeSelection(); - this.makeUpperGroundStripSelection("uppergroundstrip"); + //this.makeUpperGroundStripSelection("uppergroundstrip"); this.makeGroundStripSelection("groundstripone",beampiperadius); this.makeGroundStripSelection("groundstriptwo",beampiperadius+groundstripwidth+wallwidth); this.makeGroundStripSelection("groundstripthree",TPCRadius+2*FSEThickness+FSErSpacing+insulationwidth); this.makeGroundStripSelection("groundstripfour",TPCRadius+2*FSEThickness+groundstripwidth+FSErSpacing+insulationwidth+wallwidth); //this.makeInsulatorSelection(); - for(int i = 0; i < FSENumber; i++){ - this.makeFSESelection(i); + //for(int i = 0; i < FSENumber; i++){ + // this.makeFSESelection(i); } //this.makeCageSelection(); - } + //} //public void makeGroundStripOne() { //commented out unnecessary insulator selection since we are not connecting terminals to it // this.model.selection().create("insulatorSelection","Box"); // this.model.selection("insulatorSelection").set("condition", "inside"); @@ -168,9 +168,9 @@ public void makeBoxSelection(String name, double rmin, double zmin, double rmax, public void makeGroundStripSelection(String name, double radius){ this.makeBoxSelection(name,radius-FSErSpacing/4,-electrodeThickness-FSEzSpacing/4, radius+groundstripwidth+FSErSpacing/4,TPCRadius+2*electrodeThickness+FSEzSpacing/4+insulationwidth); } - public void makeUpperGroundStripSelection(String uppername){ - this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4+insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+insulationwidth, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4-insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+insulationwidth); - } + //public void makeUpperGroundStripSelection(String uppername){ + // this.makeBoxSelection(uppername, beampiperadius+groundstripwidth+wallwidth-FSErSpacing/4+insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness-FSErSpacing/4+insulationwidth, beampiperadius+groundstripwidth+wallwidth+UpperGroundStripThickness+FSErSpacing/4-insulationwidth, -electrodeThickness+TPCLength()+2*electrodeThickness+groundstripwidth+FSErSpacing/4+insulationwidth); + //} //public void makeCageSelection(){ diff --git a/src/TPCMirror.java b/src/TPCMirror.java index 698640a..56227bd 100755 --- a/src/TPCMirror.java +++ b/src/TPCMirror.java @@ -31,7 +31,7 @@ public void addFSEs(){ this.addRect("FSE3Rect",r3,z3,FSEThickness,FSELength); this.addRect("FSE2Rect",r2,z2,FSEThickness,FSELength); this.addRect("FSE4Rect",r4,z4,FSEThickness,FSELength); - this.makeFSEArray(2*offsetz(),new String[]{"FSE1Rect","FSE2Rect","FSE3Rect","FSE4Rect"},(FSENumber-1)/2); + //this.makeFSEArray(2*offsetz(),new String[]{"FSE1Rect","FSE2Rect","FSE3Rect","FSE4Rect"},(FSENumber-1)/2); this.addRect("FSE"+FSENumber+"Rect", r1,z1+offsetz()*(FSENumber-1),FSEThickness,FSELength); this.addRect("InnerFSE"+FSENumber+"Rect", r4,z4+offsetz()*(FSENumber-1),FSEThickness,FSELength); // changed r1 z1 to r4 z4 in attempt to create upper strip } diff --git a/src/TPCSingle.java b/src/TPCSingle.java index 49cc5d0..e3c2ec4 100755 --- a/src/TPCSingle.java +++ b/src/TPCSingle.java @@ -20,7 +20,7 @@ public void addFSEs(){ //Add ground strips double r1 = TPCRadius; // r1=beampiperadius+groundstripwidth+wallwidth+insulationwidth this.addRect("FSE1Rect",r1,z1,FSEThickness,FSELength); //Ground Strip Rectangle - this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); //Array of Ground strip rectangles + // this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); //Array of Ground strip rectangles } public void makeFSESelection(int actualNumber){ //make ground strips grounded. diff --git a/src/UpperStrips.java b/src/UpperStrips.java index 6c4014f..cdcb2d3 100644 --- a/src/UpperStrips.java +++ b/src/UpperStrips.java @@ -2,7 +2,6 @@ public class UpperStrips extends TPC { - public static Model run(){ return new TPCSingle().model; } @@ -11,10 +10,11 @@ public void addGroundStrips(){ double z1 = -electrodeThickness+TPCLength()+2*electrodeThickness+insulationwidth; //z position of first strip double r1 = beampiperadius+groundstripwidth+wallwidth+insulationwidth; //r position of first strip - this.addRect("TopGroundStrip",r1,z1,FSEThickness,FSELength); //Create First Ground Strip - this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); //Array of Ground strip rectangles + this.addRect("TopGroundStrip",r1,z1,FSELength,groundstripwidth); //Create First Ground Strip + // this.makeFSEArray(offsetz(),new String[]{"FSE1Rect"},FSENumber); //Array of Ground strip rectangles } + //Need to add method here to ground all strips }