Skip to content

Commit

Permalink
Merge pull request idaholab#199 from bwspenc/neml_tests2
Browse files Browse the repository at this point in the history
Expanded NEML testing
  • Loading branch information
bwspenc authored Apr 7, 2021
2 parents 22c2216 + 1f7df02 commit 17832dd
Show file tree
Hide file tree
Showing 19 changed files with 1,450 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/neml
Submodule neml updated 52 files
+2 −1 .github/workflows/package.yml
+9 −3 .github/workflows/test.yml
+2 −0 doc/sphinx/cp/SlipHardening.rst
+29 −0 doc/sphinx/cp/sliphardening/FASlipHardening.rst
+31 −0 doc/sphinx/cp/sliphardening/VocePerSystemHardening.rst
+1 −0 doc/sphinx/general_flow.rst
+69 −0 doc/sphinx/general_flow/walkerkrempl.rst
+1 −0 doc/sphinx/index.rst
+6 −0 doc/sphinx/references.rst
+7 −5 doc/sphinx/vp_flow/chaboche.rst
+234 −0 doc/sphinx/walker.rst
+37 −0 doc/sphinx/walker/testflow.rst
+63 −0 doc/sphinx/walker/walkerdrag.rst
+32 −0 doc/sphinx/walker/walkerflow.rst
+60 −0 doc/sphinx/walker/walkeriso.rst
+71 −0 doc/sphinx/walker/walkerkin.rst
+37 −0 doc/sphinx/walker/walkerscaling.rst
+36 −0 doc/sphinx/walker/walkersoften.rst
+22 −0 doc/sphinx/walker/wrapper.rst
+55 −0 examples/walker_rateswitch.py
+2 −0 src/CMakeLists.txt
+373 −0 src/cp/slipharden.cxx
+135 −0 src/cp/slipharden.h
+19 −0 src/cp/slipharden_wrap.cxx
+29 −4 src/damage.cxx
+10 −0 src/general_flow.cxx
+6 −0 src/general_flow.h
+36 −0 src/history.cxx
+9 −2 src/history.h
+17 −1 src/history_wrap.cxx
+104 −0 src/internalvariable.h
+10 −0 src/math/tensors.h
+12 −3 src/models.cxx
+3 −1 src/models.h
+8 −0 src/objects.cxx
+2 −0 src/objects.h
+1 −1 src/solvers.cxx
+35 −26 src/visco_flow.cxx
+6 −1 src/visco_flow.h
+2,524 −0 src/walker.cxx
+822 −0 src/walker.h
+428 −0 src/walker_wrap.cxx
+1 −1 test/common.py
+7 −0 test/nicediff.py
+2 −0 test/regression/models.txt
+54 −0 test/regression/reference.xml
+ test/regression/walker.pickle
+ test/regression/walker_switch.pickle
+6 −2 test/test_general_flow.py
+111 −0 test/test_slipharden.py
+194 −3 test/test_visco_flow.py
+1,265 −0 test/test_walker.py
102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test1_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test2_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test3_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test4_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test5_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test6_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test7_out.csv

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions test/tests/neml_regression/gold/test8_out.csv

Large diffs are not rendered by default.

231 changes: 231 additions & 0 deletions test/tests/neml_regression/neml_regression.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# This is a common input file that can be used for all NEML regression tests, which
# use a material driver.
# Notes:
# 1) A single csv file provides both the expected temperature and strain inputs and
# stress outputs. This file is almost identical to the one used in the NEML tests,
# is named 'test_x_out.csv', and lives in the 'gold' directory. The only change
# made to this file is that a first row with headings is added. It may seem odd
# to use the same file for the inputs and the gold results, but it facilitates
# supplying and comparing to the NEML regression tests.
# 2) Mandel notation is used in the ordering of the stress/strain components in this
# file. None of the current tests have nonzero shear stresses or strains, but
# a conversion between these and the tensorial components will need to be added
# for tests that have those. We will also need to modify the boundary conditions
# for shear terms.
# 3) Because all DOFs on the nodes of the single element are fully prescribed, there
# is no solution needed, so every step solves with no iterations.
# 4) The computations are a bit slow will full integration. Single point integration
# can be used here without changing the solution, and is employed to accelerate
# these computations.

