Skip to main content

EnthalpyMethod

Struct EnthalpyMethod 

Source
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: f64

Density [kg/m³].

§cp: f64

Specific heat capacity [J/(kg·K)].

§latent_heat: f64

Latent heat of fusion L [J/kg].

§t_solidus: f64

Solidus temperature T_s [K].

§t_liquidus: f64

Liquidus temperature T_l [K].

§temperature: f64

Current temperature [K].

§enthalpy: f64

Current enthalpy [J/m³].

Implementations§

Source§

impl EnthalpyMethod

Source

pub fn new( rho: f64, cp: f64, latent_heat: f64, t_solidus: f64, t_liquidus: f64, ) -> Self

Create a new enthalpy method model.

Source

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

Liquid fraction as a linear function of temperature in mushy zone.

Source

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

Total enthalpy H(T) [J/m³].

Source

pub fn temperature_from_enthalpy(&self, h: f64) -> f64

Invert enthalpy to temperature (Newton-Raphson, max 50 iterations).

Source

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

Effective (apparent) specific heat cp_eff [J/(kg·K)] including latent heat.

Source

pub fn apply_heat_flux(&mut self, q: f64, dt: f64)

Apply a heat flux q [W/m³] over time step dt [s].

Source

pub fn is_mushy(&self) -> bool

Check if material is currently in the mushy zone.

Trait Implementations§

Source§

impl Clone for EnthalpyMethod

Source§

fn clone(&self) -> EnthalpyMethod

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnthalpyMethod

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.