www.mooseframework.org
PorousFlowPorosityHMBiotModulus.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "libmesh/utility.h"
12 
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<PorousFlowPorosity>();
20  params.set<bool>("mechanical") = true;
21  params.set<bool>("fluid") = true;
22  params.addRequiredRangeCheckedParam<Real>("constant_biot_modulus",
23  "constant_biot_modulus>0",
24  "Biot modulus, which is constant for this Material");
25  params.addRequiredRangeCheckedParam<Real>(
26  "constant_fluid_bulk_modulus",
27  "constant_fluid_bulk_modulus>0",
28  "Fluid bulk modulus, which is constant for this Material");
29  params.addClassDescription(
30  "This Material calculates the porosity for hydro-mechanical simulations, assuming that the "
31  "Biot modulus and the fluid bulk modulus are both constant. This is useful for comparing "
32  "with solutions from poroelasticity theory, but is less accurate than PorousFlowPorosity");
33  return params;
34 }
35 
37  : PorousFlowPorosity(parameters),
38  _porosity_old(_nodal_material ? getMaterialPropertyOld<Real>("PorousFlow_porosity_nodal")
39  : getMaterialPropertyOld<Real>("PorousFlow_porosity_qp")),
40  _biot_modulus(getParam<Real>("constant_biot_modulus")),
41  _fluid_bulk_modulus(getParam<Real>("constant_fluid_bulk_modulus")),
42  _pf_old(_nodal_material
43  ? getMaterialPropertyOld<Real>("PorousFlow_effective_fluid_pressure_nodal")
44  : getMaterialPropertyOld<Real>("PorousFlow_effective_fluid_pressure_qp")),
45  _vol_strain_qp_old(getMaterialPropertyOld<Real>("PorousFlow_total_volumetric_strain_qp")),
46  _vol_strain_rate_qp(getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
47  _dvol_strain_rate_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
48  "dPorousFlow_volumetric_strain_rate_qp_dvar"))
49 {
50 }
51 
52 void
54 {
55  // Note that in the following _strain[_qp] is evaluated at q quadpoint
56  // So _porosity_nodal[_qp], which should be the nodal value of porosity
57  // actually uses the strain at a quadpoint. This
58  // is OK for LINEAR elements, as strain is constant over the element anyway.
59 
60  const unsigned qp_to_use =
61  (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
62 
63  const Real denom = 1.0 + _vol_strain_rate_qp[qp_to_use] * _dt;
64  _porosity[_qp] =
65  (_porosity_old[_qp] * std::exp(-((*_pf)[_qp] - _pf_old[_qp]) / _fluid_bulk_modulus) +
66  ((*_pf)[_qp] - _pf_old[_qp]) / _biot_modulus +
67  _biot * ((*_vol_strain_qp)[qp_to_use] - _vol_strain_qp_old[qp_to_use])) /
68  denom;
69 
70  _dporosity_dvar[_qp].resize(_num_var);
71  for (unsigned int v = 0; v < _num_var; ++v)
72  _dporosity_dvar[_qp][v] =
73  (*_dpf_dvar)[_qp][v] *
74  (-_porosity_old[_qp] * std::exp(-((*_pf)[_qp] - _pf_old[_qp]) / _fluid_bulk_modulus) /
76  1.0 / _biot_modulus) /
77  denom;
78 
79  _dporosity_dgradvar[_qp].resize(_num_var);
80  for (unsigned int v = 0; v < _num_var; ++v)
81  _dporosity_dgradvar[_qp][v] =
82  _biot * (*_dvol_strain_qp_dvar)[qp_to_use][v] / denom -
83  _porosity[_qp] / denom * _dvol_strain_rate_qp_dvar[qp_to_use][v] * _dt;
84 }
const MaterialProperty< Real > & _porosity_old
Old value of porosity.
VectorValue< Real > RealGradient
PorousFlowPorosityHMBiotModulus(const InputParameters &parameters)
const Real _biot
Biot coefficient.
registerMooseObject("PorousFlowApp", PorousFlowPorosityHMBiotModulus)
const MaterialProperty< Real > & _pf_old
Old value of effective fluid pressure.
const bool _strain_at_nearest_qp
When calculating nodal porosity, use the strain at the nearest quadpoint to the node.
MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable)
InputParameters validParams< PorousFlowPorosity >()
MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable)
const Real _fluid_bulk_modulus
Constant fluid bulk modulus.
const MaterialProperty< Real > *const _pf
Effective porepressure at the quadpoints or nodes.
const MaterialProperty< std::vector< Real > > *const _dpf_dvar
d(effective porepressure)/(d porflow variable)
InputParameters validParams< PorousFlowPorosityHMBiotModulus >()
const MaterialProperty< Real > & _vol_strain_qp_old
Old value of total volumetric strain.
const MaterialProperty< std::vector< RealGradient > > & _dvol_strain_rate_qp_dvar
d(volumetric strain rate)/d(PorousFlow variable)
This Matrial evolves porosity so that the PorousFlow equations match the standard equations of poroel...
MaterialProperty< Real > & _porosity
Computed porosity at the nodes or quadpoints.
const unsigned int _num_var
Number of PorousFlow variables.
const MaterialProperty< Real > & _vol_strain_rate_qp
Volumetric strain rate.
Material designed to provide the porosity in PorousFlow simulations chemistry + biot + (phi0 - refere...
const Real _biot_modulus
Constant biot modulus.
const MaterialProperty< std::vector< RealGradient > > *const _dvol_strain_qp_dvar
d(strain)/(dvar) (first const means we never want to dereference and change the value, second means we&#39;ll always be pointing to the same address after initialization (like a reference))
const MaterialProperty< Real > *const _vol_strain_qp
Strain (first const means we never want to dereference and change the value, second means we&#39;ll alway...