Skip to content
Snippets Groups Projects
Commit 5f52022f authored by François Henrotte's avatar François Henrotte
Browse files

reorganization

parent ed717507
No related branches found
No related tags found
No related merge requests found
...@@ -6,19 +6,19 @@ Mesh.VolumeEdges = 0; // hide volume edges ...@@ -6,19 +6,19 @@ Mesh.VolumeEdges = 0; // hide volume edges
Geometry.ExactExtrusion = 0; // to allow rotation of extruded shapes Geometry.ExactExtrusion = 0; // to allow rotation of extruded shapes
Solver.AutoMesh = 2; // always remesh if necessary (don't reuse mesh on disk) Solver.AutoMesh = 2; // always remesh if necessary (don't reuse mesh on disk)
lc1 = (Flag_Thin) ? MeshSizeThinWire*mm : MeshSizeThinWire*mm ; lc1 = (Flag_Thin) ? MeshSizeThinWire*mm : MeshSizeWire*mm ;
lc2 = box/10; // mesh size at outer surface lc2 = box/10; // mesh size at outer surface
llWires[] = {}; llWires[] = {};
centerWires[] = {}; centerWires[] = {};
surfWires[] = {}; surfWires[] = {};
If( !Flag_Thin || (Flag_Thin && Flag_Corr==2)) If( !Flag_Thin || (Flag_Thin && Flag_RegSleeve))
// then circles are in the geometry // then circles are in the geometry
// their radius is R=rw if Flag_Thin != 0 // their radius is R=rw if Flag_Thin != 0
// or R=rs in the "regular sleeve case" (Flag_Corr == 2) // or R=rs in the "regular sleeve case" (Flag_Corr == 2)
R = ( !Flag_Thin ) ? rw : rs; R = ( Flag_Thin ) ? rs : rw;
For i In {1:NumWires} For i In {1:NumWires}
pC = newp; Point(pC) = {WX~{i} , WY~{i} , 0, lc1}; pC = newp; Point(pC) = {WX~{i} , WY~{i} , 0, lc1};
...@@ -96,7 +96,7 @@ If( !Flag_Thin ) // Wires with finite radius ...@@ -96,7 +96,7 @@ If( !Flag_Thin ) // Wires with finite radius
e[] = Extrude {0,0,Lz} { Surface{ s1 } ; /*Layers{1}; Recombine;*/ } ; e[] = Extrude {0,0,Lz} { Surface{ s1 } ; /*Layers{1}; Recombine;*/ } ;
Physical Volume ("AIR", 1) = { e[1] }; Physical Volume ("AIR", 1) = { e[1] };
ElseIf( Flag_Corr == 2 ) // regular sleeve ElseIf( Flag_RegSleeve ) // regular sleeve
Wires[]= {}; Wires[]= {};
For i In {1:NumWires} For i In {1:NumWires}
...@@ -122,19 +122,18 @@ Else ...@@ -122,19 +122,18 @@ Else
e[] = Extrude {0,0,Lz} { Surface{ s1 } ; /*Layers{1}; Recombine;*/ } ; e[] = Extrude {0,0,Lz} { Surface{ s1 } ; /*Layers{1}; Recombine;*/ } ;
s2 = e[0]; s2 = e[0];
v1 = e[1]; v1 = e[1];
Physical Volume ("AIR", 1) = { v1 };
For i In {1:NumWires} For i In {1:NumWires}
e[] = Extrude {0,0,Lz} { Point{ centerWires[i-1] } ; /*Layers{1};*/ } ; e[] = Extrude {0,0,Lz} { Point{ centerWires[i-1] } ; /*Layers{1};*/ } ;
//Printf("e=", e[]); //Printf("e=", e[]);
Physical Line (Sprintf("LWIRE_%g",i), 50+i) = { e[1] }; Physical Line (Sprintf("LWIRE_%g",i), 50+i) = { e[1] };
Physical Point (Sprintf("PANODE_%g",i), 60+i) = { centerWires[i-1] }; Physical Point (Sprintf("PANODE_%g",i), 60+i) = { centerWires[i-1] };
Physical Point (Sprintf("PCATHODE_%g",i), 70+i) = { e[0] }; Physical Point (Sprintf("PCATHODE_%g",i), 70+i) = { e[0] };
Physical Volume ("AIR", 1) = { v1 };
// embed line conductors in mesh // embed line conductors in mesh
Point { centerWires[i-1] } In Surface { s1 }; Point { centerWires[i-1] } In Surface { s1 };
Point { e[0] } In Surface { s2 }; Point { e[0] } In Surface { s2 };
Curve { e[1] } In Volume { v1 }; Curve { e[1] } In Volume { v1 };
EndFor EndFor
EndIf EndIf
Physical Surface("INF", 2) = { CombinedBoundary{ Volume{ : }; } }; Physical Surface("INF", 2) = { CombinedBoundary{ Volume{ : }; } };
......
This diff is collapsed.
...@@ -4,32 +4,43 @@ deg = 180/Pi; ...@@ -4,32 +4,43 @@ deg = 180/Pi;
/* /*
Expected inductance of a rectilinear 1mm radius wire: 4 nH/cm Expected inductance of a rectilinear 1mm radius wire: 4 nH/cm
git/documentation/models/Inductor/magstadyn_av_js0_3d.pro
*/ */
DefineConstant[ DefineConstant[
NumWires = {1, Name "Parameters/0Number of wires", NumWires = {1, Name "Parameters/00Number of wires",
Choices {1="1", 2="2", 3="3"}, Visible 1} Choices {1="1", 2="2", 3="3"}, Visible 1}
Flag_Form = {2, Name "Parameters/1Conductor type", Visible 1,
Choices {1="Massive", 2="Stranded"}} Flag_Thin = {1, Name "Parameters/01Thin wires",
Flag_Thin = {1, Name "Parameters/2Use thin wires", Choices {0,1}, Visible 1} Choices {0,1}, Visible 1}
Flag_Corr = {1, Name "Parameters/3Correction method", Flag_RegSleeve = {0, Name "Parameters/02Regular sleeves",
Visible (Flag_Form==2) && Flag_Thin, Choices {0,1}, Visible Flag_Thin}
Choices {0="None", 1="Raw sleeve", 2="regular sleeve"}}
Flag_U = {0, Name "Parameters/4Impose U", Choices {0,1}, Visible 1} Flag_SemiAnalytic = {1, Name "Parameters/03Semi-analytic approach",
Choices {0,1}, Visible Flag_Thin}
Flag_Stranded = {0, Name "Parameters/04Stranded conductors",
Choices {0,1}, Visible !Flag_SemiAnalytic || !Flag_Thin}
Flag_Dual = {0, Name "Parameters/05Dual approach",
Choices {0,1}, Visible Flag_SemiAnalytic && Flag_Thin}
Flag_U = {0, Name "Parameters/06Impose U", Choices {0,1}, Visible 1}
WireRadius = {1, Name "Parameters/10Wire radius [mm]"}
MeshSizeWire = {0.25, Name "Parameters/11Mesh size in wire [mm]",
Visible !Flag_Thin}
MeshSizeThinWire = {2, Name "Parameters/12Mesh size on thin wire [mm]",
Visible Flag_Thin}
//SleeveRadius = {2, Name "Parameters/13Sleeve radius [mm]", Visible Flag_RegSleeve}
box = {100*mm, Name "Parameters/5box half-width [m]"}
Flag_Maps = {1, Name "Input/2Display maps", Choices {0,1}, Visible 1} Flag_Maps = {1, Name "Input/2Display maps", Choices {0,1}, Visible 1}
LogFreq = {4, Min 1, Max 8, Step 0.25, Name "Input/4Log of frequency"} LogFreq = {4, Min 1, Max 8, Step 0.25, Name "Input/4Log of frequency"}
Freq = 10^LogFreq Freq = 10^LogFreq
WireRadius = {1, Name "Parameters/5Wire radius [mm]"}
MeshSizeWire = {1, Name "Parameters/6Mesh size in wire [mm]",
Visible !Flag_Thin}
MeshSizeThinWire = {1, Name "Parameters/7Mesh size on thin wire [mm]",
Visible Flag_Thin}
SleeveRadius = {2, Name "Parameters/8Sleeve radius [mm]"}
box = {100*mm, Name "Parameters/9box half-width [m]"}
rw = WireRadius*mm rw = WireRadius*mm
rs = SleeveRadius*mm rs = MeshSizeThinWire*mm
A_c = Pi*rw^2 // wire cross section A_c = Pi*rw^2 // wire cross section
rout = box rout = box
Lz = 10*mm Lz = 10*mm
...@@ -41,6 +52,10 @@ DefineConstant[ ...@@ -41,6 +52,10 @@ DefineConstant[
*/ */
]; ];
If( Flag_SemiAnalytic )
SetNumber("Parameters/01Thin wires", 1);
Flag_Thin=1;
EndIf
Xlocs() = { 0, 5*mm, -5*mm}; Xlocs() = { 0, 5*mm, -5*mm};
...@@ -50,7 +65,7 @@ For i In {1:NumWires} ...@@ -50,7 +65,7 @@ For i In {1:NumWires}
WX~{i} = { Xlocs(i-1), // place wires symmetrically around x=0 WX~{i} = { Xlocs(i-1), // place wires symmetrically around x=0
Name Sprintf("Parameters/Wire %g/0X position [m]", i), Closed } Name Sprintf("Parameters/Wire %g/0X position [m]", i), Closed }
WY~{i} = { Ylocs(i-1), Name Sprintf("Parameters/Wire %g/0Y position [m]", i) } WY~{i} = { Ylocs(i-1), Name Sprintf("Parameters/Wire %g/0Y position [m]", i) }
WI~{i} = { 1.23456, Name Sprintf("Parameters/Wire %g/2Current [A]", i) } WI~{i} = { 1, Name Sprintf("Parameters/Wire %g/2Current [A]", i) }
WP~{i} = { 0*NumWires*(i-1), WP~{i} = { 0*NumWires*(i-1),
Name Sprintf("Parameters/Wire %g/3Phase [deg]", i) } Name Sprintf("Parameters/Wire %g/3Phase [deg]", i) }
]; ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment