Thermal Conduction
Quokka solves explicit, flux-limited thermal conduction as a Strang-split source term on the gas internal energy. The conductivity model (constant or Spitzer) and the geometry (isotropic or field-aligned) are selected at compile time in the problem’s Physics_Traits. Conduction is then switched on at runtime with conduction.enabled = 1.
Choosing a model and geometry
template <> struct Physics_Traits<MyProblem> : DefaultPhysicsTraits {
static constexpr bool is_hydro_enabled = true;
static constexpr ConductionModel conduction_model = ConductionModel::spitzer;
static constexpr ConductionGeometry conduction_geometry = ConductionGeometry::isotropic;
};
conduction_model | Conductivity \(\kappa\) | Set by |
|---|---|---|
none (default) | no conduction | — |
constant | \(\kappa = \kappa_0\) | conduction.* prefactors in the input file |
spitzer | \(\kappa = \kappa_0 T^{5/2}\) | conduction.* prefactors in the input file |
problem_defined | \(\kappa(\rho, T)\) | computeConductivity in the problem file |
conduction_geometry | Heat flux | Solver |
|---|---|---|
isotropic (default) | \(\mathbf{q} = -\kappa \nabla T\) | IsoConduction |
anisotropic | see below | AnisoConduction (Sharma & Hammett 2007); requires is_mhd_enabled = true |
In the anisotropic geometry, heat flows along the unit magnetic-field vector \(\hat{\mathbf{b}} = \mathbf{B}/|\mathbf{B}|\) with conductivity \(\kappa_\parallel\), and across it with \(\kappa_\perp\):
Setting \(\kappa_\perp = \kappa_\parallel\) recovers the isotropic flux. In both geometries, each face-normal component \(q\) of the classical flux is then saturated (Cowie & McKee 1977):
where \(f_{\rm sat}\) is conduction.saturation_factor, \(\phi\) is conduction.flux_limiter_phi, and \(c_s\) is the sound speed.
Units
Conductivities are always given as a full conductivity \(\kappa\), in erg cm\(^{-1}\) s\(^{-1}\) K\(^{-1}\), in both geometries. For spitzer, the prefactor \(\kappa_0\) is in erg cm\(^{-1}\) s\(^{-1}\) K\(^{-7/2}\). With a non-CGS unit_system, use the corresponding code units.
Internally, both solvers obtain \(\kappa\) through quokka::conduction::EvaluateConductivity (src/conduction/conductivity.hpp). In the notation of Sharma & Hammett (2007), whose flux is \(\mathbf{q} = -n k_B \chi \nabla T\), \(\kappa = n k_B \chi\); the solvers only ever need this product, so the diffusivity \(\chi\) is never formed.
Problem-defined conductivity
With ConductionModel::problem_defined, specialize computeConductivity in the problem file. It returns \(\{\kappa_\parallel, \kappa_\perp\}\); in the isotropic geometry only the first component is used. This path is currently tested by ThermalConductionSpitzerGaussian.
template <>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto computeConductivity<MyProblem>(amrex::Real rho, amrex::Real Tgas)
-> quokka::valarray<amrex::Real, 2>
{
return {kappa0 * std::pow(Tgas, 2.5), 0.0};
}
The function runs on the GPU, so it must not use host-only data; use constexpr constants for any parameters. Both returned conductivities must be non-negative, and in the anisotropic geometry \(\kappa_\perp \le \kappa_\parallel\), because the anisotropic solver’s L2 limiter relies on \((\kappa_\parallel - \kappa_\perp) \hat{b}_n^2 \ge 0\) (checked by an assertion in debug builds). If a problem selects problem_defined without specializing computeConductivity, it fails to compile.
The solvers evaluate \(\kappa\) at face centres (isotropic, from the face-averaged \(\rho\) and \(T\)) or at cell corners (anisotropic, from the average of the adjacent cells).
Input parameters
The constant and spitzer models read their prefactor from the key that matches the geometry:
| Geometry | Keys |
|---|---|
isotropic | conduction.conductivity_prefactor (required when conduction is enabled) |
anisotropic | conduction.kappaPar (required when conduction is enabled), conduction.kappaPerp (optional, default 0) |
With the anisotropic geometry, conduction.aniso_flux_limiter selects the limiter for the transverse (cross) terms of the flux, mc (default) or minmod, for any conduction_model.
With conduction.enabled = 1, Quokka aborts at startup in these cases:
- a prefactor is set that does not match the geometry, or any prefactor is set with
problem_defined; conduction.aniso_flux_limiteris set with the isotropic geometry, or is notmcorminmod;- a prefactor is negative, or
conduction.kappaPerpis larger thanconduction.kappaPar; - the problem’s
conduction_modelisnone.
With conduction.enabled = 0, the prefactor and limiter keys are ignored. Quokka always aborts if conduction.enabled is not 0 or 1, or if the input file still sets the removed conduction.conduction_type key.
See Runtime parameters for the full list of conduction.* parameters.
Timestep
The explicit conduction timestep is the minimum over all cells of
where \(C\) is conduction.conduction_cfl, \(e\) is the internal energy per unit volume, and \(D\) is evaluated with each cell’s own \(\rho\) and \(T\).
Test problems
| Problem | Model | Geometry |
|---|---|---|
ThermalConductionConstantAMR | constant | isotropic |
ThermalConductionPattle | spitzer | isotropic |
ThermalConductionSpitzerGaussian | problem_defined (Spitzer) | isotropic |
ThermalConductionAniso | constant | anisotropic |
ThermalConductionAnisoGaussian | constant (with \(\kappa_\perp > 0\)) | anisotropic |
ThermalConductionAnisoPattle | spitzer | anisotropic |
The anisotropic test problems are built only when AMReX_SPACEDIM = 3.