17 : m_pressure(std::move(pressure)), m_backing(std::move(backing))
21 throw std::invalid_argument(
22 "PrescribedPressureThermo: pressure function is empty.");
38 double &p_electron)
const
40 p_heavy = m_pressure(r, t);
44 if (!std::isfinite(p_heavy))
46 throw std::runtime_error(
47 "PrescribedPressureThermo::pressures: the prescribed pressure at "
49 std::to_string(r) +
" m, t = " + std::to_string(t) +
" s is " +
50 std::to_string(p_heavy) +
" Pa, which is not finite.");
61 const double *Y)
const
63 return m_backing.soundSpeed(r, t, rho, Tg, Te, Y);
68 return m_backing.heavyEnergy(Tg, Y);
73 return m_backing.electronCv();
80 const double *Y)
const
82 return m_backing.densityFromPressure(pressure, Tg, Te, Y);
88 double heavy_internal_energy_target,
91 return m_backing.heavyTemperature(rho, Y, heavy_internal_energy_target, Tg_seed);
TEST-ONLY ThermoAccessor holding the pressure to a prescribed field p(r, t) and delegating every othe...
Calorically perfect ideal-gas accessor: one constant for the heavy pool, ElectronGamma for the elect...
std::function< double(double r, double t)> PressureFn
Total prescribed pressure as a function of radius [m] and time [s], returning [Pa].
double heavyTemperature(double rho, const double *Y, double heavy_internal_energy_target, double Tg_seed) const override
Invert for at fixed density and composition (NUMERICS.md section 8).
double densityFromPressure(double pressure, double Tg, double Te, const double *Y) const override
Density reproducing a target total pressure at a given temperature pair and composition – the inverse...
double electronCv() const override
Electron specific heat at constant volume, per kg of ELECTRONS, .
void pressures(double r, double t, double rho, double Tg, double Te, const double *Y, double &p_heavy, double &p_electron) const override
Per-pool partial pressures, PHYSICS.md equation (G6).
double heavyEnergy(double Tg, const double *Y) const override
Heavy-pool internal energy per kg of MIXTURE, – the basis that makes the conserved variable of equa...
PrescribedPressureThermo(PressureFn pressure, GammaLawThermo backing)
double soundSpeed(double r, double t, double rho, double Tg, double Te, const double *Y) const override
Sound speed, PHYSICS.md appendix A.4: the frozen two-pool speed , each pool following its own adiaba...