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

up

parent 282c890a
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,8 @@ DefineConstant[ ...@@ -13,8 +13,8 @@ DefineConstant[
CoefPower = 0.5, // coefficient for power calculations CoefPower = 0.5, // coefficient for power calculations
Freq = 50, // frequency (for harmonic simulations) Freq = 50, // frequency (for harmonic simulations)
TimeInit = 0, // intial time (for time-domain simulations) TimeInit = 0, // intial time (for time-domain simulations)
TimeFinal = 1, // final time (for time-domain simulations) TimeFinal = 1/50, // final time (for time-domain simulations)
DeltaTime = 0.01, // time step (for time-domain simulations) DeltaTime = 1/500, // time step (for time-domain simulations)
InterpolationOrder = 1 // finite element order InterpolationOrder = 1 // finite element order
Val_Rint = 0, // interior radius of annulus shell transformation region (VolInf_Mag) Val_Rint = 0, // interior radius of annulus shell transformation region (VolInf_Mag)
Val_Rext = 0 // exterior radius of annulus shell transformation region (VolInf_Mag) Val_Rext = 0 // exterior radius of annulus shell transformation region (VolInf_Mag)
...@@ -363,7 +363,7 @@ Resolution { ...@@ -363,7 +363,7 @@ Resolution {
Generate[Sys]; Solve[Sys]; SaveSolution[Sys]; Generate[Sys]; Solve[Sys]; SaveSolution[Sys];
Else Else
InitSolution[Sys]; // provide initial condition InitSolution[Sys]; // provide initial condition
TimeLoopTheta[Time0, TimeMax, DeltaTime, 1.]{ TimeLoopTheta[TimeInit, TimeFinal, DeltaTime, 1.]{
// Euler implicit (1) -- Crank-Nicolson (0.5) // Euler implicit (1) -- Crank-Nicolson (0.5)
Generate[Sys]; Solve[Sys]; SaveSolution[Sys]; Generate[Sys]; Solve[Sys]; SaveSolution[Sys];
} }
......
/* ------------------------------------------------------------------- /* -------------------------------------------------------------------
Tutorial 7a : magnetostatic field of an electromagnet, bis Tutorial 7a : magnetic fields of an electromagnet
Features: Features:
- Same as Tutorial 2, but using a generic template formulation library - Use of a template formulation library
- Identical to Tutorial 2 for a static current source
- Frequency-domain solution for a dynamic current source
To compute the solution in a terminal: To compute the static solution in a terminal:
getdp electromagnet -solve MagSta_a_2D getdp electromagnet -solve MagSta_a_2D -pos Map_a
getdp electromagnet -pos Map_a
To compute the time-harmonic dynamic solution in a terminal:
getdp electromagnet -solve MagDyn_a_2D -pos Map_a
To compute the solution interactively from the Gmsh GUI: To compute the solution interactively from the Gmsh GUI:
File > Open > electromagnet.pro File > Open > electromagnet.pro
...@@ -25,10 +29,11 @@ Group { ...@@ -25,10 +29,11 @@ Group {
// Abstract regions used in the "Lib_MagStaDyn_av_2D_Cir.pro" template file // Abstract regions used in the "Lib_MagStaDyn_av_2D_Cir.pro" template file
// that is included below: // that is included below:
VolCC_Mag = Region[{Air, Core, AirInf}]; // Non-conducting regions VolCC_Mag = Region[{Air, AirInf}]; // Non-conducting regions
VolC_Mag = Region[{Core}]; // Massive conducting regions
VolS_Mag = Region[{Ind}]; // Stranded conductors, i.e., coils VolS_Mag = Region[{Ind}]; // Stranded conductors, i.e., coils
VolInf_Mag = Region[{AirInf}]; // annulus for infinite shell transformation VolInf_Mag = Region[{AirInf}]; // Annulus for infinite shell transformation
Val_Rint = rInt; Val_Rext = rExt; // interior and exterior radii of annulus Val_Rint = rInt; Val_Rext = rExt; // Interior and exterior radii of annulus
} }
Function { Function {
...@@ -41,11 +46,15 @@ Function { ...@@ -41,11 +46,15 @@ Function {
nu[ Region[{Air, Ind, AirInf}] ] = 1. / mu0; nu[ Region[{Air, Ind, AirInf}] ] = 1. / mu0;
nu[ Core ] = 1. / (murCore * mu0); nu[ Core ] = 1. / (murCore * mu0);
sigma[ Core ] = 1e6 / 10;
sigma[ Ind ] = 5e7;
Ns[ Ind ] = 1000 ; // number of turns in coil Ns[ Ind ] = 1000 ; // number of turns in coil
Sc[ Ind ] = SurfaceArea[] ; // surface (cross section) of coil Sc[ Ind ] = SurfaceArea[] ; // surface (cross section) of coil
// Current density in each coil portion for a unit current (will be multiplied // Current density in each coil portion for a unit current (will be multiplied
// by the actual total current in the coil) // by the actual total current in the coil)
js0[ Ind ] = Ns[]/Sc[] * Vector[0,0,-1]; js0[ Ind ] = Ns[]/Sc[] * Vector[0,0,-1];
CoefGeos[] = 1;
} }
Constraint { Constraint {
...@@ -57,11 +66,13 @@ Constraint { ...@@ -57,11 +66,13 @@ Constraint {
} }
{ Name Current_2D; { Name Current_2D;
Case { Case {
// represents the phasor amplitude for a dynamic analysis
{ Region Ind; Value Current; } { Region Ind; Value Current; }
} }
} }
{ Name Voltage_2D; { Name Voltage_2D;
Case { Case {
{ Region Core; Value 0; }
} }
} }
} }
...@@ -69,9 +80,10 @@ Constraint { ...@@ -69,9 +80,10 @@ Constraint {
Include "Lib_MagStaDyn_av_2D_Cir.pro"; Include "Lib_MagStaDyn_av_2D_Cir.pro";
PostOperation { PostOperation {
{ Name Map_a; NameOfPostProcessing MagSta_a_2D; { Name Map_a; NameOfPostProcessing MagDyn_a_2D;
Operation { Operation {
Print[ a, OnElementsOf Vol_Mag, File "a.pos" ]; Print[ a, OnElementsOf Vol_Mag, File "a.pos" ];
Print[ b, OnElementsOf Vol_Mag, File "b.pos" ];
} }
} }
} }
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
Tutorial 7b : magnetodyamic model of a single-phase transformer Tutorial 7b : magnetodyamic model of a single-phase transformer
Features: Features:
- Time-domain and frequency-domain dynamical problems
- Use of a generic template formulation library - Use of a generic template formulation library
- Circuit coupling used as a black-box (see Tutorial 8 for more) - Frequency- and time-domain dynamic solutions
- Circuit coupling used as a black-box (see Tutorial 8 for details)
To compute the solution in a terminal: To compute the solution in a terminal:
getdp transfo -solve MagDyn_a_2D getdp transfo -solve MagDyn_a_2D -pos Map_a
getdp electromagnet -pos Map
To compute the solution interactively from the Gmsh GUI: To compute the solution interactively from the Gmsh GUI:
File > Open > transfo.pro File > Open > transfo.pro
...@@ -204,7 +203,7 @@ Constraint { ...@@ -204,7 +203,7 @@ Constraint {
Case { Case {
If (type_Source == 1) If (type_Source == 1)
// Current in each coil (same for PLUS and MINUS portions) // Current in each coil (same for PLUS and MINUS portions)
{ Region Coil_1; Value 1; } { Region Coil_1; Value 1; TimeFunction F_Sin_wt_p[]{2*Pi*Freq, 0}; }
{ Region Coil_2; Value 0; } { Region Coil_2; Value 0; }
EndIf EndIf
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment