Permalink
Browse files

Merge pull request #12801 from dschwen/green-lagrange_12787

Add Green-Lagrange strain calculator
  • Loading branch information...
lindsayad committed Feb 4, 2019
2 parents 377deb6 + 61ca1dd commit 14adc308420e40bb677ce074aa7b9b8d28117ba8
@@ -168,6 +168,7 @@ ADKernel<compute_stage>::computeOffDiagJacobian(MooseVariableFEBase & jvar)
if (_local_ke.m() != _test.size() || _local_ke.n() != jvar.phiSize())
return;

precalculateResidual();
for (_i = 0; _i < _test.size(); _i++)
{
for (_qp = 0; _qp < _qrule->n_points(); _qp++)
@@ -0,0 +1,22 @@
# ADComputeGreenLagrangeStrain

!syntax description /ADMaterials/ADComputeGreenLagrangeStrain<RESIDUAL>

The Green-Lagrange strain $E$ is a non-linear total strain

$$
E=\frac12 \left(F^TF-1\right)
$$

Where $F$ is the deformation gradient tensor. It can be combined with
ADComputeLinearElasticStress to compute a second Piola-Kirchhoff stress (use teh
ADStressDivergence kernel on the *undisplaced* mesh). This combinations is
called a St. Venant-Kirchhoff hyper elasticity model.

!syntax parameters /ADMaterials/ADComputeGreenLagrangeStrain<RESIDUAL>

!syntax inputs /ADMaterials/ADComputeGreenLagrangeStrain<RESIDUAL>

!syntax children /ADMaterials/ADComputeGreenLagrangeStrain<RESIDUAL>

!bibtex bibliography
@@ -0,0 +1,127 @@
[Mesh]
type = GeneratedMesh
dim = 3
nx = 5
ny = 5
nz = 5
use_displaced_mesh = false
[]

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

[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]

[Functions]
[./top_displacement]
type = ParsedFunction
value = t
[../]
[]

[BCs]
[./bottom_x]
type = PresetBC
variable = 'disp_x'
boundary = bottom
value = 0
[../]
[./bottom_y]
type = PresetBC
variable = 'disp_y'
boundary = bottom
value = 0
[../]
[./bottom_z]
type = PresetBC
variable = 'disp_z'
boundary = bottom
value = 0
[../]

[./top_x]
type = PresetBC
variable = 'disp_x'
boundary = top
value = 0
[../]
[./top_y]
type = FunctionPresetBC
variable = 'disp_y'
boundary = top
function = top_displacement
[../]
[./top_z]
type = PresetBC
variable = 'disp_z'
boundary = top
value = 0
[../]
[]

[ADKernels]
[./x]
type = ADStressDivergenceTensors
variable = disp_x
component = 0
[../]
[./y]
type = ADStressDivergenceTensors
variable = disp_y
component = 1
[../]
[./z]
type = ADStressDivergenceTensors
variable = disp_z
component = 2
[../]
[]

[Materials]
[./rubber_elasticity]
type = ComputeIsotropicElasticityTensor
# lambda = 1.2e7
# shear_modulus = 1.2e7
youngs_modulus = 1
poissons_ratio = 0.45 # the closer this gets to 0.5 the worse the problem becomes
[../]
[]

[ADMaterials]
[./strain]
type = ADComputeGreenLagrangeStrain
[../]
[./stress]
type = ADComputeLinearElasticStress
[../]
[]

[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]

[Executioner]
type = Transient
solve_type = NEWTON
dt = 0.05
dtmin = 0.05
nl_abs_tol = 1e-10
num_steps = 500
[]

[Outputs]
execute_on = 'INITIAL TIMESTEP_END'
exodus = true
print_linear_residuals = false
[]
@@ -0,0 +1,35 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef ADCOMPUTEGREENLAGRANGESTRAIN_H
#define ADCOMPUTEGREENLAGRANGESTRAIN_H

#include "ADComputeStrainBase.h"

template <ComputeStage>
class ADComputeGreenLagrangeStrain;

declareADValidParams(ADComputeGreenLagrangeStrain);

/**
* ADComputeGreenLagrangeStrain defines a non-linear Green-Lagrange strain tensor
*/
template <ComputeStage compute_stage>
class ADComputeGreenLagrangeStrain : public ADComputeStrainBase<compute_stage>
{
public:
ADComputeGreenLagrangeStrain(const InputParameters & parameters);

protected:
virtual void computeProperties() override;

usingComputeStrainBaseMembers;
};

#endif // ADCOMPUTEGREENLAGRANGESTRAIN_H
@@ -0,0 +1,47 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "ADComputeGreenLagrangeStrain.h"
#include "libmesh/quadrature.h"

registerADMooseObject("TensorMechanicsApp", ADComputeGreenLagrangeStrain);

defineADValidParams(ADComputeGreenLagrangeStrain,
ADComputeStrainBase,
params.addClassDescription("Compute a Green-Lagrange strain."););

template <ComputeStage compute_stage>
ADComputeGreenLagrangeStrain<compute_stage>::ADComputeGreenLagrangeStrain(
const InputParameters & parameters)
: ADComputeStrainBase<compute_stage>(parameters)
{
// error out if unsupported features are to be used
if (_global_strain)
paramError("global_strain",
"Global strain (periodicity) is not yet supported for Green-Lagrange strains");
if (!_eigenstrains.empty())
paramError("eigenstrain_names",
"Eigenstrains are not yet supported for Green-Lagrange strains");
if (_volumetric_locking_correction)
paramError("volumetric_locking_correction",
"Volumetric locking correction is not implemented for Green-Lagrange strains");
}

template <ComputeStage compute_stage>
void
ADComputeGreenLagrangeStrain<compute_stage>::computeProperties()
{
for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
{
ADRankTwoTensor dxu((*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
ADRankTwoTensor dxuT = dxu.transpose();

_mechanical_strain[_qp] = _total_strain[_qp] = (dxuT + dxu + dxuT * dxu) / 2.0;
}
}
@@ -0,0 +1,99 @@
[Mesh]
type = GeneratedMesh
dim = 3
nx = 3
ny = 3
nz = 4
[]

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

[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[]

[ADKernels]
[./stress_x]
type = ADStressDivergenceTensors
component = 0
variable = disp_x
[../]
[./stress_y]
type = ADStressDivergenceTensors
component = 1
variable = disp_y
[../]
[./stress_z]
type = ADStressDivergenceTensors
component = 2
variable = disp_z
[../]
[]

[BCs]
[./symmy]
type = PresetBC
variable = disp_y
boundary = back
value = 0
[../]
[./symmx]
type = PresetBC
variable = disp_x
boundary = back
value = 0
[../]
[./symmz]
type = PresetBC
variable = disp_z
boundary = back
value = 0
[../]
[./tdisp]
type = PresetBC
variable = disp_z
boundary = front
value = 0.3
[../]
[]

[Materials]
[./elasticity]
type = ComputeIsotropicElasticityTensor
poissons_ratio = 0.45
youngs_modulus = 1
[../]
[]

[ADMaterials]
[./strain]
type = ADComputeGreenLagrangeStrain
[../]
[./stress]
type = ADComputeLinearElasticStress
[../]
[]

[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]

[Executioner]
type = Steady
solve_type = 'NEWTON'
[]

[Outputs]
execute_on = 'FINAL'
exodus = true
[]
@@ -25,4 +25,21 @@
difference_tol = 1e6 # We have Young's modulus of 1e9 so finite differencing produces a large number
requirement = 'The Jacobian for the hand-coded problem shall be perfect'
[../]

[./green-lagrange]
type = 'Exodiff'
input = 'green-lagrange.i'
exodiff = 'green-lagrange_out.e'
requirement = 'MOOSE shall provide an AD enabled Green-Lagrange strain calculator'
allow_test_objects = true
[../]
[./green-lagrange-jac]
type = 'PetscJacobianTester'
input = 'green-lagrange.i'
run_sim = 'True'
prereq = 'green-lagrange'
ratio_tol = 1e-7
difference_tol = 1e-6
requirement = 'The Jacobian for the Green-Lagrange strain calculator shall be perfect'
[../]
[]

0 comments on commit 14adc30

Please sign in to comment.