Solid Temperature Solver¶
The SolidTemperatureSolver configures the linear and nonlinear solution
strategy of the SolidTemperatureModel. For the underlying method, see
Linear Solvers and
Newton Form.
Access it with SolidTemperatureModel.get_solver().
Methods¶
set_verbose¶
Enable or disable verbose solver output.
Args:
- verbose: If
True, the solver prints additional information.
set_iteration_number¶
Set the maximum number of iterations of the linear solver. Default 500.
set_relative_tolerance¶
Set the relative tolerance of the linear solver. Default 1e-10.
set_absolute_tolerance¶
Set the absolute tolerance of the linear solver. Default 1e-12.
set_under_relaxation_factor¶
Set the under-relaxation factor (URF) \(\omega\) for the nonlinear iterations.
Default 1.0 (no under-relaxation).
Args:
- under_relaxation_factor: Value in \((0, 1]\). Smaller values add damping and can improve robustness for strongly nonlinear cases.
With RelaxationType.Aitken, this value is the factor of the first iteration
in each time step (see set_relaxation_type).
set_relaxation_type¶
solver.set_relaxation_type(relaxation_type: mufem.thermal.RelaxationType)
solver.get_relaxation_type() -> mufem.thermal.RelaxationType
Select how the solver calculates the relaxation factor \(\omega\) of the update
- \(T^{k}\) – temperature at iteration \(k\) [K]
- \(\delta^{k}\) – temperature correction from the linear solve at iteration \(k\) [K]
- \(\omega^{k}\) – relaxation factor at iteration \(k\) [–]
| Value | Description |
|---|---|
RelaxationType.Constant |
Default. Uses the fixed factor from
set_under_relaxation_factor in all iterations. |
RelaxationType.Aitken |
Calculates the factor again in each iteration from the last two corrections (Aitken dynamic relaxation). |
The Aitken \(\Delta^2\) method12 calculates
- \(\langle \cdot, \cdot \rangle\) – inner product over the full model domain
- \(\lVert \cdot \rVert_2\) – Euclidean norm over the full model domain
The solver limits \(\omega^{k}\) to the range \([0.1,\, 2.0]\). A value above 1
accelerates the iteration. A value below 1 damps it. If two consecutive
corrections are almost equal, the solver keeps the previous factor.
At the start of each time step, the solver deletes the relaxation history. The
first iteration of each time step uses the factor from
set_under_relaxation_factor. In a steady simulation, the solver does not
delete the history, and the first iteration uses \(\omega = 1\).
Use Aitken relaxation for segregated multiphysics couplings, where a fixed factor is either too slow or not stable. An example is induction heating, where the ohmic heat source and the temperature-dependent electric and magnetic properties change in each coupling iteration. Aitken relaxation is also available on the Time-Harmonic Magnetic solver.
set_linearization_type¶
solver.set_linearization_type(linearization_type: mufem.thermal.LinearizationType)
solver.get_linearization_type() -> mufem.thermal.LinearizationType
Select the linearization of the conduction term when the thermal conductivity depends on temperature, \(\kappa = \kappa(T)\). This applies to the Linear Temperature Coefficient and the Temperature Table methods. For a constant \(\kappa\), the setting has no effect.
When \(\kappa\) depends on \(T\), the derivative \(\kappa'(T) = \mathrm{d}\kappa/\mathrm{d}T\) [W/(m K²)] enters the linearization. For the linear temperature coefficient method, \(\kappa' = \alpha\). For the temperature table, \(\kappa'\) is the slope of the table, and zero outside the table range.
| Value | Description |
|---|---|
LinearizationType.Symmetric |
Default. Uses the symmetric part of the $\kappa'$ contribution. This option is more robust for a poor initial guess, but the convergence is not quadratic. |
LinearizationType.Unsymmetric |
Uses the full $\kappa'$ contribution (Newton method). This option gives quadratic convergence near the solution, but is less robust for a poor initial guess. |
Set the linearization type before you run the simulation.
Use this option for materials with a strong temperature dependence of \(\kappa\). Examples are refractories and insulators in furnaces, steel billets in induction heating, and ceramics in power electronics.
Note
In versions before 0.6.0, the solver did not include \(\kappa'\). Thus the number of nonlinear iterations and the residual history for temperature-dependent conductivity can be different from earlier versions.
set_frozen¶
Freeze the solver and model state (no updates during solves).
Args:
- is_frozen: If
True, the solver state is not updated during a solve.
Residual¶
The residual of the model is the relative norm of the temperature correction, \(\lVert \delta^{k} \rVert_2 / \lVert T^{k+1} \rVert_2\). See The reported residual.
Example¶
This example is from the TEAM 36 induction-heating benchmark. The thermal and the time-harmonic magnetic solvers both use Aitken relaxation:
thermal_solver = thermal_model.get_solver()
thermal_solver.set_under_relaxation_factor(0.7)
thermal_solver.set_relaxation_type(mufem.thermal.RelaxationType.Aitken)
To use the full Newton method for a temperature-dependent conductivity:
solver = model.get_solver()
solver.set_linearization_type(mufem.thermal.LinearizationType.Unsymmetric)
References¶
-
B. M. Irons and R. C. Tuck, A version of the Aitken accelerator for computer iteration, Int. J. Numer. Methods Eng., 1(3), 275–277 (1969). doi:10.1002/nme.1620010306. ↩
-
U. Küttler and W. A. Wall, Fixed-point fluid–structure interaction solvers with dynamic relaxation, Comput. Mech., 43(1), 61–72 (2008). doi:10.1007/s00466-008-0255-5. ↩