Skip to content
Snippets Groups Projects
Commit 2765e1d4 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better geo parameters + cleanup

parent 894840dd
No related branches found
No related tags found
No related merge requests found
Pipeline #5208 passed
......@@ -11,8 +11,10 @@ AngleMagnet = 0.8 * AnglePole;
// radial dimensions
lRotor = 44 * mm;
lMagnet = 10 * mm;
lGap = 20 * mm;
lMagnetIn = 10 * mm;
lMagnetOut = 5 * mm;
lGapRotor = 7 * mm;
lGapStator = 3 * mm;
lAirRing = 1 * mm;
lStator = 30 * mm;
lInf = 30 * mm;
......@@ -26,8 +28,8 @@ hTot = 130 * mm;
Cylinder(1) = {0,0,0, 0,0,hRotor, lRotor, AnglePole};
// magnet
Cylinder(2) = {0,0,0, 0,0,hMagnet, lRotor + lMagnet / 2, AngleMagnet};
Cylinder(3) = {0,0,0, 0,0,hMagnet, lRotor - lMagnet / 2, AngleMagnet};
Cylinder(2) = {0,0,0, 0,0,hMagnet, lRotor + lMagnetOut, AngleMagnet};
Cylinder(3) = {0,0,0, 0,0,hMagnet, lRotor - lMagnetIn, AngleMagnet};
BooleanDifference(4) = { Volume{2}; Delete; }{ Volume{3}; Delete; };
Rotate{ {0,0,1}, {0,0,0}, (AnglePole - AngleMagnet) / 2 }{ Volume{4}; }
Physical Volume("Magnet", 2) = 4;
......@@ -37,7 +39,7 @@ BooleanDifference(5) = { Volume{1}; Delete; }{ Volume{4}; };
Physical Volume("Rotor", 1) = 5;
// rotor air
Cylinder(6) = {0,0,0, 0,0,hTot, lRotor + lGap / 2, AnglePole};
Cylinder(6) = {0,0,0, 0,0,hTot, lRotor + lGapRotor, AnglePole};
BooleanDifference(7) = { Volume{6}; Delete; }{ Volume{4, 5}; };
Physical Volume("AirRotor", 4) = 7;
......@@ -46,20 +48,20 @@ VolumesRotor() = {4,5,7};
BooleanFragments{ Volume{VolumesRotor()}; Delete; }{}
// air ring
Cylinder(8) = {0,0,0, 0,0,hTot, lRotor + lGap / 2 , AnglePole};
Cylinder(9) = {0,0,0, 0,0,hTot, lRotor + lGap / 2 + lAirRing, AnglePole};
Cylinder(8) = {0,0,0, 0,0,hTot, lRotor + lGapRotor , AnglePole};
Cylinder(9) = {0,0,0, 0,0,hTot, lRotor + lGapRotor + lAirRing, AnglePole};
BooleanDifference(10) = { Volume{9}; Delete; }{ Volume{8}; Delete; };
Physical Volume("AirRing", 6) = 10;
// stator
Cylinder(11) = {0,0,0, 0,0,hRotor, lRotor + lGap, AnglePole};
Cylinder(12) = {0,0,0, 0,0,hRotor, lRotor + lGap + lStator, AnglePole};
Cylinder(11) = {0,0,0, 0,0,hRotor, lRotor + lGapRotor + lGapStator, AnglePole};
Cylinder(12) = {0,0,0, 0,0,hRotor, lRotor + lGapRotor + lGapStator + lStator, AnglePole};
BooleanDifference(13) = { Volume{12}; Delete; }{ Volume{11}; Delete; };
Physical Volume("Stator", 3) = 13;
// stator air
Cylinder(14) = {0,0,0, 0,0,hTot, lRotor + lGap / 2 + lAirRing, AnglePole};
Cylinder(15) = {0,0,0, 0,0,hTot, lRotor + lGap + lStator + lInf, AnglePole};
Cylinder(14) = {0,0,0, 0,0,hTot, lRotor + lGapRotor + lAirRing, AnglePole};
Cylinder(15) = {0,0,0, 0,0,hTot, lRotor + lGapRotor + lGapStator + lStator + lInf, AnglePole};
BooleanDifference(16) = { Volume{15}; Delete; }{ Volume{14}; Delete; };
BooleanDifference(17) = { Volume{16}; Delete; }{ Volume{13}; };
Physical Volume("AirStator", 5) = 17;
......@@ -278,4 +280,4 @@ treeLines() += CombinedBoundary { Physical Surface { 16 }; } ;
treeLines() += CombinedBoundary { Physical Surface { 17 }; } ;
treeLines() += CombinedBoundary { Physical Surface { 18 }; } ;
Physical Line("treeLines", 22) = { treeLines() };
Physical Line("TreeLines", 22) = { treeLines() };
......@@ -11,20 +11,19 @@ Include "rfpm_common.pro";
DefineConstant[
R_ = {"Static", Choices {"Static", "QuasiStatic"}, Visible 1,
Name "GetDP/1ResolutionChoices"},
C_ = {"-solve -v 4 -pos", Name "GetDP/9ComputeCommand", Visible 0}
C_ = {"-solve -v 4 -pos -v2", Visible 0,
Name "GetDP/9ComputeCommand"},
P_ = { "Check_Periodicity", Choices {"Fields", "Check_Periodicity"}, Visible 0,
Name "GetDP/2PostOperationChoices"}
];
Flag_QuasiStatic = !StrCmp[ R_, "QuasiStatic"];
RotorPosition = deg*
DefineNumber[20, Name "Options/Rotor position [deg]",
RotorPosition = deg * DefineNumber[0, Name "Options/Rotor position [deg]",
Visible !Flag_QuasiStatic];
AngularStep = deg*
DefineNumber[1, Name "Options/1Angular step [deg]",
AngularStep = deg * DefineNumber[2, Name "Options/1Angular step [deg]",
Visible Flag_QuasiStatic];
NumStep =
DefineNumber[20, Name "Options/1Number of steps",
NumStep = DefineNumber[20, Name "Options/1Number of steps",
Visible Flag_QuasiStatic];
rpm = 2. * Pi / 60. ;
......@@ -32,7 +31,6 @@ w1 = 1000*rpm ;
Mag_DTime = AngularStep / Fabs[w1] ;
Mag_TimeMax = Mag_DTime * NumStep;
Group {
// Geometrical regions
Rotor = Region[1];
......@@ -72,7 +70,6 @@ Group {
Sur_RotorPerMaster, Sur_RotorPerSlave} ] ;
Dom_Hcurl_a = Region[ { Vol_Mag, Sur_Link } ]; // No Neumann surface
Sur_Tree_Sliding = Region[ { Sur_SlidingMaster, Sur_SlidingSlave } ];
Lin_Tree = Region[ Lin_TreeLines ];
Sur_Tree = Region[ { Sur_Link, Sur_Dirichlet } ];
......@@ -92,7 +89,6 @@ Function{
js[] = 0;
}
Function {
// Sliding surface:
// a1 is the angular span of Region and RegionRef.
......@@ -122,11 +118,11 @@ Function {
Coef[] = ( fFloor[ ((Atan2[ Y[], X[] ] - a2[] )/a1) ] % 2 ) ? Periodicity : 1. ;
}
Group {
DefineGroup[ DomainInf ];
DefineVariable[ Val_Rint, Val_Rext ];
}
Jacobian {
{ Name Vol ;
Case { { Region DomainInf ; Jacobian VolSphShell {Val_Rint, Val_Rext} ; }
......@@ -195,8 +191,7 @@ FunctionSpace {
Support Dom_Hcurl_a ; Entity EdgesOf[ All ]; }
}
Constraint {
{ NameOfCoef ae; EntityType EdgesOf ;
NameOfConstraint a; }
{ NameOfCoef ae; EntityType EdgesOf ; NameOfConstraint a; }
If(Gauge == 1) // spanning tree gauging
{ NameOfCoef ae; EntityType EdgesOfTreeIn ; EntitySubType StartingOn ;
NameOfConstraint GaugeCondition_a ; }
......@@ -221,7 +216,6 @@ Formulation {
}
}
Resolution {
{ Name Static ;
System {
......@@ -302,8 +296,6 @@ PostOperation Fields UsingPost MagSta_a {
File "tmp.geo", LastTimeStepOnly] ;
}
PostOperation {
{ Name pos; NameOfPostProcessing MagSta_a;
Operation {
......@@ -318,6 +310,7 @@ PostOperation {
}
PostOperation Check_Periodicity UsingPost MagSta_a {
If(Gauge == 1)
// Print the tree for debugging purposes (the group name
PrintGroup[ _CO_Entity_39 , In Vol_Tree, File "Tree.pos"];
......@@ -325,6 +318,7 @@ PostOperation Check_Periodicity UsingPost MagSta_a {
"View[l].ColorTable = { DarkRed };",
"View[l].LineWidth = 5;"] ,
File "tmp.geo", LastTimeStepOnly] ;
EndIf
Print[ bsurf, OnElementsOf Region[ {Sur_SlidingMaster} ],
LastTimeStepOnly, File "bsm.pos"] ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment