Skip to content

Commit

Permalink
Update modules/solid_mechanics/doc/content/source/materials/Composite…
Browse files Browse the repository at this point in the history
…PowerLawCreepStressUpdate.md

to address failing documentation testing
  • Loading branch information
sapitts authored and GiudGiud committed Jan 22, 2025
1 parent 986f667 commit 5ad9153
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The increment of inelastic strain is computed from the creep rate in this class.
\dot{\epsilon} = \sum_{i=1}^N h_i \left[ A_i \left( \sigma^{trial}_{effective} - 3 G \Delta p \right)^{n_i} \exp \left( \frac{-Q_i}{RT} \right) \right] \left(t - t_o \right)^m
\end{equation}

where subscript $i$ denotes phase specific material property, $h$ is material properties to interpolate different phases, $A_i$ is the power law creep coefficient, also known as Dorn's Constant, $\sigma^{trial}_{effective}$ is the scalar von Mises trial stress, $G$ is
where subscript $i$ denotes phase specific material property, $h_i$ is the phase interpolation function, $A_i$ is the power law creep coefficient, also known as Dorn's Constant, $\sigma^{trial}_{effective}$ is the scalar von Mises trial stress, $G$ is
the isotropic shear modulus, $Q$ is the activation energy, $R$ is the universal
gas constant, $T$ is the temperature, $t$ and $t_o$ are the current and initial
times, respectively, and $n$ and $m$ are exponent values.
Expand All @@ -36,7 +36,7 @@ strain return mapping stress calculator such as

## Example Input File Syntax

!listing modules/combined/test/tests/power_law_creep/composite_power_law_creep.i block=Materials/power_law_creep
!listing modules/solid_mechanics/test/tests/power_law_creep/composite_power_law_creep.i block=Materials/power_law_creep

!syntax parameters /Materials/CompositePowerLawCreepStressUpdate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CompositePowerLawCreepStressUpdateTempl : public RadialReturnCreepStressUp
Real _exp_time;

/// vector to keep the material property name for switching function material
const std::vector<MaterialPropertyName> _switchingFuncNames;
const std::vector<MaterialPropertyName> _switching_func_names;
unsigned int _num_materials;

