Permalink
Browse files

Merge pull request #12369 from bwspenc/volumetric_strain

Correctly compute volumetric_strain using logarithmic strains
  • Loading branch information...
jasondhales committed Nov 13, 2018
2 parents b1b213a + 52707d5 commit be8f876c750484f831201819d1af33e949056026
Showing with 620 additions and 51 deletions.
  1. +1 −2 modules/combined/test/tests/internal_volume/gold/rz_displaced_out.csv
  2. +2 −0 modules/solid_mechanics/include/utils/MaterialTensorCalculatorTools.h
  3. +16 −5 modules/solid_mechanics/src/utils/MaterialTensorCalculatorTools.C
  4. +1 −0 modules/solid_mechanics/test/tests/volumetric_eigenstrain/gold/volumetric_eigenstrain_out.csv
  5. +1 −0 modules/solid_mechanics/test/tests/volumetric_eigenstrain/gold/volumetric_mechanical_out.csv
  6. +25 −0 modules/solid_mechanics/test/tests/volumetric_eigenstrain/tests
  7. +153 −0 modules/solid_mechanics/test/tests/volumetric_eigenstrain/volumetric_eigenstrain.i
  8. +150 −0 modules/solid_mechanics/test/tests/volumetric_eigenstrain/volumetric_mechanical.i
  9. +28 −5 modules/tensor_mechanics/doc/content/source/auxkernels/RankTwoScalarAux.md
  10. +6 −4 modules/tensor_mechanics/doc/content/source/materials/ComputeVolumetricEigenstrain.md
  11. +5 −2 modules/tensor_mechanics/include/materials/ComputeEigenstrainBase.h
  12. +2 −0 modules/tensor_mechanics/include/utils/RankTwoScalarTools.h
  13. +12 −7 modules/tensor_mechanics/src/materials/ComputeEigenstrainBase.C
  14. +16 −8 modules/tensor_mechanics/src/utils/RankTwoScalarTools.C
  15. +4 −5 modules/tensor_mechanics/test/tests/volumetric_eigenstrain/gold/volumetric_eigenstrain_out.csv
  16. +1 −0 modules/tensor_mechanics/test/tests/volumetric_eigenstrain/gold/volumetric_mechanical_out.csv
  17. +16 −3 modules/tensor_mechanics/test/tests/volumetric_eigenstrain/tests
  18. +28 −10 modules/tensor_mechanics/test/tests/volumetric_eigenstrain/volumetric_eigenstrain.i
  19. +153 −0 modules/tensor_mechanics/test/tests/volumetric_eigenstrain/volumetric_mechanical.i