[GlobalParams]
displacements = 'disp_x disp_y disp_z'
data_file = 'gold/test1_out.csv'
[]

[Mesh]
type = GeneratedMesh
dim = 3
[]

[Modules/TensorMechanics/Master]
[all]
generate_output = 'strain_xx strain_yy strain_zz strain_xy strain_yz strain_xz
stress_xx stress_yy stress_zz stress_xy stress_yz stress_xz'
add_variables = true
[]
[]

[AuxVariables]
[temperature]
[]
[]

[AuxKernels]
[temperature]
type = FunctionAux
function = temperature
variable = temperature
execute_on = 'initial timestep_begin'
[]
[]


[BCs]
[x1]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[]

[y1]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]

[z1]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[]

[x2]
type = FunctionDirichletBC
variable = disp_x
boundary = right
function = strain_xx
[]

[y2]
type = FunctionDirichletBC
variable = disp_y
boundary = top
function = strain_yy
[]

[z2]
type = FunctionDirichletBC
variable = disp_z
boundary = front
function = strain_zz
[]
[]

[Functions]
[temperature]
type = PiecewiseLinear
format = columns
xy_in_file_only = false
x_index_in_file = 0
y_index_in_file = 1
[]
[strain_xx]
type = PiecewiseLinear
format = columns
xy_in_file_only = false
x_index_in_file = 0
y_index_in_file = 2
[]
[strain_yy]
type = PiecewiseLinear
format = columns
xy_in_file_only = false
x_index_in_file = 0
y_index_in_file = 3
[]
[strain_zz]
type = PiecewiseLinear
format = columns
xy_in_file_only = false
x_index_in_file = 0
y_index_in_file = 4
[]
[]

[Materials]
[stress]
type = NEMLStress
database = test1.xml
model = 'model'
[]
[]

[Postprocessors]
[stress_xx]
type = ElementAverageValue
variable = stress_xx
execute_on = 'initial timestep_end'
[]
[stress_yy]
type = ElementAverageValue
variable = stress_yy
execute_on = 'initial timestep_end'
[]
[stress_zz]
type = ElementAverageValue
variable = stress_zz
execute_on = 'initial timestep_end'
[]
[stress_xy]
type = ElementAverageValue
variable = stress_xy
execute_on = 'initial timestep_end'
[]
[stress_xz]
type = ElementAverageValue
variable = stress_xz
execute_on = 'initial timestep_end'
[]
[stress_yz]
type = ElementAverageValue
variable = stress_yz
execute_on = 'initial timestep_end'
[]
[strain_xx]
type = ElementAverageValue
variable = strain_xx
execute_on = 'initial timestep_end'
[]
[strain_yy]
type = ElementAverageValue
variable = strain_yy
execute_on = 'initial timestep_end'
[]
[strain_zz]
type = ElementAverageValue
variable = strain_zz
execute_on = 'initial timestep_end'
[]
[strain_xy]
type = ElementAverageValue
variable = strain_xy
execute_on = 'initial timestep_end'
[]
[strain_xz]
type = ElementAverageValue
variable = strain_xz
execute_on = 'initial timestep_end'
[]
[strain_yz]
type = ElementAverageValue
variable = strain_yz
execute_on = 'initial timestep_end'
[]
[temperature]
type = ElementAverageValue
variable = temperature
execute_on = 'initial timestep_end'
[]
[]

[Executioner]
type = Transient
solve_type = 'NEWTON'
[Quadrature]
order = FIRST #Single qp to make this fully prescribed, single-element test run faster
[]

l_max_its = 5
l_tol = 1e-14
nl_max_its = 10
nl_rel_tol = 1e-10
nl_abs_tol = 1e-12

petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'

end_time = 1000.0
dt = 10.0
[]

[Outputs]
exodus = false
[csv]
type = CSV
file_base = test1_out
[]
[]
27 changes: 27 additions & 0 deletions test/tests/neml_regression/test1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<materials>
<model type="GeneralIntegrator">
<elastic type="IsotropicLinearElasticModel">
<m1>100000.0</m1>
<m1_type>youngs</m1_type>
<m2>0.3</m2>
<m2_type>poissons</m2_type>
</elastic>

<rule type="TVPFlowRule">
<elastic type="IsotropicLinearElasticModel">
<m1>100000.0</m1>
<m1_type>youngs</m1_type>
<m2>0.3</m2>
<m2_type>poissons</m2_type>
</elastic>

