Skip to main content

PhaseChangeModel

Struct PhaseChangeModel 

Source
pub struct PhaseChangeModel {
    pub t_liquidus: f64,
    pub t_solidus: f64,
    pub latent_heat: f64,
    pub cp_solid: f64,
    pub cp_liquid: f64,
    pub density: f64,
}
Expand description

Phase change (melting/solidification) model with latent heat.

Implements the enthalpy method for solving phase change problems. The apparent heat capacity is increased in the mushy zone to account for the latent heat release/absorption.

Fields§

§t_liquidus: f64

Liquidus temperature (melting point or end of mushy zone) [K].

§t_solidus: f64

Solidus temperature (start of mushy zone) [K].

§latent_heat: f64

Latent heat of fusion L [J/kg].

§cp_solid: f64

Solid-phase specific heat [J/(kg·K)].

§cp_liquid: f64

Liquid-phase specific heat [J/(kg·K)].

§density: f64

Material density [kg/m³].

Implementations§

Source§

impl PhaseChangeModel

Source

pub fn new( t_solidus: f64, t_liquidus: f64, latent_heat: f64, cp_solid: f64, cp_liquid: f64, density: f64, ) -> Self

Create a new phase change model.

Source

pub fn liquid_fraction(&self, temp: f64) -> f64

Liquid fraction at temperature T (linear in mushy zone).

Source

pub fn apparent_specific_heat(&self, temp: f64) -> f64

Apparent (effective) specific heat in the enthalpy method [J/(kg·K)].

In the mushy zone, cp_eff = cp + L/(T_liq - T_sol).

Source

pub fn enthalpy(&self, temp: f64) -> f64

Specific enthalpy h(T) relative to T = 0.

Source

pub fn conductivity(&self, k_solid: f64, k_liquid: f64, temp: f64) -> f64

Thermal conductivity (interpolated between solid and liquid).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.