@@ -1,4 +1,3 @@
time,internalVolume,volStrain0,volStrain1
0,-1,0,0
1,-1.9999999952768,-0.13084129477981,1.046312560316
1,-1.9999999952768,0.63450420634496,1.3654957842087
@@ -54,6 +54,8 @@ Real hydrostatic(const SymmTensor & symm_tensor);
* The volumentric strain is the change in volume over the original volume. In
* this method the squared and cubic terms are included so that the calculation
* is valid for both small and finite strains.
* @param strain Total logarithmic strain
* @return volumetric strain (delta V / V)
*/
Real volumetricStrain(const SymmTensor & symm_strain);
@@ -69,11 +69,22 @@ hydrostatic(const SymmTensor & symm_tensor)
Real
volumetricStrain(const SymmTensor & symm_strain)
{
Real value = symm_strain.trace();
value += symm_strain.xx() * symm_strain.yy() + symm_strain.yy() * symm_strain.zz() +
symm_strain.zz() * symm_strain.xx() +
symm_strain.xx() * symm_strain.yy() * symm_strain.zz();
return value;
// Since the strains are logarithmic strains, which are by definition log(L/L0),
// exp(log_strain) = L/L0
// The ratio of the volume of a strained cube to the original volume is thus:
// exp(log_strain_11) * exp(log_strain_22) * exp(log_strain_33) - 1
//
// Since eng_strain = exp(log_strain) - 1, the equivalent calculation using
// engineering strains would be:
// (1 + eng_strain_11) * (1 + eng_strain_22) + (1 + eng_strain_33) - 1
// If strains are small, the resulting terms that involve squared and cubed
// strains are negligible, resulting in the following approximate form:
// strain_11 + strain_22 + strain_33
// There is not currently an option to compute this small-strain form of the
// volumetric strain, but at small strains, it is approximately equal to the
// finite strain form that is computed.
return std::exp(symm_strain.xx()) * std::exp(symm_strain.yy()) * std::exp(symm_strain.zz()) - 1.0;
}
Real
@@ -0,0 +1,25 @@
[Tests]
[./test]
type = 'CSVDiff'
input = 'volumetric_eigenstrain.i'
csvdiff = 'volumetric_eigenstrain_out.csv'
requirement = "The solid_mechanics system shall correctly apply a finite thermal strain"
" that results in a solution that exactly recovers the appropriate volumetric expansion,"
" and the reported volumetric strain computed by MaterialTensorAux shall match the"
" prescribed volumetric strain and match the results of an equivalent model in the"
" tensor_mechanics system."
design = "Elastic.md MaterialTensorAux.md"
issues = "#11743"
[../]
[./test_mechanical]
type = 'CSVDiff'
input = 'volumetric_mechanical.i'
csvdiff = 'volumetric_mechanical_out.csv'
prereq = test
requirement = "The volumetric strain computed using MaterialTensorAux for a unit cube with imposed"
" displacements shall be identical to that obtained by imposing an eigenstrain that"
" causes the same deformation of that model."
design = "MaterialTensorAux.md"
issues = "#11743"
[../]
[]
@@ -0,0 +1,153 @@
# This tests the ability of the SolidMechanics system to exactly recover
# a specified volumetric expansion.
# This model applies volumetric strain that ramps from 0 to 2 to a unit cube
# and computes the final volume, which should be exactly 3. Note that the default
# Taylor expansion option for increment_calculation gives a small (~4%) error
# with this very large incremental strain, but increment_calculation = Eigen
# gives the exact solution.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[AuxVariables]
[./volumetric_strain]
order = CONSTANT
family = MONOMIAL
[../]
[./temp]
initial_condition = 0
[../]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[SolidMechanics]
[./solid]
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
[../]
[]
[AuxKernels]
[./volumetric_strain]
type = MaterialTensorAux
tensor = total_strain
variable = volumetric_strain
quantity = VolumetricStrain
[../]
[./temp]
type = FunctionAux
variable = temp
function = pres_temp
[../]
[]
[Functions]
[pres_temp]
type = PiecewiseLinear
# Because SolidMechanics does not offer a way to directly prescribe the
# volumetric eigenstrain, we do this by prescribing a thermal strain. The
# CTE of the material is set to 1, so the numbers here are the linear strains
# that are applied. The engineering linear strains that give a volumetric
# strain equal to 1 at time 1 and 2 at time 2 are commented out below. These
# are converted to log strains as log(1+linear_strain):
xy_data = '0 0
1 0.23104906018664598
2 0.3662040962227044'
# Linear strains that these are computed from:
# xy_data = '0 0
# 1 0.25992104989487
# 2 0.44224957030741'
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./back]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[../]
[]
[Materials]
[./linelast]
type = Elastic
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
poissons_ratio = 0.3
youngs_modulus = 1e6
increment_calculation = Eigen
block = 0
thermal_expansion = 1.0
stress_free_temperature = 0.0
temp = temp
[../]
[]
[Postprocessors]
[./vol]
type = VolumePostprocessor
use_displaced_mesh = true
execute_on = 'initial timestep_end'
[../]
[./volumetric_strain]
type = ElementalVariableValue
variable = volumetric_strain
elementid = 0
[../]
[./disp_right]
type = NodalMaxValue
variable = disp_x
boundary = right
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
l_max_its = 100
l_tol = 1e-4
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
start_time = 0.0
end_time = 2.0
dt = 1.0
[]
[Outputs]
exodus = true
csv = true
[]
@@ -0,0 +1,150 @@
# This test ensures that the reported volumetric strain for a cube with
# mechanically imposed displacements (through Dirichlet BCs) exactly
# matches that from a version of this test that experiences the same
# defomation, but due to imposed eigenstrains.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]
[AuxVariables]
[./volumetric_strain]
order = CONSTANT
family = MONOMIAL
[../]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[SolidMechanics]
[./solid]
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
[../]
[]
[AuxKernels]
[./volumetric_strain]
type = MaterialTensorAux
tensor = total_strain
variable = volumetric_strain
quantity = VolumetricStrain
[../]
[]
[Functions]
[pres_disp]
type = PiecewiseLinear
# These values are taken from the displacements in the eigenstrain
# version of this test. The volume of the cube (which starts out as
# a 1x1x1 cube) is (1 + disp)^3. At time 2, this is
# (1.44224957030741)^3, which is 3.0.
xy_data = '0 0
1 0.25992104989487
2 0.44224957030741'
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./bottom]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./back]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[../]
[./right]
type = FunctionPresetBC
variable = disp_x
boundary = right
function = pres_disp
[../]
[./top]
type = FunctionPresetBC
variable = disp_y
boundary = top
function = pres_disp
[../]
[./front]
type = FunctionPresetBC
variable = disp_z
boundary = front
function = pres_disp
[../]
[]
[Materials]
[./linelast]
type = Elastic
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
poissons_ratio = 0.3
youngs_modulus = 1e6
increment_calculation = Eigen
block = 0
[../]
[]
[Postprocessors]
[./vol]
type = VolumePostprocessor
use_displaced_mesh = true
execute_on = 'initial timestep_end'
[../]
[./volumetric_strain]
type = ElementalVariableValue
variable = volumetric_strain
elementid = 0
[../]
[./disp_right]
type = NodalMaxValue
variable = disp_x
boundary = right
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
l_max_its = 100
l_tol = 1e-4
nl_abs_tol = 1e-8
nl_rel_tol = 1e-12
start_time = 0.0
end_time = 2.0
dt = 1.0
[]
[Outputs]
exodus = true
csv = true
[]
Oops, something went wrong.

0 comments on commit be8f876

Please sign in to comment.