<flow type="TestFlowRule">
<eps0>1.0e2</eps0>
<D>100.0</D>
<n>5.2</n>
<s0>150.0</s0>
<K>2000.0</K>
</flow>
</rule>
</model>
</materials>
29 changes: 29 additions & 0 deletions test/tests/neml_regression/test2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<materials>
<model type="GeneralIntegrator">
<elastic type="IsotropicLinearElasticModel">
<m1>100000.0</m1>
<m1_type>youngs</m1_type>
<m2>0.3</m2>
<m2_type>poissons</m2_type>
</elastic>

<rule type="WalkerKremplSwitchRule">
<elastic type="IsotropicLinearElasticModel">
<m1>100000.0</m1>
<m1_type>youngs</m1_type>
<m2>0.3</m2>
<m2_type>poissons</m2_type>
</elastic>

<flow type="TestFlowRule">
<eps0>1.0e2</eps0>
<D>100.0</D>
<n>5.2</n>
<s0>150.0</s0>
<K>2000.0</K>
</flow>
<lambda>0.51</lambda>
<eps_ref>1.0e2</eps_ref>
</rule>
</model>
</materials>
24 changes: 24 additions & 0 deletions test/tests/neml_regression/test3.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<materials>
<model type="SmallStrainRateIndependentPlasticity">
<elastic type="IsotropicLinearElasticModel">
<m1>84000.0</m1>
<m1_type>bulk</m1_type>
<m2>40000.0</m2>
<m2_type>shear</m2_type>
</elastic>

<flow type="RateIndependentAssociativeFlow">
<surface type="IsoKinJ2"/>
<hardening type="CombinedHardeningRule">
<iso type="VoceIsotropicHardeningRule">
<s0>100.0</s0>
<R>100.0</R>
<d>1000.0</d>
</iso>
<kin type="LinearKinematicHardeningRule">
<H>1000.0</H>
</kin>
</hardening>
</flow>
</model>
</materials>
41 changes: 41 additions & 0 deletions test/tests/neml_regression/test4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<materials>
<model type="SmallStrainRateIndependentPlasticity">
<elastic type="IsotropicLinearElasticModel">
<m1>84000.0</m1>
<m1_type>bulk</m1_type>
<m2>40000.0</m2>
<m2_type>shear</m2_type>
</elastic>

<flow type="RateIndependentNonAssociativeHardening">
<surface type="IsoKinJ2"/>
<hardening type="Chaboche">
<iso type="VoceIsotropicHardeningRule">
<s0>100.0</s0>
<R>100.0</R>
<d>1000.0</d>
</iso>
<C>
<C1>5.0</C1>
<C2>10.0</C2>
</C>
<gmodels>
<g1 type="ConstantGamma">
<g>100.0</g>
</g1>
<g2 type="ConstantGamma">
<g>100.0</g>
</g2>
</gmodels>
<A>
<A1>0.0</A1>
<A2>0.0</A2>
</A>
<a>
<a1>1.0</a1>
<a2>1.0</a2>
</a>
</hardening>
</flow>
</model>
</materials>
31 changes: 31 additions & 0 deletions test/tests/neml_regression/test5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<materials>
<model type="SmallStrainCreepPlasticity">
<elastic type="IsotropicLinearElasticModel">
<m1>150000.0</m1>
<m1_type>youngs</m1_type>
<m2>0.3</m2>
<m2_type>poissons</m2_type>
</elastic>
<plastic type="SmallStrainRateIndependentPlasticity">
<elastic type="IsotropicLinearElasticModel">
<m1>150000.0</m1>
<m1_type>youngs</m1_type>
<m2>0.3</m2>
<m2_type>poissons</m2_type>
</elastic>
<flow type="RateIndependentAssociativeFlow">
<surface type="IsoJ2"/>
<hardening type="LinearIsotropicHardeningRule">
<s0>200.0</s0>
<K>3000.0</K>
</hardening>
</flow>
</plastic>
<creep type="J2CreepModel">
<rule type="PowerLawCreep">
<A>1.85e-10</A>
<n>2.5</n>
</rule>
</creep>
</model>
</materials>
Loading

0 comments on commit 17832dd

Please sign in to comment.