conspire/constitutive/multiphysics/solid_thermal/thermohyperelastic_thermal_conduction/
mod.rs

1//! Thermohyperelastic-thermal conduction constitutive models.
2
3#[cfg(test)]
4mod test;
5
6use crate::{
7    constitutive::{
8        ConstitutiveError,
9        multiphysics::{Multiphysics, solid_thermal::SolidThermal},
10        solid::{Solid, thermoelastic::Thermoelastic, thermohyperelastic::Thermohyperelastic},
11        thermal::{Thermal, conduction::ThermalConduction},
12    },
13    mechanics::{
14        CauchyStress, CauchyTangentStiffness, DeformationGradient, FirstPiolaKirchhoffStress,
15        FirstPiolaKirchhoffTangentStiffness, HeatFlux, HeatFluxTangent, Scalar,
16        SecondPiolaKirchhoffStress, SecondPiolaKirchhoffTangentStiffness, TemperatureGradient,
17    },
18};
19
20/// A thermohyperelastic-thermal conduction constitutive model.
21#[derive(Clone, Debug)]
22pub struct ThermohyperelasticThermalConduction<C1, C2>
23where
24    C1: Thermohyperelastic,
25    C2: ThermalConduction,
26    Self: SolidThermal<C1, C2>,
27{
28    thermohyperelastic_constitutive_model: C1,
29    thermal_conduction_constitutive_model: C2,
30}
31
32impl<C1, C2> From<(C1, C2)> for ThermohyperelasticThermalConduction<C1, C2>
33where
34    C1: Thermohyperelastic,
35    C2: ThermalConduction,
36    Self: SolidThermal<C1, C2>,
37{
38    fn from(
39        (thermohyperelastic_constitutive_model, thermal_conduction_constitutive_model): (C1, C2),
40    ) -> Self {
41        Self {
42            thermohyperelastic_constitutive_model,
43            thermal_conduction_constitutive_model,
44        }
45    }
46}
47
48impl<C1, C2> Solid for ThermohyperelasticThermalConduction<C1, C2>
49where
50    C1: Thermohyperelastic,
51    C2: ThermalConduction,
52    Self: SolidThermal<C1, C2>,
53{
54    fn bulk_modulus(&self) -> Scalar {
55        self.solid_constitutive_model().bulk_modulus()
56    }
57    fn shear_modulus(&self) -> Scalar {
58        self.solid_constitutive_model().shear_modulus()
59    }
60}
61
62impl<C1, C2> Thermoelastic for ThermohyperelasticThermalConduction<C1, C2>
63where
64    C1: Thermohyperelastic,
65    C2: ThermalConduction,
66    Self: SolidThermal<C1, C2>,
67{
68    fn cauchy_stress(
69        &self,
70        deformation_gradient: &DeformationGradient,
71        temperature: Scalar,
72    ) -> Result<CauchyStress, ConstitutiveError> {
73        self.solid_constitutive_model()
74            .cauchy_stress(deformation_gradient, temperature)
75    }
76    fn cauchy_tangent_stiffness(
77        &self,
78        deformation_gradient: &DeformationGradient,
79        temperature: Scalar,
80    ) -> Result<CauchyTangentStiffness, ConstitutiveError> {
81        self.solid_constitutive_model()
82            .cauchy_tangent_stiffness(deformation_gradient, temperature)
83    }
84    fn first_piola_kirchhoff_stress(
85        &self,
86        deformation_gradient: &DeformationGradient,
87        temperature: Scalar,
88    ) -> Result<FirstPiolaKirchhoffStress, ConstitutiveError> {
89        self.solid_constitutive_model()
90            .first_piola_kirchhoff_stress(deformation_gradient, temperature)
91    }
92    fn first_piola_kirchhoff_tangent_stiffness(
93        &self,
94        deformation_gradient: &DeformationGradient,
95        temperature: Scalar,
96    ) -> Result<FirstPiolaKirchhoffTangentStiffness, ConstitutiveError> {
97        self.solid_constitutive_model()
98            .first_piola_kirchhoff_tangent_stiffness(deformation_gradient, temperature)
99    }
100    fn second_piola_kirchhoff_stress(
101        &self,
102        deformation_gradient: &DeformationGradient,
103        temperature: Scalar,
104    ) -> Result<SecondPiolaKirchhoffStress, ConstitutiveError> {
105        self.solid_constitutive_model()
106            .second_piola_kirchhoff_stress(deformation_gradient, temperature)
107    }
108    fn second_piola_kirchhoff_tangent_stiffness(
109        &self,
110        deformation_gradient: &DeformationGradient,
111        temperature: Scalar,
112    ) -> Result<SecondPiolaKirchhoffTangentStiffness, ConstitutiveError> {
113        self.solid_constitutive_model()
114            .second_piola_kirchhoff_tangent_stiffness(deformation_gradient, temperature)
115    }
116    fn coefficient_of_thermal_expansion(&self) -> Scalar {
117        self.solid_constitutive_model()
118            .coefficient_of_thermal_expansion()
119    }
120    fn reference_temperature(&self) -> Scalar {
121        self.solid_constitutive_model().reference_temperature()
122    }
123}
124
125impl<C1, C2> Thermohyperelastic for ThermohyperelasticThermalConduction<C1, C2>
126where
127    C1: Thermohyperelastic,
128    C2: ThermalConduction,
129    Self: SolidThermal<C1, C2>,
130{
131    fn helmholtz_free_energy_density(
132        &self,
133        deformation_gradient: &DeformationGradient,
134        temperature: Scalar,
135    ) -> Result<Scalar, ConstitutiveError> {
136        self.solid_constitutive_model()
137            .helmholtz_free_energy_density(deformation_gradient, temperature)
138    }
139}
140
141impl<C1, C2> Thermal for ThermohyperelasticThermalConduction<C1, C2>
142where
143    C1: Thermohyperelastic,
144    C2: ThermalConduction,
145    Self: SolidThermal<C1, C2>,
146{
147}
148
149impl<C1, C2> ThermalConduction for ThermohyperelasticThermalConduction<C1, C2>
150where
151    C1: Thermohyperelastic,
152    C2: ThermalConduction,
153    Self: SolidThermal<C1, C2>,
154{
155    fn potential(
156        &self,
157        temperature_gradient: &TemperatureGradient,
158    ) -> Result<Scalar, ConstitutiveError> {
159        self.thermal_constitutive_model()
160            .potential(temperature_gradient)
161    }
162    fn heat_flux(
163        &self,
164        temperature_gradient: &TemperatureGradient,
165    ) -> Result<HeatFlux, ConstitutiveError> {
166        self.thermal_constitutive_model()
167            .heat_flux(temperature_gradient)
168    }
169    fn heat_flux_tangent(
170        &self,
171        temperature_gradient: &TemperatureGradient,
172    ) -> Result<HeatFluxTangent, ConstitutiveError> {
173        self.thermal_constitutive_model()
174            .heat_flux_tangent(temperature_gradient)
175    }
176}
177
178impl<C1, C2> Multiphysics for ThermohyperelasticThermalConduction<C1, C2>
179where
180    C1: Thermohyperelastic,
181    C2: ThermalConduction,
182    Self: SolidThermal<C1, C2>,
183{
184}
185
186impl<C1, C2> SolidThermal<C1, C2> for ThermohyperelasticThermalConduction<C1, C2>
187where
188    C1: Thermohyperelastic,
189    C2: ThermalConduction,
190{
191    fn solid_constitutive_model(&self) -> &C1 {
192        &self.thermohyperelastic_constitutive_model
193    }
194    fn thermal_constitutive_model(&self) -> &C2 {
195        &self.thermal_conduction_constitutive_model
196    }
197}