www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowVolumetricStrain Class Reference

PorousFlowVolumetricStrain computes volumetric strains, and derivatives thereof. More...

#include <PorousFlowVolumetricStrain.h>

Inheritance diagram for PorousFlowVolumetricStrain:
[legend]

Public Member Functions

 PorousFlowVolumetricStrain (const InputParameters &parameters)
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const bool _consistent
 If true then the strain rate will include terms that ensure mass is conserved when doing integrals over the displaced mesh. More...
 
const unsigned int _ndisp
 Number of displacements supplied (1 in 1D, 2 in 2D, 3 in 3D) More...
 
std::vector< const VariableValue * > _disp
 Displacement variable values at the quad point. More...
 
std::vector< unsigned int > _disp_var_num
 MOOSE variable number of the displacements variables provided. More...
 
std::vector< const VariableGradient * > _grad_disp
 Gradient of the displacements. More...
 
std::vector< const VariableGradient * > _grad_disp_old
 Old value of gradient of the displacements. More...
 
MaterialProperty< Real > & _vol_strain_rate_qp
 The volumetric strain rate at the quadpoints. More...
 
MaterialProperty< std::vector< RealGradient > > & _dvol_strain_rate_qp_dvar
 The derivative of the volumetric strain rate with respect to the porous flow variables. More...
 
MaterialProperty< Real > & _vol_total_strain_qp
 The total volumetric strain at the quadpoints. More...
 
MaterialProperty< std::vector< RealGradient > > & _dvol_total_strain_qp_dvar
 The derivative of the total volumetric strain with respect to the porous flow variables. More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of fluid components. More...
 
const unsigned int _num_var
 Number of PorousFlow variables. More...
 

Detailed Description

PorousFlowVolumetricStrain computes volumetric strains, and derivatives thereof.

Definition at line 24 of file PorousFlowVolumetricStrain.h.

Constructor & Destructor Documentation

◆ PorousFlowVolumetricStrain()

PorousFlowVolumetricStrain::PorousFlowVolumetricStrain ( const InputParameters &  parameters)

Definition at line 39 of file PorousFlowVolumetricStrain.C.

40  : PorousFlowMaterialVectorBase(parameters),
41  _consistent(getParam<bool>("consistent_with_displaced_mesh")),
42  _ndisp(coupledComponents("displacements")),
43  _disp(3),
44  _disp_var_num(3),
45  _grad_disp(3),
46  _grad_disp_old(3),
47 
48  _vol_strain_rate_qp(declareProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
50  declareProperty<std::vector<RealGradient>>("dPorousFlow_volumetric_strain_rate_qp_dvar")),
51  _vol_total_strain_qp(declareProperty<Real>("PorousFlow_total_volumetric_strain_qp")),
53  declareProperty<std::vector<RealGradient>>("dPorousFlow_total_volumetric_strain_qp_dvar"))
54 {
55  if (_ndisp != _mesh.dimension())
56  paramError("displacements", "The number of variables supplied must match the mesh dimension.");
57 
58  // fetch coupled variables and gradients (as stateful properties if necessary)
59  for (unsigned int i = 0; i < _ndisp; ++i)
60  {
61  _disp[i] = &coupledValue("displacements", i);
62  _disp_var_num[i] = coupled("displacements", i);
63  _grad_disp[i] = &coupledGradient("displacements", i);
64  _grad_disp_old[i] = &coupledGradientOld("displacements", i);
65  }
66 
67  // set unused dimensions to zero
68  for (unsigned i = _ndisp; i < 3; ++i)
69  {
70  _disp[i] = &_zero;
71  _disp_var_num[i] = 0;
72  while (_dictator.isPorousFlowVariable(_disp_var_num[i]))
73  _disp_var_num[i]++; // increment until disp_var_num[i] is not a porflow var
74  _grad_disp[i] = &_grad_zero;
75  _grad_disp_old[i] = &_grad_zero;
76  }
77  if (_nodal_material == true)
78  mooseError("PorousFlowVolumetricStrain classes are only defined for at_nodes = false");
79 }
MaterialProperty< std::vector< RealGradient > > & _dvol_strain_rate_qp_dvar
The derivative of the volumetric strain rate with respect to the porous flow variables.
std::vector< const VariableGradient * > _grad_disp_old
Old value of gradient of the displacements.
const unsigned int _ndisp
Number of displacements supplied (1 in 1D, 2 in 2D, 3 in 3D)
MaterialProperty< Real > & _vol_total_strain_qp
The total volumetric strain at the quadpoints.
std::vector< const VariableValue * > _disp
Displacement variable values at the quad point.
MaterialProperty< Real > & _vol_strain_rate_qp
The volumetric strain rate at the quadpoints.
MaterialProperty< std::vector< RealGradient > > & _dvol_total_strain_qp_dvar
The derivative of the total volumetric strain with respect to the porous flow variables.
PorousFlowMaterialVectorBase(const InputParameters &parameters)
std::vector< const VariableGradient * > _grad_disp
Gradient of the displacements.
const bool _consistent
If true then the strain rate will include terms that ensure mass is conserved when doing integrals ov...
std::vector< unsigned int > _disp_var_num
MOOSE variable number of the displacements variables provided.

Member Function Documentation

◆ computeQpProperties()

void PorousFlowVolumetricStrain::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 88 of file PorousFlowVolumetricStrain.C.

