Formulation {
// Required for temperature initialization from other results
{ Name getdpThermalInitialization; Type FemEquation ;
Quantity {
{ Name T ; Type Local ; NameOfSpace Hgrad_T ; }
}
Equation {
Galerkin { [ Dof{T}, {T} ] ;
In Region[Vol_The] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ -ScalarField[XYZ[]]{0}, {T} ] ;
In Region[Vol_The] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ +ScalarField[XYZ[]]{0}, {T} ] ;
In Region[moved_domains] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ -ScalarField[XYZ[] - linear_transform[]]{0}, {T} ] ;
In Region[moved_domains] ; Jacobian JVol ; Integration I1 ; }
}
}
{ Name getdpThermal_formulation ; Type FemEquation;
Quantity {
{ Name T; Type Local; NameOfSpace Hgrad_T; }
{ Name hflux; Type Local; NameOfSpace Hgrad_flux; }
{ Name U_h; Type Global; NameOfSpace Hgrad_flux [U_hflux]; }
{ Name hrflux; Type Local; NameOfSpace Hrgrad_flux; }
{ Name U_hr; Type Global; NameOfSpace Hrgrad_flux [U_hrflux]; }
If (#Sur_RESISTANCE_T_List())
{ Name Tresistance ; Type Local ; NameOfSpace Hgrad_T[Tresistance] ; }
EndIf
If(Flag_MagTherm==2)
{ Name a ; Type Local ; NameOfSpace Hcurl_a_Mag_2D; }
{ Name ur; Type Local ; NameOfSpace Hregion_u_Mag_2D; }
{ Name istr ; Type Local ; NameOfSpace Hregion_i_Mag_2D ; }
EndIf
If(Flag_MagTherm==3)
{ Name a ; Type Local ; NameOfSpace Hcurl_a_3D; }
{ Name e; Type Local ; NameOfSpace Hregion_u_3D; }
{ Name e0 ; Type Local ; NameOfSpace Hregion_u0_3D ; }
EndIf
}
Equation {
Galerkin { [ lambda[{T}] * Dof{d T} , {d T} ];
In Vol_The; Integration I1; Jacobian JVol; }
If (#Sur_RESISTANCE_T_List())
Galerkin { [ ( 1/resistance_thermal[] ) * Dof{Tresistance} , {Tresistance} ] ;
In Sur_RESISTANCE_T; Integration I1 ; Jacobian JSur ; }
EndIf
Galerkin { DtDof [ rho[{T}] * cp[{T}] * Dof{T} , {T} ];
In Vol_The; Integration I1; Jacobian JVol; }
Galerkin { [ -qVol[{T}, $Time] , {T} ];
In Vol_The; Integration I1; Jacobian JVol; }
Galerkin { [ rho[{T}] * cp[{T}] * _velocityEffects[]*Vector[Velocity_x[$Time], Velocity_y[$Time], Velocity_z[$Time]] * Dof{Grad T} ,{T}];
In Vol_The; Integration I1; Jacobian JVol;}
Galerkin { [ rho[{T}] * cp[{T}] * _velocityEffects[]*Omega_Z[]*Vector[-Y[], X[], 0] * Dof{Grad T},{T}];
In Vol_The; Integration I1; Jacobian JVol;}
If(Flag_MagTherm==2)
Galerkin { [ -steinmetz_k[]*1e6* (Freq*1e-3)^steinmetz_a[] * [Norm[{d a}] ]^steinmetz_b[], {T} ];
In non_conducting_domain; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5 * sigma[{T}[1]] * [SquNorm[Dt[{a}]+{ur}/GeomCoeff[]]], {T} ];
In conducting_domain; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5 * sigma[{T}[1]] * [SquNorm[Dt[{a}]+{ur}/GeomCoeff[]]], {T} ];
In source_domain; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5*SquNorm[Nc[]*{istr}/area[]]/(FillFactor[]*sigma[{T}[1]]), {T} ];
In stranded_source_domain; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5 * Re[(1+Complex[0,1])* Sqrt[3.14*Freq/(nu[{d a}, {T}[1]]*sigma[{T}[1]])]] * SquNorm[1/((1+Complex[0,1])* Sqrt[3.14*Freq/(nu[]*sigma[{T}[1]])]) * [(Dt[{a}]+{ur})] ] , {T} ];
In Sur_SIBC_B; Integration I1; Jacobian JSur; }
EndIf
If(Flag_MagTherm==3)
Galerkin { [ -steinmetz_k[]*1e6* (Freq*1e-3)^steinmetz_a[] * [Norm[{d a}] ]^steinmetz_b[], {T} ];
In non_conducting_domain; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5 * sigma[{T}[1]] * [SquNorm[Dt[{a}]+{e}]], {T} ];
In conducting_domain ; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5 * sigma[{T}[1]] * [SquNorm[Dt[{a}]+{e}]], {T} ];
In source_domain ; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5*FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[{T}[1]]/(2*nu[{d a}, {T}[1]])]]*SquNorm[1.0/cross_section_area[]/(Norm[{e0}])*({e})]/sigma[{T}[1]], {T} ];
In stranded_source_domain ; Integration I1; Jacobian JVol; }
Galerkin { [ -0.5 * Re[(1+Complex[0,1])* Sqrt[3.14*Freq/(nu[]*sigma[{T}[1]])]] * SquNorm[1/((1+Complex[0,1])* Sqrt[3.14*Freq/(nu[]*sigma[{T}[1]])]) * [(Dt[{a}]+{e})] ] , {T} ];
In Sur_SIBC_B; Integration I1; Jacobian JSur; }
EndIf
Galerkin { [ -qSurf[{T}, $Time] , {T} ];
In Region[{Sur_HEATFLUX_T, Sur_COMBINED_T}]; Integration I1; Jacobian JSur; }
Galerkin { [ h[{T}, $Time] * Dof{T} , {T} ] ;
In Region[{Sur_CONVECTIVE_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
Galerkin { [ -h[{T}, $Time] * tref[] , {T} ] ;
In Region[{Sur_CONVECTIVE_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
If(radiationNLFlag==1)
Galerkin { [ hr[{T}] * sb_constant * (({T}+273.)^4) , {T} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
Galerkin { [ - hr[{T}] * sb_constant * ((tref[]+273.)^4) , {T} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
Galerkin { JacNL[ hr[{T}] * sb_constant * 4 * (({T}+273.)^3) * Dof{T} , {T} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
Galerkin { JacNL[ - hr[{T}] * sb_constant * 4 * (({T}+273.)^3) * {T} , {T} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
EndIf
Galerkin { [ -qSurfInt[{T}, $Time]/SurfaceArea[], {T} ];
In Region[{Sur_HEATFLOW_T}]; Integration I1; Jacobian JSur; }
Galerkin { [ -qSurfInt[{T}, $Time]/SurfaceArea[] , {T} ];
In Region[{Sur_COMBINED_T}]; Integration I1; Jacobian JSur; }
// Thermal loss calculation
GlobalTerm { [ Dof{U_h} , {U_h} ] ; In Region[{Sur_CONVECTIVE_T, Sur_COMBINED_T}] ; }
Galerkin { [ -h[{T}, $Time] *( tref[])/SurfaceArea[], {hflux} ] ;
In Region[{Sur_CONVECTIVE_T, Sur_COMBINED_T}] ; Jacobian JSur; Integration I1; }
Galerkin { [ h[{T}, $Time] *( Dof{T})/SurfaceArea[], {hflux} ] ;
In Region[{Sur_CONVECTIVE_T, Sur_COMBINED_T}] ; Jacobian JSur; Integration I1; }
GlobalTerm { [ Dof{U_hr} , {U_hr} ] ; In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; }
Galerkin { [ - hr[{T}, $Time] * sb_constant*((tref[]+273.)^4)/SurfaceArea[] , {hrflux} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Jacobian JSur; Integration I1; }
Galerkin { [ hr[{T}, $Time] * sb_constant*(({T}+273.)^4)/SurfaceArea[] , {hrflux} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Jacobian JSur; Integration I1; }
Galerkin { [ -hr[{T}] * sb_constant * 4 * (({T}+273.)^3)/SurfaceArea[] * {T} , {hrflux} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
Galerkin { [ hr[{T}] * sb_constant * 4 * (({T}+273.)^3)/SurfaceArea[] * Dof{T} , {hrflux} ] ;
In Region[{Sur_RADIATION_T, Sur_COMBINED_T}] ; Integration I1; Jacobian JSur; }
}
}
}
Formulation {
{ Name stranded_sigma_formulation; Type FemEquation ;
Quantity {
{ Name e0 ; Type Local ; NameOfSpace Hregion_u0_3D ; } //stranded conductor effective sigma computation
{ Name I0 ; Type Global ; NameOfSpace Hregion_u0_3D [I0] ; }
{ Name U0 ; Type Global ; NameOfSpace Hregion_u0_3D [U0] ; }
If(Flag_MagTherm==3)
{ Name T; Type Local; NameOfSpace Hgrad_T; }
EndIf
}
Equation {
If(Flag_MagTherm==3)
Galerkin { [ sigma[[{T}]] * Dof{e0} , {e0} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
Else
Galerkin { [ sigma[] * Dof{e0} , {e0} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
EndIf
GlobalTerm { [ - Dof{I0}, {U0} ] ; In Region[{SurStr_CURRENT_B_CH}]; }
}
}
{ Name getdpEMGeneral3D_formulation ; Type FemEquation ;
Quantity {
{ Name ln ; Type Local ; NameOfSpace airLinSpace; }
{ Name a ; Type Local ; NameOfSpace Hcurl_a_3D ; }
{ Name e ; Type Local ; NameOfSpace Hregion_u_3D ; }
If (#Sur_RESISTANCE_B_List())
{ Name eResistance ; Type Local ; NameOfSpace Hregion_u_3D[eResistance] ; }
EndIf
{ Name I ; Type Global ; NameOfSpace Hregion_u_3D [I] ; }
{ Name U ; Type Global ; NameOfSpace Hregion_u_3D [U] ; }
{ Name Istr ; Type Global ; NameOfSpace Hregion_u_3D [Istr] ; }
{ Name Ustr ; Type Global ; NameOfSpace Hregion_u_3D [Ustr] ; }
{ Name estr ; Type Local ; NameOfSpace Hregion_uStrInd_3D ; }
{ Name Istr_ind ; Type Global ; NameOfSpace Hregion_uStrInd_3D [Istr_ind] ; }
{ Name Ustr_ind ; Type Global ; NameOfSpace Hregion_uStrInd_3D [Ustr_ind] ; }
{ Name e0 ; Type Local ; NameOfSpace Hregion_u0_3D ; } //stranded conductor effective sigma computation
If(Flag_MagTherm==3)
{ Name T; Type Local; NameOfSpace Hgrad_T; }
EndIf
}
Equation {
If(Flag_MagTherm==3)
Galerkin { DtDof [ 1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[[{T}]])]) * Dof{a} , {a} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { [1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[[{T}]])]) * Dof{e} , {a} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { DtDof [ 1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[[{T}]])]) * Dof{a} , {e} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { [ 1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[[{T}]])]) * Dof{e} , {e} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { [ nu_nu0[Norm[{d a}], [{T}]] * Dof{d a} , {d a} ] ;
In Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
// Galerkin { [ - nu_nu0[Norm[{d a}], [{T}]] * br[] * Complex[ Vector[ orientx[], orienty[], orientz[]], Vector[ -Sign[direction[]]*orienty[], Sign[direction[]]*orientx[], orientz[]] ] , {d a} ]; In Region[{magnet_domain}];
// Jacobian JVol; Integration I1; }
If(bhNLFlag==1)
Galerkin { JacNL[ dhdb_NL[{d a}, [{T}] ] * Dof{d a} , {d a} ]; In Region[{NL_domain}];
Jacobian JVol; Integration I1; }
EndIf
Galerkin { DtDof[ sigma[[{T}]] * Dof{a} , {a} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ sigma[[{T}]] * Dof{e} , {a} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { DtDof[ sigma[[{T}]] * Dof{a} , {e} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ sigma[[{T}]] * Dof{e} , {e} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Else
Galerkin { DtDof [ 1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[])]) * Dof{a} , {a} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { [1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[])]) * Dof{e} , {a} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { DtDof [ 1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[])]) * Dof{a} , {e} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { [ 1.0/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[])]) * Dof{e} , {e} ]; In Region[{Sur_SIBC_B}];
Jacobian JSur; Integration I1; }
Galerkin { [ nu_nu0[Norm[{d a}]] * Dof{d a} , {d a} ] ;
In Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
// Galerkin { [ - nu_nu0[Norm[{d a}]] * br[] * Complex[ Vector[ orientx[], orienty[], orientz[]], Vector[ -Sign[direction[]]*orienty[], Sign[direction[]]*orientx[], orientz[]] ] , {d a} ]; In Region[{magnet_domain}];
// Jacobian JVol; Integration I1; }
If(bhNLFlag==1)
Galerkin { JacNL[ dhdb_NL[{d a} ] * Dof{d a} , {d a} ]; In Region[{NL_domain}];
Jacobian JVol; Integration I1; }
EndIf
Galerkin { DtDof[ sigma[] * Dof{a} , {a} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ sigma[] * Dof{e} , {a} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { DtDof[ sigma[] * Dof{a} , {e} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ sigma[] * Dof{e} , {e} ] ;
In Region[{conducting_domain, source_domain}] ; Jacobian JVol ; Integration I1 ; }
EndIf
// surface contact resistance
If (#Sur_RESISTANCE_B_List())
Galerkin { [ 1/resistance_electric[] * Dof{dInv eResistance} , {dInv eResistance} ] ;
In Region[{Sur_RESISTANCE_B}] ; Jacobian JSur ; Integration I1 ; }
EndIf
// This part is for calculation of stranded coil in 3D. e0 calculated in stranded_sigma_formulation
// is used to determine the effective sigma
Galerkin { [ Nc[]^(1-a_litz[]) * I_str[$Time]/cross_section_area[]/(Norm[{e0}])* {e0}, {a} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ -Nc[]^(1-a_litz[])*I_str[$Time]/cross_section_area[]/(Norm[{e0}])* {e0}, {e} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
If(Flag_MagTherm==3)
Galerkin { [ FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[[{T}]]/(2*nu_nu0[{d a}, [{T}]])]] *sigma[[{T}]]* Dof{e}, {e} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
// This part if for calculation of induced EMF (estr, and global variable Ustr_ind)
Galerkin { DtDof[ sigma[[{T}]] * Dof{a} , {estr} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ sigma[[{T}]]/(Nc[]^(1-a_litz[])) * Dof{estr} , {estr} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
Else
Galerkin { [ FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[]/(2*nu_nu0[])]] *sigma[]* Dof{e}, {e} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
// This part if for calculation of induced EMF (estr, and global variable Ustr_ind)
Galerkin { DtDof[ sigma[] * Dof{a} , {estr} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
Galerkin { [ sigma[]/(Nc[]^(1-a_litz[])) * Dof{estr} , {estr} ] ;
In Region[{stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
EndIf
GlobalTerm { [ - Dof{I}, {U} ] ; In Region[{Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH}]; }
Integral { [ 0 * Dof{ln} , {ln} ] ;
In Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; }
}
}
}