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 Vol_The ; Jacobian JVol ; Integration I1 ; } Galerkin { [ -ScalarField[XYZ[]]{0}, {T} ] ; In Vol_The ; Jacobian JVol ; Integration I1 ; } } } { Name getdpThermal_formulation ; Type FemEquation; Quantity { { Name T; Type Local; NameOfSpace Hgrad_T; } 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 * ((trefr[]+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; } } } } Formulation { { Name getdpEMGeneral2D_formulation; Type FemEquation; Quantity { { Name ln ; Type Local ; NameOfSpace airLinSpace; } { Name a ; Type Local ; NameOfSpace Hcurl_a_Mag_2D; } { Name ur; Type Local ; NameOfSpace Hregion_u_Mag_2D; } { Name I ; Type Global; NameOfSpace Hregion_u_Mag_2D [I]; } { Name U ; Type Global; NameOfSpace Hregion_u_Mag_2D [U]; } { Name istr ; Type Local ; NameOfSpace Hregion_i_Mag_2D ; } { Name Ustr ; Type Global ; NameOfSpace Hregion_i_Mag_2D [Ustr] ; } { Name Istr ; Type Global ; NameOfSpace Hregion_i_Mag_2D [Istr] ; } { Name Uz; Type Global; NameOfSpace Hregion_Circ [Uz]; } { Name Iz; Type Global; NameOfSpace Hregion_Circ [Iz]; } If(Flag_MagTherm==2) { Name T; Type Local; NameOfSpace Hgrad_T; } EndIf } Equation { If(Flag_MagTherm==2) Galerkin { [ nu_nu0[{d a}, [{T}]] * Dof{d a} , {d a} ]; In Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_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 { [ - nu_nu0[{d a}, [{T}]] * br[] * Complex[ Vector[ orientx[], orienty[], 0], Vector[ -Sign[direction[]]*orienty[], Sign[direction[]]*orientx[], 0] ] , {d a} ]; In Region[{magnet_domain}]; // Jacobian JVol; Integration I1; } Galerkin { DtDof [ sigma[[{T}]] * Dof{a} , {a} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } Galerkin { [ sigma[[{T}]] * Dof{ur} / GeomCoeff[] , {a} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } Galerkin { DtDof [ sigma[[{T}]] * Dof{a} , {ur} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } Galerkin { [ sigma[[{T}]] * Dof{ur} / GeomCoeff[] , {ur} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } 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 { [ Fs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[[{T}]]/(2*nu_nu0[])]] * Nc[]^(1-a_litz[])*Nc[]/(FillFactor[]*area[]^2*sigma[[{T}]]) * Dof{istr} , {istr} ] ; In Region[{stranded_source_domain}] ; Jacobian JVol; Integration I1; } Else Galerkin { [ nu_nu0[{d a}] * Dof{d a} , {d a} ]; In Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_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 { [ - nu_nu0[{d a}] * br[] * Complex[ Vector[ orientx[], orienty[], 0], Vector[ -Sign[direction[]]*orienty[], Sign[direction[]]*orientx[], 0] ] , {d a} ]; In Region[{magnet_domain}]; // Jacobian JVol; Integration I1; } Galerkin { DtDof [ sigma[] * Dof{a} , {a} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } Galerkin { [ sigma[] * Dof{ur} / GeomCoeff[] , {a} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } Galerkin { DtDof [ sigma[] * Dof{a} , {ur} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } Galerkin { [ sigma[] * Dof{ur} / GeomCoeff[] , {ur} ]; In Region[{conducting_domain, source_domain}]; Jacobian JVol; Integration I1; } 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 { [ Fs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[]/(2*nu_nu0[])]] * Nc[]^(1-a_litz[])*Nc[]/(FillFactor[]*area[]^2*sigma[]) * Dof{istr} , {istr} ] ; In Region[{stranded_source_domain}] ; Jacobian JVol; Integration I1; } EndIf Galerkin { [ - Nc[]^(1-a_litz[])/area[] * Dof{istr} , {a} ] ; In Region[{stranded_source_domain}] ; Jacobian JVol; Integration I1; } Galerkin { DtDof [ Nc[]/area[] * Dof{a} , {istr} ] ; In Region[{stranded_source_domain}] ; Jacobian JVol; Integration I1; } GlobalTerm { [ Dof{I} , {U} ]; In Region[{conducting_domain, source_domain}]; } GlobalTerm { [ Dof{Ustr}/GeomCoeff[] , {Istr} ] ; In Region[{stranded_source_domain}] ; } Integral { [ 0 * Dof{ln} , {ln} ] ; In Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_domain}] ; Jacobian JVol ; Integration I1 ; } GlobalTerm { [ 0 * Dof{Uz}, {Iz} ]; In circuit_domain; } GlobalTerm { [ 0 * Dof{Iz}, {Iz} ]; In circuit_domain; } GlobalEquation { Type Network; NameOfConstraint ElectricalCircuit; { Node {I}; Loop {U}; Equation {I}; In Region[{source_domain}]; } { Node {Istr}; Loop {Ustr}; Equation {Ustr}; In Region[{stranded_source_domain}]; } { Node {Iz}; Loop {Uz}; Equation {Uz}; In circuit_domain; } } } } }