conspire/constitutive/multiphysics/solid_thermal/thermoelastic_thermal_conduction/
mod.rs1#[cfg(test)]
3pub mod test;
4
5use crate::{
6 constitutive::{
7 ConstitutiveError,
8 multiphysics::{Multiphysics, solid_thermal::SolidThermal},
9 solid::{Solid, thermoelastic::Thermoelastic},
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::{PowerTemperatureDensity, ReciprocalTemperature, Stress, Temperature},
19};
20
21#[derive(Clone, Debug)]
23pub struct ThermoelasticThermalConduction<C1, C2>
24where
25 C1: Thermoelastic,
26 C2: ThermalConduction,
27{
28 thermoelastic_constitutive_model: C1,
29 thermal_conduction_constitutive_model: C2,
30}
31
32impl<C1, C2> From<(C1, C2)> for ThermoelasticThermalConduction<C1, C2>
33where
34 C1: Thermoelastic,
35 C2: ThermalConduction,
36{
37 fn from(
38 (thermoelastic_constitutive_model, thermal_conduction_constitutive_model): (C1, C2),
39 ) -> Self {
40 Self {
41 thermoelastic_constitutive_model,
42 thermal_conduction_constitutive_model,
43 }
44 }
45}
46
47impl<C1, C2> Solid for ThermoelasticThermalConduction<C1, C2>
48where
49 C1: Thermoelastic,
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 ThermoelasticThermalConduction<C1, C2>
61where
62 C1: Thermoelastic,
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> Thermal for ThermoelasticThermalConduction<C1, C2>
123where
124 C1: Thermoelastic,
125 C2: ThermalConduction,
126{
127}
128
129impl<C1, C2> ThermalConduction for ThermoelasticThermalConduction<C1, C2>
130where
131 C1: Thermoelastic,
132 C2: ThermalConduction,
133{
134 fn potential(
135 &self,
136 temperature_gradient: &TemperatureGradient,
137 ) -> Result<Quantity<PowerTemperatureDensity>, ConstitutiveError> {
138 self.thermal_constitutive_model()
139 .potential(temperature_gradient)
140 }
141 fn heat_flux(
142 &self,
143 temperature_gradient: &TemperatureGradient,
144 ) -> Result<HeatFlux, ConstitutiveError> {
145 self.thermal_constitutive_model()
146 .heat_flux(temperature_gradient)
147 }
148 fn heat_flux_tangent(
149 &self,
150 temperature_gradient: &TemperatureGradient,
151 ) -> Result<HeatFluxTangent, ConstitutiveError> {
152 self.thermal_constitutive_model()
153 .heat_flux_tangent(temperature_gradient)
154 }
155}
156
157impl<C1, C2> Multiphysics for ThermoelasticThermalConduction<C1, C2>
158where
159 C1: Thermoelastic,
160 C2: ThermalConduction,
161{
162}
163
164impl<C1, C2> SolidThermal for ThermoelasticThermalConduction<C1, C2>
165where
166 C1: Thermoelastic,
167 C2: ThermalConduction,
168{
169 type Solid = C1;
170 type Thermal = C2;
171 fn solid_constitutive_model(&self) -> &C1 {
172 &self.thermoelastic_constitutive_model
173 }
174 fn thermal_constitutive_model(&self) -> &C2 {
175 &self.thermal_conduction_constitutive_model
176 }
177}