/// switching functions for each phase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ CompositePowerLawCreepStressUpdateTempl<is_ad>::CompositePowerLawCreepStressUpda
_activation_energy(this->template getParam<std::vector<Real>>("activation_energy")),
_gas_constant(this->template getParam<Real>("gas_constant")),
_start_time(this->template getParam<Real>("start_time")),
_switchingFuncNames(
_switching_func_names(
this->template getParam<std::vector<MaterialPropertyName>>("switching_functions"))

{
_num_materials = _switchingFuncNames.size();
_num_materials = _switching_func_names.size();
if (_n_exponent.size() != _num_materials)
this->paramError("n_exponent", "n exponent must be equal to the number of switching functions");

Expand All @@ -81,7 +81,7 @@ CompositePowerLawCreepStressUpdateTempl<is_ad>::CompositePowerLawCreepStressUpda
for (unsigned int i = 0; i < _num_materials; ++i)
{
_switchingFunc[i] =
&this->template getGenericMaterialProperty<Real, is_ad>(_switchingFuncNames[i]);
&this->template getGenericMaterialProperty<Real, is_ad>(_switching_func_names[i]);
}
}

Expand All @@ -103,10 +103,8 @@ CompositePowerLawCreepStressUpdateTempl<is_ad>::computeResidualInternal(
const GenericReal<is_ad> & effective_trial_stress, const ScalarType & scalar)
{
const ScalarType stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
ScalarType creep_rate =
_coefficient[0] * std::pow(stress_delta, _n_exponent[0]) * (*_switchingFunc[0])[_qp] *
std::exp(-_activation_energy[0] / (_gas_constant * (*_temperature)[_qp])) * _exp_time;
for (unsigned int n = 1; n < _num_materials; ++n)
ScalarType creep_rate = 0.0;
for (const auto n : make_range(_num_materials))
{
creep_rate +=
_coefficient[n] * std::pow(stress_delta, _n_exponent[n]) * (*_switchingFunc[n])[_qp] *
Expand All @@ -121,12 +119,8 @@ CompositePowerLawCreepStressUpdateTempl<is_ad>::computeDerivative(
const GenericReal<is_ad> & effective_trial_stress, const GenericReal<is_ad> & scalar)
{
const GenericReal<is_ad> stress_delta = effective_trial_stress - _three_shear_modulus * scalar;
GenericReal<is_ad> creep_rate_derivative =
-_coefficient[0] * _three_shear_modulus * _n_exponent[0] *
std::pow(stress_delta, _n_exponent[0] - 1.0) * (*_switchingFunc[0])[_qp] *
std::exp(-_activation_energy[0] / (_gas_constant * (*_temperature)[_qp])) * _exp_time;

for (unsigned int n = 1; n < _num_materials; ++n)
GenericReal<is_ad> creep_rate_derivative = 0.0;
for (const auto n : make_range(_num_materials))
{
creep_rate_derivative +=
-_coefficient[n] * _three_shear_modulus * _n_exponent[n] *
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# 1x1x1 unit cube with uniform pressure on top face and 2 phases with different materials

[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]

[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 6
zmax = 1
xmax = 1
ymax = 1
[]

[Variables]
[temp]
order = FIRST
family = LAGRANGE
initial_condition = 1000.0
[]
[]

[ICs]
[phase1IC]
type = BoundingBoxIC
x1 = -1
x2 = 1.5
y1 = -1
y2 = 1.5
z1 = -1
z2 = 1.0
inside = 1
outside = 0
variable = phase1
int_width=0.01
[]
[phase2IC]
type = BoundingBoxIC
x1 = -1
x2 = 1.5
y1 = -1
y2 = 1.5
z1 = -1
z2 = 1.0
inside = 0
outside = 1
variable = phase2
int_width=0.01
[]
[]

[AuxVariables]
[phase1]
[]
[phase2]
[]
[]

[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
incremental = true
add_variables = true
generate_output = 'stress_yy creep_strain_xx creep_strain_yy creep_strain_zz elastic_strain_yy'
[]
[]

[Functions]
[top_pull]
type = PiecewiseLinear
x = '0 1'
y = '1 1'
[]
[]

[Kernels]
[heat]
type = Diffusion
variable = temp
[]
[heat_ie]
type = TimeDerivative
variable = temp
[]
[]

[BCs]
[u_top_pull]
type = Pressure
variable = disp_y
boundary = top
factor = -10.0e6
function = top_pull
[]
[u_bottom_fix]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[u_yz_fix]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[u_xy_fix]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[temp_fix]
type = DirichletBC
variable = temp
boundary = 'bottom top'
value = 1000.0
[]
[]

[Materials]
[elasticity_tensor1]
type = ComputeIsotropicElasticityTensor
base_name = C1
youngs_modulus = 2e11
poissons_ratio = 0.3
[]
[elasticity_tensor2]
type = ComputeIsotropicElasticityTensor
base_name = C2
youngs_modulus = 2e11
poissons_ratio = 0.3
[]
[h1]
type = ParsedMaterial
property_name = h1
coupled_variables = phase1
expression = '0.5*tanh(20*(phase1-0.5))+0.5'
[]
[h2]
type = ParsedMaterial
property_name = h2
coupled_variables = phase2
expression = '0.5*tanh(20*(phase2-0.5))+0.5'
[]
[./C]
type = CompositeElasticityTensor
coupled_variables = 'phase1 phase2'
tensors = 'C1 C2'
weights = 'h1 h2'
[../]
[radial_return_stress]
type = ComputeMultipleInelasticStress
inelastic_models = 'power_law_creep plas'
tangent_operator = elastic
[]
[power_law_creep]
type = CompositePowerLawCreepStressUpdate
coefficient = '1e-15 5e-20'
n_exponent = '4 5'
activation_energy = '3.0e5 3.5e5'
switching_functions = 'h1 h1'
temperature = temp
[]
[./plas]
type = IsotropicPlasticityStressUpdate
hardening_constant = 1
yield_stress = 1e30
[../]
[]

[VectorPostprocessors]
[./soln]
type = LineValueSampler
warn_discontinuous_face_values = false
sort_by = x
variable = 'disp_x disp_y disp_z creep_strain_xx creep_strain_yy creep_strain_zz'
start_point = '0 0 0.0'
end_point = '1.0 1.0 1.0'
num_points = 5
outputs = tests
[../]
[]

[Executioner]
type = Transient
solve_type = 'PJFNK'

petsc_options = '-snes_ksp'
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '101'

line_search = 'none'

l_max_its = 20
nl_max_its = 20
nl_rel_tol = 1.0e-10
nl_abs_tol = 1.0e-10
l_tol = 1e-10
start_time = 0.0
end_time = 1.0
num_steps = 10
dt = 0.1
[]

[Outputs]
exodus = false
[./tests]
type = CSV
execute_on = final
[../]
[]

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
creep_strain_xx,creep_strain_yy,creep_strain_zz,disp_x,disp_y,disp_z,id,x,y,z
-0.0023716333113304,0.0047429764685041,-0.0023713431571737,0,0,0,0,0,0,0
-0.0023714939313278,0.0047427334306296,-0.0023712394993018,-0.00059578243661549,0.0012009404399852,-0.00059588124853178,0.43301270189222,0.25,0.25,0.25
-0.0023712094139999,0.0047422425706105,-0.0023710331566106,-0.0011915917519906,0.0024017112448978,-0.001191677858932,0.86602540378444,0.5,0.5,0.5
-0.00237014425134,0.0047404716898324,-0.0023703274384924,-0.0017869952311931,0.0036017381304896,-0.0017873315610309,1.2990381056767,0.75,0.75,0.75
-0.0023693256182857,0.0047392275291672,-0.0023699019108814,-0.0023816925021114,0.0048008629771881,-0.0023828566326056,1.7320508075689,1,1,1
8 changes: 8 additions & 0 deletions modules/solid_mechanics/test/tests/power_law_creep/tests
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@
requirement = "The system shall provide a phase-dependent power law creep that works with plasticity."
issues = '#28368'
[]
[composite_power_law_creep_onePhaseMulti]
type = 'CSVDiff'
input = 'composite_power_law_creep_onePhaseMulti.i'
csvdiff = 'composite_power_law_creep_onePhaseMulti_tests_soln_0011.csv'
design = 'CompositePowerLawCreepStressUpdate.md'
requirement = "The system shall provide a phase-dependent power law creep that works for when one phase has multiple plasticity rule, and another phase does not have plasticity"
issues = '#28368'
[]
[except_composite_power_law_activation_energy]
type = 'RunException'
input = 'composite_power_law_creep.i'
Expand Down

0 comments on commit 5ad9153

Please sign in to comment.