conspire/constitutive/solid/thermoelastic/almansi_hamel/
mod.rs1#[cfg(test)]
2mod test;
3
4use super::*;
5
6#[derive(Debug)]
24pub struct AlmansiHamel {
25 pub bulk_modulus: Scalar,
27 pub shear_modulus: Scalar,
29 pub coefficient_of_thermal_expansion: Scalar,
31 pub reference_temperature: Scalar,
33}
34
35impl Solid for AlmansiHamel {
36 fn bulk_modulus(&self) -> &Scalar {
37 &self.bulk_modulus
38 }
39 fn shear_modulus(&self) -> &Scalar {
40 &self.shear_modulus
41 }
42}
43
44impl Thermoelastic for AlmansiHamel {
45 fn cauchy_stress(
51 &self,
52 deformation_gradient: &DeformationGradient,
53 temperature: &Scalar,
54 ) -> Result<CauchyStress, ConstitutiveError> {
55 let jacobian = self.jacobian(deformation_gradient)?;
56 let inverse_deformation_gradient = deformation_gradient.inverse();
57 let strain = (IDENTITY
58 - inverse_deformation_gradient.transpose() * &inverse_deformation_gradient)
59 * 0.5;
60 let (deviatoric_strain, strain_trace) = strain.deviatoric_and_trace();
61 Ok(deviatoric_strain * (2.0 * self.shear_modulus() / jacobian)
62 + IDENTITY
63 * (self.bulk_modulus() / jacobian
64 * (strain_trace
65 - 3.0
66 * self.coefficient_of_thermal_expansion()
67 * (temperature - self.reference_temperature()))))
68 }
69 fn cauchy_tangent_stiffness(
75 &self,
76 deformation_gradient: &DeformationGradient,
77 temperature: &Scalar,
78 ) -> Result<CauchyTangentStiffness, ConstitutiveError> {
79 let jacobian = self.jacobian(deformation_gradient)?;
80 let inverse_transpose_deformation_gradient = deformation_gradient.inverse_transpose();
81 let inverse_left_cauchy_green_deformation = &inverse_transpose_deformation_gradient
82 * inverse_transpose_deformation_gradient.transpose();
83 let strain = (IDENTITY - &inverse_left_cauchy_green_deformation) * 0.5;
84 let (deviatoric_strain, strain_trace) = strain.deviatoric_and_trace();
85 Ok((CauchyTangentStiffness::dyad_il_jk(
86 &inverse_transpose_deformation_gradient,
87 &inverse_left_cauchy_green_deformation,
88 ) + CauchyTangentStiffness::dyad_ik_jl(
89 &inverse_left_cauchy_green_deformation,
90 &inverse_transpose_deformation_gradient,
91 )) * (self.shear_modulus() / jacobian)
92 + CauchyTangentStiffness::dyad_ij_kl(
93 &IDENTITY,
94 &(inverse_left_cauchy_green_deformation
95 * &inverse_transpose_deformation_gradient
96 * ((self.bulk_modulus() - self.shear_modulus() * TWO_THIRDS) / jacobian)),
97 )
98 - CauchyTangentStiffness::dyad_ij_kl(
99 &(deviatoric_strain * (2.0 * self.shear_modulus() / jacobian)
100 + IDENTITY
101 * (self.bulk_modulus() / jacobian
102 * (strain_trace
103 - 3.0
104 * self.coefficient_of_thermal_expansion()
105 * (temperature - self.reference_temperature())))),
106 &inverse_transpose_deformation_gradient,
107 ))
108 }
109 fn coefficient_of_thermal_expansion(&self) -> &Scalar {
110 &self.coefficient_of_thermal_expansion
111 }
112 fn reference_temperature(&self) -> &Scalar {
113 &self.reference_temperature
114 }
115}