Select Git revision
-
Christophe Geuzaine authoredChristophe Geuzaine authored
transfo.pro 8.05 KiB
/* -------------------------------------------------------------------
Tutorial 7b : magnetodyamic model of a single-phase transformer
Features:
- Use of a generic template formulation library
- 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:
getdp transfo -solve MagDyn_a_2D -pos Map_a
To compute the solution interactively from the Gmsh GUI:
File > Open > transfo.pro
Run (button at the bottom of the left panel)
------------------------------------------------------------------- */
Include "transfo_common.pro";
DefineConstant[
type_Conds = {2, Choices{1 = "Massive", 2 = "Coil"}, Highlight "Blue",
Name "Parameters/01Conductor type"}
type_Source = {2, Choices{1 = "Current", 2 = "Voltage"}, Highlight "Blue",
Name "Parameters/02Source type"}
type_Analysis = {1, Choices{1 = "Frequency-domain", 2 = "Time-domain"}, Highlight "Blue",
Name "Parameters/03Analysis type"}
Freq = {50, Min 0, Max 1e3, Step 1,
Name "Parameters/Frequency"}
];
Group {
/* Abstract regions that will be used in the "Lib_MagStaDyn_av_2D_Cir.pro"
template file included below; the regions are first intialized as empty,
before being filled with physical groups */
Vol_CC_Mag = Region[{}]; // Non-conducting regions
Vol_C_Mag = Region[{}]; // Massive conductors
Vol_S_Mag = Region[{}]; // Stranded conductors, i.e., coils
// air physical groups
Air = Region[{AIR_WINDOW, AIR_EXT}];
Vol_CC_Mag += Region[Air];
// exterior boundary
Sur_Air_Ext = Region[{SUR_AIR_EXT}];
// magnetic core of the transformer, assumed to be non-conducting
Core = Region[CORE];
Vol_CC_Mag += Region[Core];
Coil_1_P = Region[COIL_1_PLUS];
Coil_1_M = Region[COIL_1_MINUS];
Coil_1 = Region[{Coil_1_P, Coil_1_M}];
Coil_2_P = Region[COIL_2_PLUS];
Coil_2_M = Region[COIL_2_MINUS];
Coil_2 = Region[{Coil_2_P, Coil_2_M}];
Coils = Region[{Coil_1, Coil_2}];
If (type_Conds == 1)
Vol_C_Mag += Region[{Coils}];
ElseIf (type_Conds == 2)
Vol_S_Mag += Region[{Coils}];
Vol_CC_Mag += Region[{Coils}];
EndIf
}
Function {
mu0 = 4e-7*Pi;