conspire/constitutive/solid/hyperviscoelastic/saint_venant_kirchhoff/
mod.rs#[cfg(test)]
mod test;
use super::*;
#[derive(Debug)]
pub struct SaintVenantKirchhoff<'a> {
parameters: Parameters<'a>,
}
impl<'a> Constitutive<'a> for SaintVenantKirchhoff<'a> {
fn new(parameters: Parameters<'a>) -> Self {
Self { parameters }
}
}
impl<'a> Solid<'a> for SaintVenantKirchhoff<'a> {
fn bulk_modulus(&self) -> &Scalar {
&self.parameters[0]
}
fn shear_modulus(&self) -> &Scalar {
&self.parameters[1]
}
}
impl<'a> Viscous<'a> for SaintVenantKirchhoff<'a> {
fn bulk_viscosity(&self) -> &Scalar {
&self.parameters[2]
}
fn shear_viscosity(&self) -> &Scalar {
&self.parameters[3]
}
}
impl<'a> Viscoelastic<'a> for SaintVenantKirchhoff<'a> {
fn second_piola_kirchhoff_stress(
&self,
deformation_gradient: &DeformationGradient,
deformation_gradient_rate: &DeformationGradientRate,
) -> Result<SecondPiolaKirchhoffStress, ConstitutiveError> {
let _jacobian = self.jacobian(deformation_gradient)?;
let (deviatoric_strain, strain_trace) =
((deformation_gradient.right_cauchy_green() - IDENTITY_00) * 0.5)
.deviatoric_and_trace();
let first_term = deformation_gradient_rate.transpose() * deformation_gradient;
let (deviatoric_strain_rate, strain_rate_trace) =
((&first_term + first_term.transpose()) * 0.5).deviatoric_and_trace();
Ok(deviatoric_strain * (2.0 * self.shear_modulus())
+ deviatoric_strain_rate * (2.0 * self.shear_viscosity())
+ IDENTITY_00
* (self.bulk_modulus() * strain_trace + self.bulk_viscosity() * strain_rate_trace))
}
fn second_piola_kirchhoff_rate_tangent_stiffness(
&self,
deformation_gradient: &DeformationGradient,
_: &DeformationGradientRate,
) -> Result<SecondPiolaKirchhoffRateTangentStiffness, ConstitutiveError> {
let _jacobian = self.jacobian(deformation_gradient)?;
let scaled_deformation_gradient_transpose =
deformation_gradient.transpose() * self.shear_viscosity();
Ok(SecondPiolaKirchhoffRateTangentStiffness::dyad_ik_jl(
&scaled_deformation_gradient_transpose,
&IDENTITY_00,
) + SecondPiolaKirchhoffRateTangentStiffness::dyad_il_jk(
&IDENTITY_00,
&scaled_deformation_gradient_transpose,
) + SecondPiolaKirchhoffRateTangentStiffness::dyad_ij_kl(
&(IDENTITY_00 * (self.bulk_viscosity() - TWO_THIRDS * self.shear_viscosity())),
deformation_gradient,
))
}
}
impl<'a> ElasticHyperviscous<'a> for SaintVenantKirchhoff<'a> {
fn viscous_dissipation(
&self,
deformation_gradient: &DeformationGradient,
deformation_gradient_rate: &DeformationGradientRate,
) -> Result<Scalar, ConstitutiveError> {
let _jacobian = self.jacobian(deformation_gradient)?;
let first_term = deformation_gradient_rate.transpose() * deformation_gradient;
let strain_rate = (&first_term + first_term.transpose()) * 0.5;
Ok(self.shear_viscosity() * strain_rate.squared_trace()
+ 0.5
* (self.bulk_viscosity() - TWO_THIRDS * self.shear_viscosity())
* strain_rate.trace().powi(2))
}
}
impl<'a> Hyperviscoelastic<'a> for SaintVenantKirchhoff<'a> {
fn helmholtz_free_energy_density(
&self,
deformation_gradient: &DeformationGradient,
) -> Result<Scalar, ConstitutiveError> {
let _jacobian = self.jacobian(deformation_gradient)?;
let strain = (deformation_gradient.right_cauchy_green() - IDENTITY_00) * 0.5;
Ok(self.shear_modulus() * strain.squared_trace()
+ 0.5
* (self.bulk_modulus() - TWO_THIRDS * self.shear_modulus())
* strain.trace().powi(2))
}
}