conspire/constitutive/solid/thermoelastic/almansi_hamel/
mod.rs#[cfg(test)]
mod test;
use super::*;
#[derive(Debug)]
pub struct AlmansiHamel<'a> {
parameters: Parameters<'a>,
}
impl<'a> Constitutive<'a> for AlmansiHamel<'a> {
fn new(parameters: Parameters<'a>) -> Self {
Self { parameters }
}
}
impl<'a> Solid<'a> for AlmansiHamel<'a> {
fn bulk_modulus(&self) -> &Scalar {
&self.parameters[0]
}
fn shear_modulus(&self) -> &Scalar {
&self.parameters[1]
}
}
impl<'a> Thermoelastic<'a> for AlmansiHamel<'a> {
fn cauchy_stress(
&self,
deformation_gradient: &DeformationGradient,
temperature: &Scalar,
) -> Result<CauchyStress, ConstitutiveError> {
let jacobian = self.jacobian(deformation_gradient)?;
let inverse_deformation_gradient = deformation_gradient.inverse();
let strain = (IDENTITY
- inverse_deformation_gradient.transpose() * &inverse_deformation_gradient)
* 0.5;
let (deviatoric_strain, strain_trace) = strain.deviatoric_and_trace();
Ok(deviatoric_strain * (2.0 * self.shear_modulus() / jacobian)
+ IDENTITY
* (self.bulk_modulus() / jacobian
* (strain_trace
- 3.0
* self.coefficient_of_thermal_expansion()
* (temperature - self.reference_temperature()))))
}
fn cauchy_tangent_stiffness(
&self,
deformation_gradient: &DeformationGradient,
temperature: &Scalar,
) -> Result<CauchyTangentStiffness, ConstitutiveError> {
let jacobian = self.jacobian(deformation_gradient)?;
let inverse_transpose_deformation_gradient = deformation_gradient.inverse_transpose();
let inverse_left_cauchy_green_deformation = &inverse_transpose_deformation_gradient
* inverse_transpose_deformation_gradient.transpose();
let strain = (IDENTITY - &inverse_left_cauchy_green_deformation) * 0.5;
let (deviatoric_strain, strain_trace) = strain.deviatoric_and_trace();
Ok((CauchyTangentStiffness::dyad_il_jk(
&inverse_transpose_deformation_gradient,
&inverse_left_cauchy_green_deformation,
) + CauchyTangentStiffness::dyad_ik_jl(
&inverse_left_cauchy_green_deformation,
&inverse_transpose_deformation_gradient,
)) * (self.shear_modulus() / jacobian)
+ CauchyTangentStiffness::dyad_ij_kl(
&IDENTITY,
&(inverse_left_cauchy_green_deformation
* &inverse_transpose_deformation_gradient
* ((self.bulk_modulus() - self.shear_modulus() * TWO_THIRDS) / jacobian)),
)
- CauchyTangentStiffness::dyad_ij_kl(
&(deviatoric_strain * (2.0 * self.shear_modulus() / jacobian)
+ IDENTITY
* (self.bulk_modulus() / jacobian
* (strain_trace
- 3.0
* self.coefficient_of_thermal_expansion()
* (temperature - self.reference_temperature())))),
&inverse_transpose_deformation_gradient,
))
}
fn coefficient_of_thermal_expansion(&self) -> &Scalar {
&self.parameters[2]
}
fn reference_temperature(&self) -> &Scalar {
&self.parameters[3]
}
}