conspire/constitutive/multiphysics/solid_thermal/thermoelastic_thermal_conduction/
mod.rs1#[cfg(test)]
4pub mod test;
5
6use crate::{
7 constitutive::{
8 ConstitutiveError,
9 multiphysics::{Multiphysics, solid_thermal::SolidThermal},
10 solid::{Solid, thermoelastic::Thermoelastic},
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 ThermoelasticThermalConduction<C1, C2>
23where
24 C1: Thermoelastic,
25 C2: ThermalConduction,
26 Self: SolidThermal<C1, C2>,
27{
28 thermoelastic_constitutive_model: C1,
29 thermal_conduction_constitutive_model: C2,
30}
31
32impl<C1, C2> Solid for ThermoelasticThermalConduction<C1, C2>
33where
34 C1: Thermoelastic,
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 ThermoelasticThermalConduction<C1, C2>
47where
48 C1: Thermoelastic,
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> Thermal for ThermoelasticThermalConduction<C1, C2>
110where
111 C1: Thermoelastic,
112 C2: ThermalConduction,
113 Self: SolidThermal<C1, C2>,
114{
115}
116
117impl<C1, C2> ThermalConduction for ThermoelasticThermalConduction<C1, C2>
118where
119 C1: Thermoelastic,
120 C2: ThermalConduction,
121 Self: SolidThermal<C1, C2>,
122{
123 fn heat_flux(&self, temperature_gradient: &TemperatureGradient) -> HeatFlux {
124 self.thermal_constitutive_model()
125 .heat_flux(temperature_gradient)
126 }
127}
128
129impl<C1, C2> Multiphysics for ThermoelasticThermalConduction<C1, C2>
130where
131 C1: Thermoelastic,
132 C2: ThermalConduction,
133 Self: SolidThermal<C1, C2>,
134{
135}
136
137impl<C1, C2> SolidThermal<C1, C2> for ThermoelasticThermalConduction<C1, C2>
138where
139 C1: Thermoelastic,
140 C2: ThermalConduction,
141{
142 fn construct(
143 thermoelastic_constitutive_model: C1,
144 thermal_conduction_constitutive_model: C2,
145 ) -> Self {
146 Self {
147 thermoelastic_constitutive_model,
148 thermal_conduction_constitutive_model,
149 }
150 }
151 fn solid_constitutive_model(&self) -> &C1 {
152 &self.thermoelastic_constitutive_model
153 }
154 fn thermal_constitutive_model(&self) -> &C2 {
155 &self.thermal_conduction_constitutive_model
156 }
157}