Skip to content

Commit

Permalink
Verification tests and demos
Browse files Browse the repository at this point in the history
  • Loading branch information
reverendbedford committed Aug 19, 2024
1 parent 74637d4 commit ead5a30
Show file tree
Hide file tree
Showing 7 changed files with 629 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ FredrickArmstrongPlasticHardening::expected_options()
options.set_input("back_stress") = VariableName("state", "internal", "X");
options.set("back_stress").doc() = "Back stress";

options.set_output("back_stress_rate");
options.set("back_stress_rate").doc() = "Back stress rate, defaults to back_stress + _rate";

options.set_input("flow_direction") = VariableName("state", "internal", "NM");
options.set("flow_direction").doc() = "Flow direction";

Expand All @@ -63,7 +66,9 @@ FredrickArmstrongPlasticHardening::FredrickArmstrongPlasticHardening(const Optio
: FlowRule(options),
_X(declare_input_variable<SR2>("back_stress")),
_NM(declare_input_variable<SR2>("flow_direction")),
_X_dot(declare_output_variable<SR2>(_X.name().with_suffix("_rate"))),
_X_dot(declare_output_variable<SR2>(options.get<VariableName>("back_stress_rate").empty()
? _X.name().with_suffix("_rate")
: options.get<VariableName>("back_stress_rate"))),
_C(declare_parameter<Scalar>("C", "C", true)),
_g(declare_parameter<Scalar>("g", "g", true))
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
[Tensors]
[end_time]
type = LogspaceScalar
start = -1
end = 5
nstep = 20
[]
[times]
type = LinspaceScalar
start = 0
end = end_time
nstep = 100
[]
[exx]
type = FullScalar
batch_shape = '(20)'
value = 0.1
[]
[eyy]
type = FullScalar
batch_shape = '(20)'
value = -0.05
[]
[ezz]
type = FullScalar
batch_shape = '(20)'
value = -0.05
[]
[max_strain]
type = FillSR2
values = 'exx eyy ezz'
[]
[strains]
type = LinspaceSR2
start = 0
end = max_strain
nstep = 100
[]
[]

[Drivers]
[driver]
type = SolidMechanicsDriver
model = 'model'
times = 'times'
prescribed_strains = 'strains'
save_as = 'result.pt'
[]
[regression]
type = TransientRegression
driver = 'driver'
reference = 'gold/result.pt'
[]
[]

[Solvers]
[newton]
type = Newton
[]
[]

[Models]
[isoharden]
type = SlopeSaturationVoceIsotropicHardening
saturated_hardening = 100
initial_hardening_rate = 1200.0
[]
[kinharden]
type = SR2LinearCombination
from_var = 'state/internal/X1 state/internal/X2'
to_var = 'state/internal/X'
[]
[mandel_stress]
type = IsotropicMandelStress
[]
[overstress]
type = SR2LinearCombination
to_var = 'state/internal/O'
from_var = 'state/internal/M state/internal/X'
coefficients = '1 -1'
[]
[vonmises]
type = SR2Invariant
invariant_type = 'VONMISES'
tensor = 'state/internal/O'
invariant = 'state/internal/s'
[]
[yield]
type = YieldFunction
yield_stress = 5
isotropic_hardening = 'state/internal/k'
[]
[flow]
type = ComposedModel
models = 'overstress vonmises yield'
[]
[normality]
type = Normality
model = 'flow'
function = 'state/internal/fp'
from = 'state/internal/M'
to = 'state/internal/NM'
[]
[flow_rate]
type = PerzynaPlasticFlowRate
reference_stress = 100
exponent = 2
[]
[X1rate]
type = FredrickArmstrongPlasticHardening
back_stress = 'state/internal/X1'
C = 10000
g = 100
[]
[X2rate]
type = FredrickArmstrongPlasticHardening
back_stress = 'state/internal/X2'
C = 1000
g = 9
[]
[Eprate]
type = AssociativePlasticFlow
[]
[Erate]
type = SR2VariableRate
variable = 'forces/E'
rate = 'forces/E_rate'
[]
[Eerate]
type = SR2LinearCombination
from_var = 'forces/E_rate state/internal/Ep_rate'
to_var = 'state/internal/Ee_rate'
coefficients = '1 -1'
[]
[elasticity]
type = LinearIsotropicElasticity
youngs_modulus = 1e5
poisson_ratio = 0.3
rate_form = true
[]
[integrate_k]
type = ScalarBackwardEulerTimeIntegration
variable = 'state/internal/k'
[]
[integrate_X1]
type = SR2BackwardEulerTimeIntegration
variable = 'state/internal/X1'
[]
[integrate_X2]
type = SR2BackwardEulerTimeIntegration
variable = 'state/internal/X2'
[]
[integrate_stress]
type = SR2BackwardEulerTimeIntegration
variable = 'state/S'
[]
[implicit_rate]
type = ComposedModel
models = 'isoharden kinharden mandel_stress overstress vonmises yield normality flow_rate Eprate X1rate X2rate Erate Eerate elasticity integrate_stress integrate_k integrate_X1 integrate_X2'
[]
[model]
type = ImplicitUpdate
implicit_model = 'implicit_rate'
solver = 'newton'
[]
[]
Binary file not shown.
204 changes: 204 additions & 0 deletions tests/regression/solid_mechanics/recovery/static_recovery/model.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
[Tensors]
[end_time]
type = LogspaceScalar
start = -1
end = 5
nstep = 20
[]
[times]
type = LinspaceScalar
start = 0
end = end_time
nstep = 100
[]
[exx]
type = FullScalar
batch_shape = '(20)'
value = 0.1
[]
[eyy]
type = FullScalar
batch_shape = '(20)'
value = -0.05
[]
[ezz]
type = FullScalar
batch_shape = '(20)'
value = -0.05
[]
[max_strain]
type = FillSR2
values = 'exx eyy ezz'
[]
[strains]
type = LinspaceSR2
start = 0
end = max_strain
nstep = 100
[]
[]

[Drivers]
[driver]
type = SolidMechanicsDriver
model = 'model'
times = 'times'
prescribed_strains = 'strains'
save_as = 'result.pt'
[]
[regression]
type = TransientRegression
driver = 'driver'
reference = 'gold/result.pt'
[]
[]

[Solvers]
[newton]
type = Newton
[]
[]

[Models]
[isoharden]
type = SlopeSaturationVoceIsotropicHardening
saturated_hardening = 100
initial_hardening_rate = 1200.0
isotropic_hardening_rate = 'state/internal/k_rate_base'
[]
[isoharden_recovery]
type = IsotropicHardeningStaticRecovery
n = 2.0
tau = 1000.0
[]
[isoharden_total]
type = ScalarLinearCombination
to_var = 'state/internal/k_rate'
from_var = 'state/internal/k_rate_base state/internal/k_recovery_rate'
coefficients = '1 1'
[]
[kinharden]
type = SR2LinearCombination
from_var = 'state/internal/X1 state/internal/X2'
to_var = 'state/internal/X'
[]
[mandel_stress]
type = IsotropicMandelStress
[]
[overstress]
type = SR2LinearCombination
to_var = 'state/internal/O'
from_var = 'state/internal/M state/internal/X'
coefficients = '1 -1'
[]
[vonmises]
type = SR2Invariant
invariant_type = 'VONMISES'
tensor = 'state/internal/O'
invariant = 'state/internal/s'
[]
[yield]
type = YieldFunction
yield_stress = 5
isotropic_hardening = 'state/internal/k'
[]
[flow]
type = ComposedModel
models = 'overstress vonmises yield'
[]
[normality]
type = Normality
model = 'flow'
function = 'state/internal/fp'
from = 'state/internal/M'
to = 'state/internal/NM'
[]
[flow_rate]
type = PerzynaPlasticFlowRate
reference_stress = 100
exponent = 2
[]
[X1rate]
type = FredrickArmstrongPlasticHardening
back_stress = 'state/internal/X1'
back_stress_rate = 'state/internal/X1_rate_base'
C = 10000
g = 100
[]
[X1_recovery]
type = KinematicHardeningStaticRecovery
back_stress = 'state/internal/X1'
n = 2.0
tau = 1000.0
[]
[X1_total]
type = SR2LinearCombination
to_var = 'state/internal/X1_rate'
from_var = 'state/internal/X1_rate_base state/internal/X1_recovery_rate'
coefficients = '1 1'
[]
[X2rate]
type = FredrickArmstrongPlasticHardening
back_stress = 'state/internal/X2'
back_stress_rate = 'state/internal/X2_rate_base'
C = 1000
g = 9
[]
[X2_recovery]
type = KinematicHardeningStaticRecovery
back_stress = 'state/internal/X2'
n = 2.5
tau = 500.0
[]
[X2_total]
type = SR2LinearCombination
to_var = 'state/internal/X2_rate'
from_var = 'state/internal/X2_rate_base state/internal/X2_recovery_rate'
coefficients = '1 1'
[]
[Eprate]
type = AssociativePlasticFlow
[]
[Erate]
type = SR2VariableRate
variable = 'forces/E'
rate = 'forces/E_rate'
[]
[Eerate]
type = SR2LinearCombination
from_var = 'forces/E_rate state/internal/Ep_rate'
to_var = 'state/internal/Ee_rate'
coefficients = '1 -1'
[]
[elasticity]
type = LinearIsotropicElasticity
youngs_modulus = 1e5
poisson_ratio = 0.3
rate_form = true
[]
[integrate_k]
type = ScalarBackwardEulerTimeIntegration
variable = 'state/internal/k'
[]
[integrate_X1]
type = SR2BackwardEulerTimeIntegration
variable = 'state/internal/X1'
[]
[integrate_X2]
type = SR2BackwardEulerTimeIntegration
variable = 'state/internal/X2'
[]
[integrate_stress]
type = SR2BackwardEulerTimeIntegration
variable = 'state/S'
[]
[implicit_rate]
type = ComposedModel
models = 'isoharden isoharden_recovery isoharden_total kinharden mandel_stress overstress vonmises yield normality flow_rate Eprate X1rate X1_recovery X1_total X2rate X2_recovery X2_total Erate Eerate elasticity integrate_stress integrate_k integrate_X1 integrate_X2'
[]
[model]
type = ImplicitUpdate
implicit_model = 'implicit_rate'
solver = 'newton'
[]
[]
Binary file not shown.
Loading

0 comments on commit ead5a30

Please sign in to comment.