Skip to main content

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

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