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

update

parent 406b1eda
No related branches found
No related tags found
No related merge requests found
...@@ -287,7 +287,6 @@ FunctionSpace { ...@@ -287,7 +287,6 @@ FunctionSpace {
Formulation { Formulation {
{ Name MagnetoDynamics; Type FemEquation; { Name MagnetoDynamics; Type FemEquation;
If( !Flag_3D )
Quantity { Quantity {
{ Name a; Type Local; NameOfSpace Hcurl_a_2D; } { Name a; Type Local; NameOfSpace Hcurl_a_2D; }
{ Name ac; Type Local; NameOfSpace Hcurl_a_2D[ac]; } { Name ac; Type Local; NameOfSpace Hcurl_a_2D[ac]; }
...@@ -336,6 +335,7 @@ Formulation { ...@@ -336,6 +335,7 @@ Formulation {
In lVol_C;} In lVol_C;}
Integral { DtDof [ Dof{ac}/A_c , {i} ]; Integral { DtDof [ Dof{ac}/A_c , {i} ];
In lVol_C; Jacobian Vol; Integration I1; } In lVol_C; Jacobian Vol; Integration I1; }
If( Flag_Thin != 3) If( Flag_Thin != 3)
Integral { DtDof [ -Dof{aw}/A_c , {i} ]; Integral { DtDof [ -Dof{aw}/A_c , {i} ];
In lVol_C; Jacobian Vol; Integration I1;} In lVol_C; Jacobian Vol; Integration I1;}
...@@ -343,44 +343,6 @@ Formulation { ...@@ -343,44 +343,6 @@ Formulation {
In lVol_C;} In lVol_C;}
EndIf EndIf
} }
Else // ############### 3D
Quantity {
{ Name a; Type Local; NameOfSpace Hcurl_a_3D; }
{ Name ac; Type Local; NameOfSpace Hcurl_a_3D[ac]; }
{ Name aw; Type Local; NameOfSpace Hcurl_a_3D[aw]; }
// { Name v; Type Local; NameOfSpace Hgrad_u_3D; }
// { Name U; Type Global; NameOfSpace Hgrad_u_3D [U]; }
// { Name I; Type Global; NameOfSpace Hgrad_u_3D [I]; }
}
Equation {
/*
Integral { [ nu[] * Dof{d ac} , {d ac} ];
In Vol_nu; Jacobian Vol; Integration I1; }
Integral { [ nu[] * Dof{d aw} , {d aw} ];
In Vol_nu; Jacobian Vol; Integration I1; }
Integral { [ -Vector[ 0, 0, I0/A_c] , {ac} ];
In lVol_C; Jacobian Vol; Integration I1; }
Integral { [ -Vector[ 0, 0, I0/A_c] , {aw} ];
In lVol_C; Jacobian Vol; Integration I1; }
Integral { [ -Vector[ 0, 0, I0/A_c] , {a} ];
In Vol_C; Jacobian Vol; Integration I1; }
Integral { DtDof[ sigma[] * Dof{a} , {a} ];
In Vol_C; Jacobian Vol; Integration I1; }
Integral { [ sigma[] * Dof{d v} , {a} ];
In Vol_C; Jacobian Vol; Integration I1; }
Integral { DtDof[ sigma[] * Dof{a} , {d v} ];
In Vol_C; Jacobian Vol; Integration I1; }
Integral { [ sigma[] * Dof{d v} , {d v} ];
In Vol_C; Jacobian Vol; Integration I1; }
GlobalTerm { [Dof{U} , {I} ]; In Electrodes; }
*/
}
EndIf
} }
} }
...@@ -428,6 +390,7 @@ Resolution { ...@@ -428,6 +390,7 @@ Resolution {
For i In {1:NumWires} For i In {1:NumWires}
Print[ {i, rw, Sqrt[ $sarea~{i}/Pi], rs, $sarea~{i}, Pi*rs^2, skin_depth, $intby~{i}/$sarea~{i}}, Print[ {i, rw, Sqrt[ $sarea~{i}/Pi], rs, $sarea~{i}, Pi*rs^2, skin_depth, $intby~{i}/$sarea~{i}},
Format "WIRE %2g: rw = %7.3e rs = %7.3e (%7.3e) as = %7.3e (%7.3e) delta = %7.3e bave = %7.3e" ] ; Format "WIRE %2g: rw = %7.3e rs = %7.3e (%7.3e) as = %7.3e (%7.3e) delta = %7.3e bave = %7.3e" ] ;
//Print[ {$sarea~{i}}, Format "DEBUG %7.3e" ] ;
EndFor EndFor
EndIf EndIf
} }
...@@ -470,7 +433,6 @@ PostProcessing { ...@@ -470,7 +433,6 @@ PostProcessing {
Value{ Integral{ [ 1 ] ; Value{ Integral{ [ 1 ] ;
In Vol_nu; Integration I1 ; Jacobian Vol; }}} In Vol_nu; Integration I1 ; Jacobian Vol; }}}
If( Flag_Thin == 0 ) If( Flag_Thin == 0 )
{ Name flux; { Name flux;
Value { Integral { [ CompZ[ {a} ] / A_c ]; Value { Integral { [ CompZ[ {a} ] / A_c ];
...@@ -506,7 +468,6 @@ PostProcessing { ...@@ -506,7 +468,6 @@ PostProcessing {
Value { Integral { [ Norm [ CompY[ {d ac} - {d aw} ] ] ] ; Value { Integral { [ Norm [ CompY[ {d ac} - {d aw} ] ] ] ;
In SWIRE~{i}; Integration I1 ; Jacobian Vol; }}} In SWIRE~{i}; Integration I1 ; Jacobian Vol; }}}
EndFor EndFor
EndIf EndIf
} }
} }
...@@ -605,6 +566,7 @@ PostOperation integaz UsingPost PostProcessings { ...@@ -605,6 +566,7 @@ PostOperation integaz UsingPost PostProcessings {
Format Table, File > "joule_full.dat", Format Table, File > "joule_full.dat",
SendToServer Sprintf["}Joule Losses/Wire %g/1Full",i]]; SendToServer Sprintf["}Joule Losses/Wire %g/1Full",i]];
EndIf EndIf
If( Flag_Thin == 1 ) If( Flag_Thin == 1 )
Print[ U, OnRegion lVol_C, File > "U_raw.dat", Format Table, Print[ U, OnRegion lVol_C, File > "U_raw.dat", Format Table,
SendToServer Sprintf["}Voltage/Wire %g/2Raw",i]]; SendToServer Sprintf["}Voltage/Wire %g/2Raw",i]];
...@@ -614,6 +576,7 @@ PostOperation integaz UsingPost PostProcessings { ...@@ -614,6 +576,7 @@ PostOperation integaz UsingPost PostProcessings {
Format Table, File > "joule_raw.dat", Format Table, File > "joule_raw.dat",
SendToServer Sprintf["}Joule Losses/Wire %g/2Raw",i]]; SendToServer Sprintf["}Joule Losses/Wire %g/2Raw",i]];
EndIf EndIf
If( Flag_Thin == 2 ) If( Flag_Thin == 2 )
Print[ U, OnRegion lVol_C, File > "U_reg.dat", Format Table, Print[ U, OnRegion lVol_C, File > "U_reg.dat", Format Table,
SendToServer Sprintf["}Voltage/Wire %g/3Reg",i]]; SendToServer Sprintf["}Voltage/Wire %g/3Reg",i]];
...@@ -623,6 +586,7 @@ PostOperation integaz UsingPost PostProcessings { ...@@ -623,6 +586,7 @@ PostOperation integaz UsingPost PostProcessings {
Format Table, File > "joule_reg.dat", Format Table, File > "joule_reg.dat",
SendToServer Sprintf["}Joule Losses/Wire %g/3Reg",i]]; SendToServer Sprintf["}Joule Losses/Wire %g/3Reg",i]];
EndIf EndIf
If( Flag_Thin == 3 ) If( Flag_Thin == 3 )
Print[ U, OnRegion lVol_C, File > "U_naive.dat", Format Table, Print[ U, OnRegion lVol_C, File > "U_naive.dat", Format Table,
SendToServer Sprintf["}Voltage/Wire %g/4Naive",i]]; SendToServer Sprintf["}Voltage/Wire %g/4Naive",i]];
...@@ -634,74 +598,13 @@ PostOperation integaz UsingPost PostProcessings { ...@@ -634,74 +598,13 @@ PostOperation integaz UsingPost PostProcessings {
EndIf EndIf
If( Flag_Thin != 0 ) If( Flag_Thin != 0 )
Print[ area~{i}[SWIRE~{i}], OnGlobal, Print[ surf[SWIRE~{i}], OnGlobal,
Format Table, File >"zzz", Format Table, File >"zzz", StoreInVariable $sarea~{i}];
StoreInVariable $sarea~{i}];
Print[ intby~{i}[SWIRE~{i}], OnGlobal, Print[ intby~{i}[SWIRE~{i}], OnGlobal,
Format Table, File > "zzz", Format Table, File > "zzz", StoreInVariable $intby~{i}];
StoreInVariable $intby~{i}];
EndIf EndIf
EndFor EndFor
} }
/*{ Name flux_corr; // corrected flux
Value {
Integral { [ CompZ[ {ac} - {aw} ] ];
In lVol_C; Integration I1 ; Jacobian Vol; }
Integral { [ Analytic_L[]*{Is} ];
In lVol_C; Integration I1 ; Jacobian Vol; }
}
}*/
/* Print [awz, OnElementsOf Vol_nu, File "awz.pos"];
Echo[ StrCat["l=PostProcessing.NbViews-1;",
"View[l].IntervalsType = 3;",
"View[l].NbIso = 30;",
"View[l].RaiseZ = 15000;",
"View[l].NormalRaise = 0;"],
File "tmp.geo", LastTimeStepOnly] ;
Print [acz, OnElementsOf Vol_nu, File "acz.pos"];
Echo[ StrCat["l=PostProcessing.NbViews-1;",
"View[l].IntervalsType = 3;",
"View[l].NbIso = 30;",
"View[l].RaiseZ = 15000;",
"View[l].NormalRaise = 0;"],
File "tmp.geo", LastTimeStepOnly] ;
Print[ flux[ VWIRE~{i} ], OnGlobal,
Format Table, File > "flux_full.dat",
SendToServer Sprintf["}Flux/Wire %g/1Full",i]];
Print[ flux[ LWIRE~{i} ], OnGlobal,
Format Table, File > "flux_raw.dat",
SendToServer Sprintf["}Flux/Wire %g/2Raw",i]];
Print[ flux[ LWIRE~{i} ], OnGlobal,
Format Table, File > "flux_reg.dat",
SendToServer Sprintf["}Flux/Wire %g/4Reg",i]];
*/
/*
X = rw/skin_depth;
pI[] = (X/2)*Re[(1+i[])*(J_0[(1+i[])*X]/J_1[(1+i[])*X])];
Resist[] = Re[pI[]*R_dc];
// radial analytical solution with a zero flux condition imposed at r=rs
Analytic_a~{i}[] = mu0/(2*Pi) * WI~{i} *
( (R~{i}[]>WR~{i}) ? Log[rs/R~{i}[]] :
Log[rs/WR~{i}] + (J0[tau[]*R~{i}[]/rw] - J0[tau[]]) / J1[tau[]] / tau[] );
Analytic_L~{i}[] = mu0 / (2*Pi) *
( 2/tau[]/tau[]- J0[tau[]] / J1[tau[]] / tau[] - Log[rs/WR~{i}] ) ;
// Idem in static case (thus particular case of the above)
AnalyticStatic_a~{i}[] = mu0 * WI~{i} / (2*Pi) *
( (R~{i}[]>WR~{i}) ? Log[rs/R~{i}[]] : Log[rs/WR~{i}] + (1-(R~{i}[]/WR~{i})^2)/2. );
Analytic_e~{i}[] = mu0 * WI~{i} / (2*Pi) * i[] * omega
* J0[tau[]*R~{i}[]/WR~{i}] / J1[tau[]] / tau[] ;
Analytic_flux~{i}[] = mu0 * WI~{i} / (2*Pi) *
( i[] * (skin_depth/WR~{i})^2 + Log[rs/WR~{i}] - J0[tau[]] / J1[tau[]] / tau[] ) ;
*/
...@@ -116,7 +116,10 @@ ElseIf( Flag_RegSleeve ) // regular sleeve ...@@ -116,7 +116,10 @@ ElseIf( Flag_RegSleeve ) // regular sleeve
s1 = news; Plane Surface(s1) = {ll1,-llWires[]}; s1 = news; Plane Surface(s1) = {ll1,-llWires[]};
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], Wires[] }; Physical Volume ("AIR", 1) = { e[1], Wires[] };
Physical Volume ("BLA", 5) = { e[1] }; // auxiliary Physical Volume to test the tree.
// Note that two Physical Volumes defined on a same region
// yield duplicate finite element in GetDP.
//Physical Volume ("BLA", 5) = { e[1] }; this
Else Else
...@@ -148,4 +151,5 @@ If( !Flag_Thin ) // Wires with finite radius ...@@ -148,4 +151,5 @@ If( !Flag_Thin ) // Wires with finite radius
Electrodes[] += {20+i, 30+i}; Electrodes[] += {20+i, 30+i};
EndFor EndFor
EndIf EndIf
Physical Line("LINTREE", 4) = { Boundary { Physical Surface { Electrodes[] }; } };
Physical Line("LINTREE", 4) = { CombinedBoundary { Physical Surface { Electrodes[] }; } };
...@@ -33,8 +33,7 @@ Group{ ...@@ -33,8 +33,7 @@ Group{
AIR = Region[ 1 ]; AIR = Region[ 1 ];
INF = Region[ 2 ]; INF = Region[ 2 ];
SKIN = Region[ 3 ]; SKIN = Region[ 3 ];
LINTREE = Region[ 4 ]; // not used LINTREE = Region[ 4 ];
BLA = Region[ 5 ];
VWIRES = Region[ {} ]; VWIRES = Region[ {} ];
LWIRES = Region[ {} ]; LWIRES = Region[ {} ];
...@@ -62,7 +61,6 @@ Group{ ...@@ -62,7 +61,6 @@ Group{
CATHODES += Region[ CATHODE~{i} ]; CATHODES += Region[ CATHODE~{i} ];
EndFor EndFor
// Abstract regions // Abstract regions
If( !Flag_Thin ) If( !Flag_Thin )
...@@ -84,7 +82,6 @@ Group{ ...@@ -84,7 +82,6 @@ Group{
// additional Groups for the semi_analytic approach // additional Groups for the semi_analytic approach
Dom_Hthin_a = ElementsOf[ Vol_nu, OnOneSideOf LWIRES ]; Dom_Hthin_a = ElementsOf[ Vol_nu, OnOneSideOf LWIRES ];
Vol_Tree = ElementsOf[ Vol_nu, DisjointOf LWIRES ]; Vol_Tree = ElementsOf[ Vol_nu, DisjointOf LWIRES ];
//Vol_Tree = Region[ { BLA } ];
Sur_Tree = Region[ { Sur_Dirichlet_a /*, SKIN*/ } ]; Sur_Tree = Region[ { Sur_Dirichlet_a /*, SKIN*/ } ];
If( !Flag_SemiAnalytic ) If( !Flag_SemiAnalytic )
Lin_Tree = Region[ {} ]; Lin_Tree = Region[ {} ];
...@@ -93,7 +90,6 @@ Group{ ...@@ -93,7 +90,6 @@ Group{
EndIf EndIf
} }
Function{ Function{
omega = 2*Pi*Freq; omega = 2*Pi*Freq;
mu0 = Pi*4e-7; mu0 = Pi*4e-7;
...@@ -576,16 +572,13 @@ PostOperation map UsingPost MagnetoDynamics { ...@@ -576,16 +572,13 @@ PostOperation map UsingPost MagnetoDynamics {
Print[ J, OnElementsOf Vol_C, File "j.pos"]; Print[ J, OnElementsOf Vol_C, File "j.pos"];
Else Else
Print[ bs, OnElementsOf Vol_nu, File "bs.pos"]; Print[ bs, OnElementsOf Vol_nu, File "bs.pos"];
PrintGroup[ EdgesOf[ Vol_nu, ConnectedTo LWIRES ], // PrintGroup[ EdgesOf[ Vol_nu, ConnectedTo LWIRES ],
In Vol_nu, File "group.pos"]; // In Vol_nu, File "group.pos"];
PrintGroup[ _CO_Entity_71, In Vol_nu, File "Tree.pos"]; //PrintGroup[ _CO_Entity_71, In Vol_nu, File "Tree.pos"];
EndIf EndIf
//PrintGroup[ _CO_Entity_30, In Vol_nu, File "Tree.pos"];
// PrintGroup[ EdgesOfTreeIn[ { Vol_Tree }, StartingOn { Sur_Tree, Lin_Tree } ], PrintGroup[ EdgesOfTreeIn[ Vol_Tree , StartingOn { Sur_Tree, Lin_Tree } ],
// In Vol_nu, File "Tree.pos"]; In Vol_nu, File "Tree.pos"];
} }
PostOperation integaz UsingPost MagnetoDynamics { PostOperation integaz UsingPost MagnetoDynamics {
......
...@@ -22,8 +22,8 @@ DefineConstant[ ...@@ -22,8 +22,8 @@ DefineConstant[
Flag_Stranded = {0, Name "Parameters/04Stranded conductors", Flag_Stranded = {0, Name "Parameters/04Stranded conductors",
Choices {0,1}, Visible !Flag_SemiAnalytic || !Flag_Thin} Choices {0,1}, Visible !Flag_SemiAnalytic || !Flag_Thin}
Flag_Dual = {0, Name "Parameters/05Dual approach", // Flag_Dual = {0, Name "Parameters/05Dual approach",
Choices {0,1}, Visible Flag_SemiAnalytic && Flag_Thin} // Choices {0,1}, Visible Flag_SemiAnalytic && Flag_Thin}
Flag_U = {0, Name "Parameters/06Impose U", Choices {0,1}, Visible 1} Flag_U = {0, Name "Parameters/06Impose U", Choices {0,1}, Visible 1}
WireRadius = {1, Name "Parameters/10Wire radius [mm]"} WireRadius = {1, Name "Parameters/10Wire radius [mm]"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment