conspire/constitutive/solid/thermoelastic/
mod.rs1#![doc = include_str!("doc.md")]
6
7#[cfg(feature = "doc")]
8pub mod doc;
9
10#[cfg(test)]
11pub mod test;
12
13use super::*;
14use crate::{
15 math::Quantity,
16 units::{ReciprocalTemperature, Temperature},
17};
18
19mod almansi_hamel;
20
21pub use almansi_hamel::AlmansiHamel;
22
23pub trait Thermoelastic
25where
26 Self: Solid,
27{
28 fn cauchy_stress(
34 &self,
35 deformation_gradient: &DeformationGradient,
36 temperature: Quantity<Temperature>,
37 ) -> Result<CauchyStress, ConstitutiveError> {
38 Ok(deformation_gradient
39 * self.second_piola_kirchhoff_stress(deformation_gradient, temperature)?
40 * deformation_gradient.transpose()
41 / deformation_gradient.determinant())
42 }
43 fn cauchy_tangent_stiffness(
49 &self,
50 deformation_gradient: &DeformationGradient,
51 temperature: Quantity<Temperature>,
52 ) -> Result<CauchyTangentStiffness, ConstitutiveError> {
53 let deformation_gradient_inverse_transpose = deformation_gradient.inverse_transpose();
54 let cauchy_stress = self.cauchy_stress(deformation_gradient, temperature)?;
55 let some_stress = &cauchy_stress * &deformation_gradient_inverse_transpose;
56 Ok(self
57 .second_piola_kirchhoff_tangent_stiffness(deformation_gradient, temperature)?
58 .contract_first_second_with_second(deformation_gradient, deformation_gradient)
59 / deformation_gradient.determinant()
60 - CauchyTangentStiffness::dyad_ij_kl(
61 &cauchy_stress,
62 &deformation_gradient_inverse_transpose,
63 )
64 + CauchyTangentStiffness::dyad_il_kj(&some_stress, &IDENTITY)
65 + CauchyTangentStiffness::dyad_ik_jl(&IDENTITY, &some_stress))
66 }
67 fn first_piola_kirchhoff_stress(
73 &self,
74 deformation_gradient: &DeformationGradient,
75 temperature: Quantity<Temperature>,
76 ) -> Result<FirstPiolaKirchhoffStress, ConstitutiveError> {
77 Ok(self.cauchy_stress(deformation_gradient, temperature)?
78 * deformation_gradient.inverse_transpose()
79 * deformation_gradient.determinant())
80 }
81 fn first_piola_kirchhoff_tangent_stiffness(
87 &self,
88 deformation_gradient: &DeformationGradient,
89 temperature: Quantity<Temperature>,
90 ) -> Result<FirstPiolaKirchhoffTangentStiffness, ConstitutiveError> {
91 let deformation_gradient_inverse_transpose = deformation_gradient.inverse_transpose();
92 let first_piola_kirchhoff_stress =
93 self.first_piola_kirchhoff_stress(deformation_gradient, temperature)?;
94 Ok(self
95 .cauchy_tangent_stiffness(deformation_gradient, temperature)?
96 .contract_second_with_first(&deformation_gradient_inverse_transpose)
97 * deformation_gradient.determinant()
98 + FirstPiolaKirchhoffTangentStiffness::dyad_ij_kl(
99 &first_piola_kirchhoff_stress,
100 &deformation_gradient_inverse_transpose,
101 )
102 - FirstPiolaKirchhoffTangentStiffness::dyad_il_kj(
103 &first_piola_kirchhoff_stress,
104 &deformation_gradient_inverse_transpose,
105 ))
106 }
107 fn second_piola_kirchhoff_stress(
113 &self,
114 deformation_gradient: &DeformationGradient,
115 temperature: Quantity<Temperature>,
116 ) -> Result<SecondPiolaKirchhoffStress, ConstitutiveError> {
117 Ok(deformation_gradient.inverse()
118 * self.cauchy_stress(deformation_gradient, temperature)?
119 * deformation_gradient.inverse_transpose()
120 * deformation_gradient.determinant())
121 }
122 fn second_piola_kirchhoff_tangent_stiffness(
128 &self,
129 deformation_gradient: &DeformationGradient,
130 temperature: Quantity<Temperature>,
131 ) -> Result<SecondPiolaKirchhoffTangentStiffness, ConstitutiveError> {
132 let deformation_gradient_inverse_transpose = deformation_gradient.inverse_transpose();
133 let deformation_gradient_inverse = deformation_gradient_inverse_transpose.transpose();
134 let second_piola_kirchhoff_stress =
135 self.second_piola_kirchhoff_stress(deformation_gradient, temperature)?;
136 Ok(self
137 .cauchy_tangent_stiffness(deformation_gradient, temperature)?
138 .contract_first_second_with_second(
139 &deformation_gradient_inverse,
140 &deformation_gradient_inverse,
141 )
142 * deformation_gradient.determinant()
143 + SecondPiolaKirchhoffTangentStiffness::dyad_ij_kl(
144 &second_piola_kirchhoff_stress,
145 &deformation_gradient_inverse_transpose,
146 )
147 - SecondPiolaKirchhoffTangentStiffness::dyad_il_kj(
148 &second_piola_kirchhoff_stress,
149 &deformation_gradient_inverse_transpose,
150 )
151 - SecondPiolaKirchhoffTangentStiffness::dyad_ik_jl(
152 &deformation_gradient_inverse,
153 &second_piola_kirchhoff_stress,
154 ))
155 }
156 fn coefficient_of_thermal_expansion(&self) -> Quantity<ReciprocalTemperature>;
158 fn reference_temperature(&self) -> Quantity<Temperature>;
160}