Commit e41ce151 authored by Christophe Geuzaine's avatar Christophe Geuzaine

axi

parent 1b80d5ec
Pipeline #1498 passed with stage
in 12 minutes 18 seconds
......@@ -101,15 +101,23 @@ Group {
EndIf
}
// global definitions
DefineConstant[
Val_Rint = {1, Visible NbrRegions[Vol_Inf_Ele],
Name "Model/Geometry/1Internal shell radius"},
Val_Rext = {2, Visible NbrRegions[Vol_Inf_Ele],
Name "Model/Geometry/2External shell radius"}
Flag_Axi = {0, Choices{0,1}, Visible (modelDim == 2),
Name "Model/02Axisymmetric model"}
];
If(export && NbrRegions[Vol_Inf_Ele])
Printf(Sprintf("Val_Rint = %g;", Val_Rint)) >> Str[exportFile];
Printf(Sprintf("Val_Rext = %g;", Val_Rext)) >> Str[exportFile];
If(export)
If(NbrRegions[Vol_Inf_Ele])
Printf(Sprintf("Val_Rint = %g;", Val_Rint)) >> Str[exportFile];
Printf(Sprintf("Val_Rext = %g;", Val_Rext)) >> Str[exportFile];
EndIf
If(Flag_Axi)
Printf(Sprintf("Flag_Axi = 1;")) >> Str[exportFile];
EndIf
EndIf
// import material library
......
......@@ -47,6 +47,7 @@ Group {
If(export)
Printf('Group{') > Str[exportFile];
EndIf
DefineGroup[ Vol_Inf_Mag, Vol_NL_Mag ];
For i In {1:numPhysicals}
dim~{i} = GetNumber[Sprintf["Gmsh/Physical group %g/Dimension", i]];
name~{i} = GetString[Sprintf["Gmsh/Physical group %g/Name", i]];
......@@ -103,19 +104,24 @@ Group {
EndIf
}
Group{
DefineGroup[ Vol_Inf_Mag, Vol_NL_Mag ];
DefineConstant[
Val_Rint = {1, Visible NbrRegions[Vol_Inf_Mag],
Name "Model/Geometry/0Internal shell radius"},
Val_Rext = {2, Visible NbrRegions[Vol_Inf_Mag],
Name "Model/Geometry/1External shell radius"}
];
If(export && NbrRegions[Vol_Inf_Mag])
// global definitions
DefineConstant[
Val_Rint = {1, Visible NbrRegions[Vol_Inf_Mag],
Name "Model/Geometry/0Internal shell radius"},
Val_Rext = {2, Visible NbrRegions[Vol_Inf_Mag],
Name "Model/Geometry/1External shell radius"}
Flag_Axi = {0, Choices{0,1}, Visible (modelDim == 2),
Name "Model/02Axisymmetric model"}
];
If(export)
If(NbrRegions[Vol_Inf_Mag])
Printf(Sprintf("Val_Rint = %g;", Val_Rint)) >> Str[exportFile];
Printf(Sprintf("Val_Rext = %g;", Val_Rext)) >> Str[exportFile];
EndIf
}
If(Flag_Axi)
Printf(Sprintf("Flag_Axi = 1;")) >> Str[exportFile];
EndIf
EndIf
// import material library
Include "Lib_Materials.pro";
......
......@@ -10,6 +10,7 @@ DefineConstant[
modelPath = "", // default path of the model
resPath = StrCat[modelPath, "res/"], // path for post-operation files
eps0 = 8.854187818e-12, // permittivity of vacuum
Flag_Axi = 0, // axisymmetric model?
Val_Rint = 0, // internal radius of Vol_Inf_Ele annulus
Val_Rext = 0, // external radius of Vol_Inf_Ele annulus
Val_Cx = 0, // x-coordinate of center of Vol_Inf_Ele
......@@ -46,14 +47,24 @@ Function{
Jacobian {
{ Name Vol;
Case {
{ Region Vol_Inf_Ele;
Jacobian VolSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian Vol; }
If(Flag_Axi && modelDim < 3)
{ Region Vol_Inf_Ele;
Jacobian VolAxiSquSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian VolAxiSqu; }
Else
{ Region Vol_Inf_Ele;
Jacobian VolSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian Vol; }
EndIf
}
}
{ Name Sur;
Case {
{ Region All; Jacobian Sur; }
If(Flag_Axi && modelDim < 3)
{ Region All; Jacobian SurAxi; }
Else
{ Region All; Jacobian Sur; }
EndIf
}
}
}
......
......@@ -8,6 +8,9 @@
// redefined from outside the template:
DefineConstant[
modelPath = "", // default path of the model
resPath = StrCat[modelPath, "res/"], // path for post-operation files
Flag_Axi = 0, // axisymmetric model?
Flag_FrequencyDomain = 1, // frequency-domain or time-domain simulation
Flag_CircuitCoupling = 0, // consider coupling with external electric circuit
Flag_NewtonRaphson = 1, // Newton-Raphson or Picard method for nonlinear iterations
......@@ -19,6 +22,9 @@ DefineConstant[
FE_Order = 1, // finite element order
Val_Rint = 0, // interior radius of annulus shell transformation region (Vol_Inf_Mag)
Val_Rext = 0 // exterior radius of annulus shell transformation region (Vol_Inf_Mag)
Val_Cx = 0, // x-coordinate of center of Vol_Inf_Mag
Val_Cy = 0, // y-coordinate of center of Vol_Inf_Mag
Val_Cz = 0, // z-coordinate of center of Vol_Inf_Mag
NL_tol_abs = 1e-6, // absolute tolerance on residual for noninear iterations
NL_tol_rel = 1e-6, // relative tolerance on residual for noninear iterations
NL_iter_max = 20 // maximum number of noninear iterations
......@@ -98,14 +104,24 @@ Group{
Jacobian {
{ Name Vol;
Case {
{ Region Vol_Inf_Mag ;
Jacobian VolSphShell {Val_Rint, Val_Rext} ; }
{ Region All; Jacobian Vol; }
If(Flag_Axi)
{ Region Vol_Inf_Mag;
Jacobian VolAxiSquSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian VolAxiSqu; }
Else
{ Region Vol_Inf_Mag;
Jacobian VolSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian Vol; }
EndIf
}
}
{ Name Sur;
Case {
{ Region All; Jacobian Sur; }
If(Flag_Axi)
{ Region All; Jacobian SurAxi; }
Else
{ Region All; Jacobian Sur; }
EndIf
}
}
}
......
......@@ -9,13 +9,14 @@
DefineConstant[
modelPath = "", // default path of the model
resPath = StrCat[modelPath, "res/"], // path for post-operation files
Flag_NewtonRaphson = 1, // Newton-Raphson or Picard method for nonlinear iterations
modelDim = 2, // default model dimension (2D)
Flag_Axi = 0, // axisymmetric model?
Flag_NewtonRaphson = 1, // Newton-Raphson or Picard method for nonlinear iterations
Val_Rint = 0, // internal radius of Vol_Inf_Ele annulus
Val_Rext = 0, // external radius of Vol_Inf_Ele annulus
Val_Cx = 0, // x-coordinate of center of Vol_Inf_Ele
Val_Cy = 0, // y-coordinate of center of Vol_Inf_Ele
Val_Cz = 0, // z-coordinate of center of Vol_Inf_Ele
Val_Cx = 0, // x-coordinate of center of Vol_Inf_Mag
Val_Cy = 0, // y-coordinate of center of Vol_Inf_Mag
Val_Cz = 0, // z-coordinate of center of Vol_Inf_Mag
NL_tol_abs = 1e-6, // absolute tolerance on residual for noninear iterations
NL_tol_rel = 1e-6, // relative tolerance on residual for noninear iterations
NL_iter_max = 20 // maximum number of noninear iterations
......@@ -28,7 +29,7 @@ Group {
// Subsets of Vol_Mag:
Vol_NL_Mag, // nonlinear magnetic materials
Vol_M_Mag, // permenent magnets
Vol_M_Mag, // permanent magnets
Vol_S0_Mag, // imposed current density
Vol_Inf_Mag, // infinite domains
......@@ -63,14 +64,24 @@ Group {
Jacobian {
{ Name Vol;
Case {
{ Region Vol_Inf_Mag;
Jacobian VolSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian Vol; }
If(Flag_Axi && modelDim < 3)
{ Region Vol_Inf_Mag;
Jacobian VolAxiSquSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian VolAxiSqu; }
Else
{ Region Vol_Inf_Mag;
Jacobian VolSphShell{Val_Rint, Val_Rext, Val_Cx, Val_Cy, Val_Cz}; }
{ Region All; Jacobian Vol; }
EndIf
}
}
{ Name Sur;
Case {
{ Region All; Jacobian Sur; }
If(Flag_Axi && modelDim < 3)
{ Region All; Jacobian SurAxi; }
Else
{ Region All; Jacobian Sur; }
EndIf
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment