conspire/constitutive/multiphysics/solid_thermal/thermohyperelastic_thermal_conduction/
mod.rs1#[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, Scalar, SecondPiolaKirchhoffStress,
16 SecondPiolaKirchhoffTangentStiffness, TemperatureGradient,
17 },
18};
19
20#[derive(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> Solid for ThermohyperelasticThermalConduction<C1, C2>
33where
34 C1: Thermohyperelastic,
35 C2: ThermalConduction,
36 Self: SolidThermal<C1, C2>,
37{
38 fn bulk_modulus(&self) -> &Scalar {
39 self.solid_constitutive_model().bulk_modulus()
40 }
41 fn shear_modulus(&self) -> &Scalar {
42 self.solid_constitutive_model().shear_modulus()
43 }
44}
45
46impl<C1, C2> Thermoelastic for ThermohyperelasticThermalConduction<C1, C2>
47where
48 C1: Thermohyperelastic,
49 C2: ThermalConduction,
50 Self: SolidThermal<C1, C2>,
51{
52 fn cauchy_stress(
53 &self,
54 deformation_gradient: &DeformationGradient,
55 temperature: &Scalar,
56 ) -> Result<CauchyStress, ConstitutiveError> {
57 self.solid_constitutive_model()
58 .cauchy_stress(deformation_gradient, temperature)
59 }
60 fn cauchy_tangent_stiffness(
61 &self,
62 deformation_gradient: &DeformationGradient,
63 temperature: &Scalar,
64 ) -> Result<CauchyTangentStiffness, ConstitutiveError> {
65 self.solid_constitutive_model()
66 .cauchy_tangent_stiffness(deformation_gradient, temperature)
67 }
68 fn first_piola_kirchhoff_stress(
69 &self,
70 deformation_gradient: &DeformationGradient,
71 temperature: &Scalar,
72 ) -> Result<FirstPiolaKirchhoffStress, ConstitutiveError> {
73 self.solid_constitutive_model()
74 .first_piola_kirchhoff_stress(deformation_gradient, temperature)
75 }
76 fn first_piola_kirchhoff_tangent_stiffness(
77 &self,
78 deformation_gradient: &DeformationGradient,
79 temperature: &Scalar,
80 ) -> Result<FirstPiolaKirchhoffTangentStiffness, ConstitutiveError> {
81 self.solid_constitutive_model()
82 .first_piola_kirchhoff_tangent_stiffness(deformation_gradient, temperature)
83 }
84 fn second_piola_kirchhoff_stress(
85 &self,
86 deformation_gradient: &DeformationGradient,
87 temperature: &Scalar,
88 ) -> Result<SecondPiolaKirchhoffStress, ConstitutiveError> {
89 self.solid_constitutive_model()
90 .second_piola_kirchhoff_stress(deformation_gradient, temperature)
91 }
92 fn second_piola_kirchhoff_tangent_stiffness(
93 &self,
94 deformation_gradient: &DeformationGradient,
95 temperature: &Scalar,
96 ) -> Result<SecondPiolaKirchhoffTangentStiffness, ConstitutiveError> {
97 self.solid_constitutive_model()
98 .second_piola_kirchhoff_tangent_stiffness(deformation_gradient, temperature)
99 }
100 fn coefficient_of_thermal_expansion(&self) -> &Scalar {
101 self.solid_constitutive_model()
102 .coefficient_of_thermal_expansion()
103 }
104 fn reference_temperature(&self) -> &Scalar {
105 self.solid_constitutive_model().reference_temperature()
106 }
107}
108
109impl<C1, C2> Thermohyperelastic for ThermohyperelasticThermalConduction<C1, C2>
110where
111 C1: Thermohyperelastic,
112 C2: ThermalConduction,
113 Self: SolidThermal<C1, C2>,
114{
115 fn helmholtz_free_energy_density(
116 &self,
117 deformation_gradient: &DeformationGradient,
118 temperature: &Scalar,
119 ) -> Result<Scalar, ConstitutiveError> {
120 self.solid_constitutive_model()
121 .helmholtz_free_energy_density(deformation_gradient, temperature)
122 }
123}
124
125impl<C1, C2> Thermal for ThermohyperelasticThermalConduction<C1, C2>
126where
127 C1: Thermohyperelastic,
128 C2: ThermalConduction,
129 Self: SolidThermal<C1, C2>,
130{
131}
132
133impl<C1, C2> ThermalConduction for ThermohyperelasticThermalConduction<C1, C2>
134where
135 C1: Thermohyperelastic,
136 C2: ThermalConduction,
137 Self: SolidThermal<C1, C2>,
138{
139 fn heat_flux(&self, temperature_gradient: &TemperatureGradient) -> HeatFlux {
140 self.thermal_constitutive_model()
141 .heat_flux(temperature_gradient)
142 }
143}
144
145impl<C1, C2> Multiphysics for ThermohyperelasticThermalConduction<C1, C2>
146where
147 C1: Thermohyperelastic,
148 C2: ThermalConduction,
149 Self: SolidThermal<C1, C2>,
150{
151}
152
153impl<C1, C2> SolidThermal<C1, C2> for ThermohyperelasticThermalConduction<C1, C2>
154where
155 C1: Thermohyperelastic,
156 C2: ThermalConduction,
157{
158 fn construct(
159 thermohyperelastic_constitutive_model: C1,
160 thermal_conduction_constitutive_model: C2,
161 ) -> Self {
162 Self {
163 thermohyperelastic_constitutive_model,
164 thermal_conduction_constitutive_model,
165 }
166 }
167 fn solid_constitutive_model(&self) -> &C1 {
168 &self.thermohyperelastic_constitutive_model
169 }
170 fn thermal_constitutive_model(&self) -> &C2 {
171 &self.thermal_conduction_constitutive_model
172 }
173}