WARPXM v1.10.0
|
Functions related to temperature and pressure used across many MHD apps. More...
#include "apps/mhd/imhd/imhd.h"
Go to the source code of this file.
Functions related to temperature and pressure used across many MHD apps.
Functions | |
real | get_p (real gas_gamma, real rho, real E, real V2, real B2) |
Calculate pressure from MHD total energy. | |
real | get_E (real gas_gamma, real rho, real p, real V2, real B2) |
Calculate MHD total energy density. | |
void | calculate_grad_pressure (const real *q, const real *aux, real *grad_pressure, const real gas_gamma, const real rho_min=std::numeric_limits< real >::epsilon()) |
real | get_temperature (real p, real rho, real Ai, real Zi) |
void | calculate_grad_T (const real *q, const real *aux, real *grad_T, const real gas_gamma, const real Ai=1.0, const real Zi=1.0, const real rho_min=std::numeric_limits< real >::epsilon(), const real press_min=std::numeric_limits< real >::epsilon()) |
void | ensure_floor_density (const real *q, real num_q, real density_floor, real *mod_q) |
void | ensure_floor_pressure (const real *q, real num_q, real gas_gamma, real pressure_floor, real *mod_q) |
real | getRhoFloored (const real *q, const real rho_min=std::numeric_limits< real >::epsilon()) |
Get the floored mass density. | |
real | getPressureFloored (const real *q, const real gas_gamma, const real rho_min=std::numeric_limits< real >::epsilon(), const real press_min=std::numeric_limits< real >::epsilon()) |
Get the pressure from MHD variables using floors for pressure and density. | |
real | getTemperatureFloored (const real *q, const real gas_gamma, const real Ai=1.0, const real Zi=1.0, const real rho_min=std::numeric_limits< real >::epsilon(), const real press_min=std::numeric_limits< real >::epsilon()) |
Get the temperature from MHD variables using floors for pressure and density. | |
void calculate_grad_pressure | ( | const real * | q, |
const real * | aux, | ||
real * | grad_pressure, | ||
const real | gas_gamma, | ||
const real | rho_min = std::numeric_limits< real >::epsilon() |
||
) |
void calculate_grad_T | ( | const real * | q, |
const real * | aux, | ||
real * | grad_T, | ||
const real | gas_gamma, | ||
const real | Ai = 1.0 , |
||
const real | Zi = 1.0 , |
||
const real | rho_min = std::numeric_limits< real >::epsilon() , |
||
const real | press_min = std::numeric_limits< real >::epsilon() |
||
) |
void ensure_floor_pressure | ( | const real * | q, |
real | num_q, | ||
real | gas_gamma, | ||
real | pressure_floor, | ||
real * | mod_q | ||
) |
Calculate MHD total energy density.
\[ e = \frac{p}{\gamma - 1} + \frac{1}{2} \rho v^2 + \frac{1}{2} B^2 \]
gas_gamma | Ratio of specfic heats. |
rho | Normalized mass density. |
p | Normalized pressure. |
V2 | Normalized velocity squared. |
B2 | Normalized magnetic field squared. |
Calculate pressure from MHD total energy.
\[ p = (\gamma - 1) \left( e - \frac{1}{2} \rho v^2 - \frac{1}{2} B^2 \right) \]
gas_gamma | Ratio of specfic heats. |
rho | Normalized mass density. |
E | MHD total energy density \(e = \frac{p}{\gamma - 1} + \frac{1}{2} \rho v^2 + \frac{1}{2} B^2 \). |
V2 | Normalized velocity squared. |
B2 | Normalized magnetic field squared. |
real getPressureFloored | ( | const real * | q, |
const real | gas_gamma, | ||
const real | rho_min = std::numeric_limits< real >::epsilon() , |
||
const real | press_min = std::numeric_limits< real >::epsilon() |
||
) |
Get the pressure from MHD variables using floors for pressure and density.
The floored pressure is given as
\[ p_{fl} = \max(p, p_{min}), \]
where
\[ p = (\gamma - 1) \left( e - \frac{1}{2} \max(\rho, \rho_{min}) v^2 - \frac{1}{2} B^2 \right) \]
Assumes \( \rho_{min}, \; p_{min} > 0 \).
q | The raw MHD variables. |
gas_gamma | Ratio of specific heats. |
rho_min | Normalized minimum mass density. |
press_min | Normalized minimum mass density. |
Get the floored mass density.
The floored mass density is given as
\[ \rho_{fl} = \max(\rho, \rho_{min}), \]
Assumes \( \rho_{min} > 0 \).
q | The raw MHD variables. |
rho_min | Normalized minimum mass density. |
real getTemperatureFloored | ( | const real * | q, |
const real | gas_gamma, | ||
const real | Ai = 1.0 , |
||
const real | Zi = 1.0 , |
||
const real | rho_min = std::numeric_limits< real >::epsilon() , |
||
const real | press_min = std::numeric_limits< real >::epsilon() |
||
) |
Get the temperature from MHD variables using floors for pressure and density.
Temperature is calculated assuming:
Therefore
\[ T = \frac{p_{fl}}{\rho_{fl}} \frac{ A_i } {(1 + Z_i)} \]
where
\[ p_{fl} = \max(p, p_{min}), \quad \text{and} \quad \rho_{fl} = \max(\rho, \rho_{min}). \]
Assumes \( \rho_{min}, \; p_{min} > 0 \).
q | The raw MHD variables. |
gas_gamma | Ratio of specific heats. |
Ai | Proton normalized ion mass. |
Zi | Ion charge. |
rho_min | Normalized minimum mass density. |
press_min | Normalized minimum mass density. |