pub struct EnthalpyMethod {
pub rho: f64,
pub cp: f64,
pub latent_heat: f64,
pub t_solidus: f64,
pub t_liquidus: f64,
pub temperature: f64,
pub enthalpy: f64,
}Expand description
Enthalpy method for melting and solidification problems.
The total enthalpy H at temperature T includes sensible and latent heat:
H(T) = ρ·cp·T + ρ·L·f_l(T)
where f_l is the liquid fraction. The temperature-update is performed by inverting H(T) given the updated enthalpy.
Fields§
§rho: f64Density [kg/m³].
cp: f64Specific heat capacity [J/(kg·K)].
latent_heat: f64Latent heat of fusion L [J/kg].
t_solidus: f64Solidus temperature T_s [K].
t_liquidus: f64Liquidus temperature T_l [K].
temperature: f64Current temperature [K].
enthalpy: f64Current enthalpy [J/m³].
Implementations§
Source§impl EnthalpyMethod
impl EnthalpyMethod
Sourcepub fn new(
rho: f64,
cp: f64,
latent_heat: f64,
t_solidus: f64,
t_liquidus: f64,
) -> Self
pub fn new( rho: f64, cp: f64, latent_heat: f64, t_solidus: f64, t_liquidus: f64, ) -> Self
Create a new enthalpy method model.
Sourcepub fn liquid_fraction(&self, temp: f64) -> f64
pub fn liquid_fraction(&self, temp: f64) -> f64
Liquid fraction as a linear function of temperature in mushy zone.
Sourcepub fn enthalpy_at(&self, temp: f64) -> f64
pub fn enthalpy_at(&self, temp: f64) -> f64
Total enthalpy H(T) [J/m³].
Sourcepub fn temperature_from_enthalpy(&self, h: f64) -> f64
pub fn temperature_from_enthalpy(&self, h: f64) -> f64
Invert enthalpy to temperature (Newton-Raphson, max 50 iterations).
Sourcepub fn effective_cp(&self, temp: f64) -> f64
pub fn effective_cp(&self, temp: f64) -> f64
Effective (apparent) specific heat cp_eff [J/(kg·K)] including latent heat.
Sourcepub fn apply_heat_flux(&mut self, q: f64, dt: f64)
pub fn apply_heat_flux(&mut self, q: f64, dt: f64)
Apply a heat flux q [W/m³] over time step dt [s].
Trait Implementations§
Source§impl Clone for EnthalpyMethod
impl Clone for EnthalpyMethod
Source§fn clone(&self) -> EnthalpyMethod
fn clone(&self) -> EnthalpyMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more