Group { SurBottom = #1; SurTop = #2; VolSteel = #3; VolCopper = #4; Sur_Source = Region[{SurTop}] ; Vol_ElThe = Region[{VolSteel, VolCopper}] ; Sur_ElThe = Region[{SurTop, SurBottom}] ; Tot_ElThe = Region[{Vol_ElThe,Sur_ElThe}]; } Function { // Thermal conductivities [W/(m*K)] // They are in reality temperature dependent but for simplicity considered as constant here. k[ VolSteel ] = 50.0; k[ VolCopper] = 380.0; // Specific electrical resistivity at 25°C [Ohm*m] rho25[ VolSteel ] = 125e-9; rho25[ VolCopper ] = 17.5e-9; // Temperature coefficient for el. resistivity alpha[ VolSteel ] = 4.50e-3; alpha[ VolCopper ] = 3.95e-3; // Specific electrical conductivity [S/m] kappa[] = 1. / (rho25[] * (1. + alpha[] * ($1 - 25))); // Parameter: Temperature [°C] J[Sur_Source] = 100e6; // Applied current density [A/m^2] Tbottom = 25.0; // Temperature [°C] NbrMaxIter = 50; // Max number of iterations for iterative loop NL_Relax = 1.0; // Relaxation factor (multiplies the iterative correction dx) // Tolerances for iterative loop ReltolV = 1.0e-3; // Relative tolerance for the DOFs of SystemV AbstolV = 1.0e-6; // Absolute tolerance for the DOFs of SystemV ReltolT = 1.0e-3; // Relative tolerance for the DOFs of SystemT AbstolT = 1.0e-6; // Absolute tolerance for the DOFs of SystemT ReltolP = 1.0e-3; // Relative tolerance for the PostOperation result AbstolP = 1.0e-6; // Absolute tolerance for the PostOperation result // Dissipated energy [W/m^3] q[] = SquNorm[$1] * kappa[$2]; // Parameters: E field [V/m], Temperature [°C] } Constraint { { Name Constraint_T; Case { { Region SurBottom; Type Assign; Value Tbottom; } } } { Name Constraint_V; Case { { Region SurBottom; Type Assign; Value 0.0; } } } } Jacobian { { Name Jacob; Case { { Region Vol_ElThe ; Jacobian Vol ; } { Region Sur_ElThe ; Jacobian Sur ; } } } } Integration { { Name I1 ; Case { { Type Gauss ; Case { { GeoElement Point ; NumberOfPoints 1 ; } { GeoElement Line ; NumberOfPoints 3 ; } { GeoElement Triangle ; NumberOfPoints 4 ; } { GeoElement Quadrangle ; NumberOfPoints 4 ; } { GeoElement Tetrahedron ; NumberOfPoints 4 ; } { GeoElement Hexahedron ; NumberOfPoints 6 ; } { GeoElement Prism ; NumberOfPoints 6 ; } } } } } } FunctionSpace { { Name Hgrad_T; Type Form0; BasisFunction { { Name sn; NameOfCoef Tn; Function BF_Node; Support Tot_ElThe; Entity NodesOf[All]; } } Constraint { { NameOfCoef Tn; EntityType NodesOf ; NameOfConstraint Constraint_T; } } } { Name Hgrad_V; Type Form0; BasisFunction { { Name sn; NameOfCoef Vn; Function BF_Node; Support Tot_ElThe; Entity NodesOf[All]; } } Constraint { { NameOfCoef Vn; EntityType NodesOf ; NameOfConstraint Constraint_V; } } } } Formulation { { Name FormulationT; Type FemEquation; Quantity { { Name T; Type Local; NameOfSpace Hgrad_T; } { Name V; Type Local; NameOfSpace Hgrad_V; } } Equation { Galerkin { [ k[] * Dof{d T} , {d T} ]; In Vol_ElThe; Integration I1; Jacobian Jacob; } Galerkin { [ -q[{d V},{T}] , {T} ]; In Vol_ElThe; Integration I1; Jacobian Jacob; } } } { Name FormulationV; Type FemEquation; Quantity { { Name T; Type Local; NameOfSpace Hgrad_T; } { Name V; Type Local; NameOfSpace Hgrad_V; } } Equation { Galerkin { [ kappa[{T}] * Dof{d V} , {d V} ]; In Vol_ElThe; Integration I1; Jacobian Jacob; } Galerkin { [ -J[] , {V} ]; In Sur_Source; Integration I1; Jacobian Jacob; } } } } Resolution { { Name ElectroThermal; System { { Name SystemT; NameOfFormulation FormulationT; } { Name SystemV; NameOfFormulation FormulationV; } } Operation { InitSolution[SystemT]; InitSolution[SystemV]; IterativeLoopN[NbrMaxIter, NL_Relax, System { { SystemT, ReltolT, AbstolT, Solution LinfNorm } { SystemV, ReltolV, AbstolV, Solution MeanL2Norm } } PostOperation { { V_Top, ReltolP, AbstolP, MeanL1Norm } } ] { Generate[SystemV]; Solve[SystemV]; Generate[SystemT]; Solve[SystemT]; } SaveSolution[SystemV]; SaveSolution[SystemT]; } } } PostProcessing { { Name ElThe; NameOfFormulation FormulationT; Quantity { { Name T; Value{ Local{ [ {T} ] ; In Tot_ElThe; Jacobian Jacob;} } } { Name V; Value{ Local{ [ {V} ] ; In Tot_ElThe; Jacobian Jacob;} } } } } } PostOperation { { Name T; NameOfPostProcessing ElThe ; Operation { Print[ T, OnElementsOf Vol_ElThe , File "Result_T.pos"]; } } { Name V; NameOfPostProcessing ElThe ; Operation { Print[ V, OnElementsOf Vol_ElThe , File "Result_V.pos"]; } } { Name V_Top; NameOfPostProcessing ElThe ; Operation { Print[ V, OnElementsOf SurTop , File "Result_V_Top.pos"]; } } }