89 {
90  RankTwoTensor A(
91  (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]); // Deformation gradient
92  RankTwoTensor Fbar((*_grad_disp_old[0])[_qp],
93  (*_grad_disp_old[1])[_qp],
94  (*_grad_disp_old[2])[_qp]); // Old Deformation gradient
95 
96  _vol_total_strain_qp[_qp] = A.trace();
97 
98  A -= Fbar; // A = grad_disp - grad_disp_old
99 
100  RankTwoTensor total_strain_increment = 0.5 * (A + A.transpose());
101  const Real andy = (_consistent ? 1.0 + (*_grad_disp_old[0])[_qp](0) +
102  (*_grad_disp_old[1])[_qp](1) + (*_grad_disp_old[2])[_qp](2)
103  : 1.0);
104  _vol_strain_rate_qp[_qp] = total_strain_increment.trace() / _dt / andy;
105 
106  // prepare the derivatives with zeroes
107  _dvol_strain_rate_qp_dvar[_qp].resize(_num_var, RealGradient());
108  _dvol_total_strain_qp_dvar[_qp].resize(_num_var, RealGradient());
109  for (unsigned i = 0; i < _ndisp; ++i)
110  if (_dictator.isPorousFlowVariable(_disp_var_num[i]))
111  {
112  // the i_th displacement is a PorousFlow variable
113  const unsigned int pvar = _dictator.porousFlowVariableNum(_disp_var_num[i]);
114  _dvol_strain_rate_qp_dvar[_qp][pvar](i) = 1.0 / _dt / andy;
115  _dvol_total_strain_qp_dvar[_qp][pvar](i) = 1.0;
116  }
117 }
MaterialProperty< std::vector< RealGradient > > & _dvol_strain_rate_qp_dvar
The derivative of the volumetric strain rate with respect to the porous flow variables.
std::vector< const VariableGradient * > _grad_disp_old
Old value of gradient of the displacements.
const unsigned int _ndisp
Number of displacements supplied (1 in 1D, 2 in 2D, 3 in 3D)
MaterialProperty< Real > & _vol_total_strain_qp
The total volumetric strain at the quadpoints.
MaterialProperty< Real > & _vol_strain_rate_qp
The volumetric strain rate at the quadpoints.
MaterialProperty< std::vector< RealGradient > > & _dvol_total_strain_qp_dvar
The derivative of the total volumetric strain with respect to the porous flow variables.
const unsigned int _num_var
Number of PorousFlow variables.
std::vector< const VariableGradient * > _grad_disp
Gradient of the displacements.
const bool _consistent
If true then the strain rate will include terms that ensure mass is conserved when doing integrals ov...
std::vector< unsigned int > _disp_var_num
MOOSE variable number of the displacements variables provided.

◆ initQpStatefulProperties()

void PorousFlowVolumetricStrain::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 82 of file PorousFlowVolumetricStrain.C.

83 {
84  _vol_total_strain_qp[_qp] = 0.0;
85 }
MaterialProperty< Real > & _vol_total_strain_qp
The total volumetric strain at the quadpoints.

Member Data Documentation

◆ _consistent

const bool PorousFlowVolumetricStrain::_consistent
protected

If true then the strain rate will include terms that ensure mass is conserved when doing integrals over the displaced mesh.

Definition at line 34 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties().

◆ _disp

std::vector<const VariableValue *> PorousFlowVolumetricStrain::_disp
protected

Displacement variable values at the quad point.

Definition at line 40 of file PorousFlowVolumetricStrain.h.

Referenced by PorousFlowVolumetricStrain().

◆ _disp_var_num

std::vector<unsigned int> PorousFlowVolumetricStrain::_disp_var_num
protected

MOOSE variable number of the displacements variables provided.

Definition at line 43 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties(), and PorousFlowVolumetricStrain().

◆ _dvol_strain_rate_qp_dvar

MaterialProperty<std::vector<RealGradient> >& PorousFlowVolumetricStrain::_dvol_strain_rate_qp_dvar
protected

The derivative of the volumetric strain rate with respect to the porous flow variables.

Since the volumetric strain rate depends on derivatives of the displacement variables, this should be multiplied by _grad_phi in kernels

Definition at line 59 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties().

◆ _dvol_total_strain_qp_dvar

MaterialProperty<std::vector<RealGradient> >& PorousFlowVolumetricStrain::_dvol_total_strain_qp_dvar
protected

The derivative of the total volumetric strain with respect to the porous flow variables.

Since the total volumetric strain depends on derivatives of the displacement variables, this should be multiplied by _grad_phi in kernels

Definition at line 69 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties().

◆ _grad_disp

std::vector<const VariableGradient *> PorousFlowVolumetricStrain::_grad_disp
protected

Gradient of the displacements.

Definition at line 46 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties(), and PorousFlowVolumetricStrain().

◆ _grad_disp_old

std::vector<const VariableGradient *> PorousFlowVolumetricStrain::_grad_disp_old
protected

Old value of gradient of the displacements.

Definition at line 49 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties(), and PorousFlowVolumetricStrain().

◆ _ndisp

const unsigned int PorousFlowVolumetricStrain::_ndisp
protected

Number of displacements supplied (1 in 1D, 2 in 2D, 3 in 3D)

Definition at line 37 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties(), and PorousFlowVolumetricStrain().

◆ _num_components

const unsigned int PorousFlowMaterialVectorBase::_num_components
protectedinherited

◆ _num_phases

const unsigned int PorousFlowMaterialVectorBase::_num_phases
protectedinherited

◆ _num_var

const unsigned int PorousFlowMaterialVectorBase::_num_var
protectedinherited

◆ _vol_strain_rate_qp

MaterialProperty<Real>& PorousFlowVolumetricStrain::_vol_strain_rate_qp
protected

The volumetric strain rate at the quadpoints.

Definition at line 52 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties().

◆ _vol_total_strain_qp

MaterialProperty<Real>& PorousFlowVolumetricStrain::_vol_total_strain_qp
protected

The total volumetric strain at the quadpoints.

Definition at line 62 of file PorousFlowVolumetricStrain.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().


The documentation for this class was generated from the following files: