conspire/constitutive/solid/thermoelastic/almansi_hamel/
mod.rs

1#[cfg(test)]
2mod test;
3
4use super::*;
5
6/// The Almansi-Hamel thermoelastic constitutive model.
7///
8/// **Parameters**
9/// - The bulk modulus $`\kappa`$.
10/// - The shear modulus $`\mu`$.
11/// - The coefficient of thermal expansion $`\alpha`$.
12/// - The reference temperature $`T_\mathrm{ref}`$.
13///
14/// **External variables**
15/// - The deformation gradient $`\mathbf{F}`$.
16/// - The temperature $`T`$.
17///
18/// **Internal variables**
19/// - None.
20///
21/// **Notes**
22/// - The Almansi-Hamel strain measure is given by $`\mathbf{e}=\tfrac{1}{2}(\mathbf{1}-\mathbf{B}^{-1})`$.
23#[derive(Debug)]
24pub struct AlmansiHamel<P> {
25    parameters: P,
26}
27
28impl<P> Constitutive<P> for AlmansiHamel<P>
29where
30    P: Parameters,
31{
32    fn new(parameters: P) -> Self {
33        Self { parameters }
34    }
35}
36
37impl<P> Solid for AlmansiHamel<P>
38where
39    P: Parameters,
40{
41    fn bulk_modulus(&self) -> &Scalar {
42        self.parameters.get(0)
43    }
44    fn shear_modulus(&self) -> &Scalar {
45        self.parameters.get(1)
46    }
47}
48
49impl<P> Thermoelastic for AlmansiHamel<P>
50where
51    P: Parameters,
52{
53    /// Calculates and returns the Cauchy stress.
54    ///
55    /// ```math
56    /// \boldsymbol{\sigma}(\mathbf{F}, T) = \frac{2\mu}{J}\,\mathbf{e}' + \frac{\kappa}{J}\,\mathrm{tr}(\mathbf{e})\mathbf{1} - \frac{3\alpha\kappa}{J}(T - T_\mathrm{ref})\mathbf{1}
57    /// ```
58    fn cauchy_stress(
59        &self,
60        deformation_gradient: &DeformationGradient,
61        temperature: &Scalar,
62    ) -> Result<CauchyStress, ConstitutiveError> {
63        let jacobian = self.jacobian(deformation_gradient)?;
64        let inverse_deformation_gradient = deformation_gradient.inverse();
65        let strain = (IDENTITY
66            - inverse_deformation_gradient.transpose() * &inverse_deformation_gradient)
67            * 0.5;
68        let (deviatoric_strain, strain_trace) = strain.deviatoric_and_trace();
69        Ok(deviatoric_strain * (2.0 * self.shear_modulus() / jacobian)
70            + IDENTITY
71                * (self.bulk_modulus() / jacobian
72                    * (strain_trace
73                        - 3.0
74                            * self.coefficient_of_thermal_expansion()
75                            * (temperature - self.reference_temperature()))))
76    }
77    /// Calculates and returns the tangent stiffness associated with the Cauchy stress.
78    ///
79    /// ```math
80    /// \mathcal{T}_{ijkL}(\mathbf{F}, T) = \frac{\mu}{J}\left[B_{jk}^{-1}F_{iL}^{-T} + B_{ik}^{-1}F_{jL}^{-T} - \frac{2}{3}\,\delta_{ij}B_{km}^{-1}F_{mL}^{-T} - 2e_{ij}'F_{kL}^{-T}\right] + \frac{\kappa}{J}\left\{\delta_{ij}B_{km}^{-1}F_{mL}^{-T} - \Big[\mathrm{tr}(\mathbf{e}) - 3\alpha(T - T_\mathrm{ref})\Big]\delta_{ij}F_{kL}^{-T}\right\}
81    /// ```
82    fn cauchy_tangent_stiffness(
83        &self,
84        deformation_gradient: &DeformationGradient,
85        temperature: &Scalar,
86    ) -> Result<CauchyTangentStiffness, ConstitutiveError> {
87        let jacobian = self.jacobian(deformation_gradient)?;
88        let inverse_transpose_deformation_gradient = deformation_gradient.inverse_transpose();
89        let inverse_left_cauchy_green_deformation = &inverse_transpose_deformation_gradient
90            * inverse_transpose_deformation_gradient.transpose();
91        let strain = (IDENTITY - &inverse_left_cauchy_green_deformation) * 0.5;
92        let (deviatoric_strain, strain_trace) = strain.deviatoric_and_trace();
93        Ok((CauchyTangentStiffness::dyad_il_jk(
94            &inverse_transpose_deformation_gradient,
95            &inverse_left_cauchy_green_deformation,
96        ) + CauchyTangentStiffness::dyad_ik_jl(
97            &inverse_left_cauchy_green_deformation,
98            &inverse_transpose_deformation_gradient,
99        )) * (self.shear_modulus() / jacobian)
100            + CauchyTangentStiffness::dyad_ij_kl(
101                &IDENTITY,
102                &(inverse_left_cauchy_green_deformation
103                    * &inverse_transpose_deformation_gradient
104                    * ((self.bulk_modulus() - self.shear_modulus() * TWO_THIRDS) / jacobian)),
105            )
106            - CauchyTangentStiffness::dyad_ij_kl(
107                &(deviatoric_strain * (2.0 * self.shear_modulus() / jacobian)
108                    + IDENTITY
109                        * (self.bulk_modulus() / jacobian
110                            * (strain_trace
111                                - 3.0
112                                    * self.coefficient_of_thermal_expansion()
113                                    * (temperature - self.reference_temperature())))),
114                &inverse_transpose_deformation_gradient,
115            ))
116    }
117    fn coefficient_of_thermal_expansion(&self) -> &Scalar {
118        self.parameters.get(2)
119    }
120    fn reference_temperature(&self) -> &Scalar {
121        self.parameters.get(3)
122    }
123}