Skip to main content

conspire/constitutive/fluid/plastic/
mod.rs

1//! Plastic fluid constitutive models.
2
3use crate::units::Stress;
4use crate::{constitutive::ConstitutiveError, math::Quantity};
5use std::fmt::Debug;
6
7/// Required methods for plastic fluid constitutive models.
8pub trait Plastic
9where
10    Self: Clone + Debug,
11{
12    /// Returns the initial yield stress.
13    fn initial_yield_stress(&self) -> Quantity<Stress>;
14    /// Returns the isotropic hardening slope.
15    fn hardening_slope(&self) -> Quantity<Stress>;
16    /// Calculates and returns the yield stress.
17    ///
18    /// ```math
19    /// Y = Y_0 + H\,\varepsilon_\mathrm{p}
20    /// ```
21    fn yield_stress(
22        &self,
23        equivalent_plastic_strain: Quantity,
24    ) -> Result<Quantity<Stress>, ConstitutiveError> {
25        Ok(self.initial_yield_stress() + self.hardening_slope() * equivalent_plastic_strain)
26    }
27}