conspire/constitutive/fluid/plastic/
mod.rs

1//! Plastic fluid constitutive models.
2
3use crate::{
4    constitutive::ConstitutiveError,
5    math::{Scalar, TensorTuple, TensorTupleVec},
6    mechanics::DeformationGradientPlastic,
7};
8use std::fmt::Debug;
9
10/// Plastic state variables.
11pub type StateVariables = TensorTuple<DeformationGradientPlastic, Scalar>;
12
13/// Plastic state variables history.
14pub type StateVariablesHistory = TensorTupleVec<DeformationGradientPlastic, Scalar>;
15
16/// Required methods for plastic fluid constitutive models.
17pub trait Plastic
18where
19    Self: Clone + Debug,
20{
21    /// Returns the initial yield stress.
22    fn initial_yield_stress(&self) -> Scalar;
23    /// Returns the isotropic hardening slope.
24    fn hardening_slope(&self) -> Scalar;
25    /// Calculates and returns the yield stress.
26    ///
27    /// ```math
28    /// Y = Y_0 + H\,\varepsilon_\mathrm{p}
29    /// ```
30    fn yield_stress(&self, equivalent_plastic_strain: Scalar) -> Result<Scalar, ConstitutiveError> {
31        //
32        // Can eventually make a subdirectory with an enum (like LineaSearch) with different hardening models.
33        //
34        Ok(self.initial_yield_stress() + self.hardening_slope() * equivalent_plastic_strain)
35    }
36}