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

Material designed to calculate fluid-phase porepressure and saturation for the single-phase situation, assuming a Gaussian capillary suction function and assuming the independent variable is log(mass density) and assuming the fluid has a constant bulk modulus. More...

#include <PorousFlow1PhaseMD_Gaussian.h>

Inheritance diagram for PorousFlow1PhaseMD_Gaussian:
[legend]

Public Member Functions

 PorousFlow1PhaseMD_Gaussian (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

const Real _al
 Gaussian parameter: saturation = exp(-(al*p)^2) More...
 
const Real _al2
 _al2 = al*al More...
 
const Real _logdens0
 fluid density = _dens0*exp(P/_bulk) More...
 
const Real _bulk
 fluid density = _dens0*exp(P/_bulk) More...
 
const Real _recip_bulk
 1/_bulk/_al More...
 
const Real _recip_bulk2
 (1/_bulk)^2 More...
 
const VariableValue & _md_var
 Nodal or quadpoint value of mass-density of the fluid phase. More...
 
const VariableGradient & _gradmd_qp_var
 Gradient(_mass-density at quadpoints) More...
 
const unsigned int _md_varnum
 Moose variable number of the mass-density. More...
 
const unsigned int _pvar
 PorousFlow variable number of the mass-density. More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of components. More...
 
const unsigned int _num_pf_vars
 Number of PorousFlow variables. More...
 
MaterialProperty< std::vector< Real > > & _porepressure
 Computed nodal or quadpoint values of porepressure of the phases. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
 d(porepressure)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > *const _gradp_qp
 Grad(p) at the quadpoints. More...
 
MaterialProperty< std::vector< std::vector< Real > > > *const _dgradp_qp_dgradv
 d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgradp_qp_dv
 d(grad porepressure)/d(PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< Real > > & _saturation
 Computed nodal or qp saturation of the phases. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
 d(saturation)/d(PorousFlow variable) More...
 
MaterialProperty< std::vector< RealGradient > > *const _grads_qp
 Grad(s) at the quadpoints. More...
 
MaterialProperty< std::vector< std::vector< Real > > > *const _dgrads_qp_dgradv
 d(grad saturation)/d(grad PorousFlow variable) at the quadpoints More...
 
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgrads_qp_dv
 d(grad saturation)/d(PorousFlow variable) at the quadpoints More...
 

Detailed Description

Material designed to calculate fluid-phase porepressure and saturation for the single-phase situation, assuming a Gaussian capillary suction function and assuming the independent variable is log(mass density) and assuming the fluid has a constant bulk modulus.

Definition at line 25 of file PorousFlow1PhaseMD_Gaussian.h.

Constructor & Destructor Documentation

PorousFlow1PhaseMD_Gaussian::PorousFlow1PhaseMD_Gaussian ( const InputParameters &  parameters)

Definition at line 34 of file PorousFlow1PhaseMD_Gaussian.C.

35  : PorousFlowVariableBase(parameters),
36 
37  _al(getParam<Real>("al")),
38  _al2(std::pow(_al, 2)),
39  _logdens0(std::log(getParam<Real>("density_P0"))),
40  _bulk(getParam<Real>("bulk_modulus")),
41  _recip_bulk(1.0 / _al / _bulk),
43 
44  _md_var(_nodal_material ? coupledNodalValue("mass_density") : coupledValue("mass_density")),
45  _gradmd_qp_var(coupledGradient("mass_density")),
46  _md_varnum(coupled("mass_density")),
47  _pvar(_dictator.isPorousFlowVariable(_md_varnum) ? _dictator.porousFlowVariableNum(_md_varnum)
48  : 0)
49 {
50  if (_num_phases != 1)
51  mooseError("The Dictator proclaims that the number of phases is ",
52  _dictator.numPhases(),
53  " whereas PorousFlow1PhaseMD_Gaussian can only be used for 1-phase simulations. Be "
54  "aware that the Dictator has noted your mistake.");
55 }
const unsigned int _md_varnum
Moose variable number of the mass-density.
const Real _al
Gaussian parameter: saturation = exp(-(al*p)^2)
const Real _logdens0
fluid density = _dens0*exp(P/_bulk)
const unsigned int _pvar
PorousFlow variable number of the mass-density.
PorousFlowVariableBase(const InputParameters &parameters)
const VariableValue & _md_var
Nodal or quadpoint value of mass-density of the fluid phase.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const unsigned int _num_phases
Number of phases.
const Real _bulk
fluid density = _dens0*exp(P/_bulk)
const VariableGradient & _gradmd_qp_var
Gradient(_mass-density at quadpoints)

Member Function Documentation

void PorousFlow1PhaseMD_Gaussian::buildPS ( )
protectedvirtual

Definition at line 135 of file PorousFlow1PhaseMD_Gaussian.C.

Referenced by computeQpProperties(), and initQpStatefulProperties().

136 {
137  if (_md_var[_qp] >= _logdens0)
138  {
139  // full saturation
140  _porepressure[_qp][0] = (_md_var[_qp] - _logdens0) * _bulk;
141  _saturation[_qp][0] = 1.0;
142  }
143  else
144  {
145  // v = logdens0 + p/bulk - (al p)^2
146  // 0 = (v-logdens0) - p/bulk + (al p)^2
147  // 2 al p = (1/al/bulk) +/- sqrt((1/al/bulk)^2 - 4(v-logdens0)) (the "minus" sign is chosen)
148  // s = exp(-(al*p)^2)
149  _porepressure[_qp][0] =
150  (_recip_bulk - std::sqrt(_recip_bulk2 + 4.0 * (_logdens0 - _md_var[_qp]))) / (2.0 * _al);
151  _saturation[_qp][0] = std::exp(-std::pow(_al * _porepressure[_qp][0], 2.0));
152  }
153 }
const Real _al
Gaussian parameter: saturation = exp(-(al*p)^2)
const Real _logdens0
fluid density = _dens0*exp(P/_bulk)
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
const VariableValue & _md_var
Nodal or quadpoint value of mass-density of the fluid phase.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _bulk
fluid density = _dens0*exp(P/_bulk)
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
void PorousFlow1PhaseMD_Gaussian::computeQpProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 65 of file PorousFlow1PhaseMD_Gaussian.C.

66 {
67  // size stuff correctly and prepare the derivative matrices with zeroes
69 
70  buildPS();
71 
72  if (!_nodal_material)
73  {
74  if (_md_var[_qp] >= _logdens0)
75  {
76  (*_gradp_qp)[_qp][0] = _gradmd_qp_var[_qp] * _bulk;
77  (*_grads_qp)[_qp][0] = 0.0;
78  }
79  else
80  {
81  (*_gradp_qp)[_qp][0] =
82  _gradmd_qp_var[_qp] / (_recip_bulk - 2.0 * _al * _porepressure[_qp][0]) / _al;
83  (*_grads_qp)[_qp][0] =
84  -2.0 * _al2 * _porepressure[_qp][0] * _saturation[_qp][0] * (*_gradp_qp)[_qp][0];
85  }
86  }
87 
88  if (_dictator.notPorousFlowVariable(_md_varnum))
89  return;
90 
91  if (_md_var[_qp] >= _logdens0)
92  {
93  // fully saturated at the node or quadpoint
94  _dporepressure_dvar[_qp][0][_pvar] = _bulk;
95  _dsaturation_dvar[_qp][0][_pvar] = 0.0;
96  }
97  else
98  {
99  const Real pp = _porepressure[_qp][0];
100  _dporepressure_dvar[_qp][0][_pvar] = 1.0 / (_recip_bulk - 2.0 * _al * pp) / _al;
101  const Real sat = _saturation[_qp][0];
102  _dsaturation_dvar[_qp][0][_pvar] = -2.0 * _al2 * pp * sat * _dporepressure_dvar[_qp][0][_pvar];
103  }
104 
105  if (!_nodal_material)
106  {
107  if (_md_var[_qp] >= _logdens0)
108  {
109  // fully saturated at the quadpoint
110  (*_dgradp_qp_dgradv)[_qp][0][_pvar] = _bulk;
111  (*_dgradp_qp_dv)[_qp][0][_pvar] = 0.0;
112  (*_dgrads_qp_dgradv)[_qp][0][_pvar] = 0.0;
113  (*_dgrads_qp_dv)[_qp][0][_pvar] = 0.0;
114  }
115  else
116  {
117  const Real pp = _porepressure[_qp][0];
118  (*_dgradp_qp_dgradv)[_qp][0][_pvar] = 1.0 / (_recip_bulk - 2.0 * _al * pp) / _al;
119  (*_dgradp_qp_dv)[_qp][0][_pvar] = _gradmd_qp_var[_qp] * 2.0 * _al *
120  _dporepressure_dvar[_qp][0][_pvar] /
121  std::pow(_recip_bulk - 2.0 * _al * pp, 2.0) / _al;
122  const Real sat = _saturation[_qp][0];
123  (*_dgrads_qp_dgradv)[_qp][0][_pvar] =
124  -2.0 * _al2 * pp * sat * (*_dgradp_qp_dgradv)[_qp][0][_pvar];
125  (*_dgrads_qp_dv)[_qp][0][_pvar] =
126  -2.0 * _al2 * _dporepressure_dvar[_qp][0][_pvar] * sat * (*_gradp_qp)[_qp][0];
127  (*_dgrads_qp_dv)[_qp][0][_pvar] +=
128  -2.0 * _al2 * pp * _dsaturation_dvar[_qp][0][_pvar] * (*_gradp_qp)[_qp][0];
129  (*_dgrads_qp_dv)[_qp][0][_pvar] += -2.0 * _al2 * pp * sat * (*_dgradp_qp_dv)[_qp][0][_pvar];
130  }
131  }
132 }
const unsigned int _md_varnum
Moose variable number of the mass-density.
const Real _al
Gaussian parameter: saturation = exp(-(al*p)^2)
const Real _logdens0
fluid density = _dens0*exp(P/_bulk)
const unsigned int _pvar
PorousFlow variable number of the mass-density.
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
d(saturation)/d(PorousFlow variable)
virtual void computeQpProperties() override
const VariableValue & _md_var
Nodal or quadpoint value of mass-density of the fluid phase.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real _bulk
fluid density = _dens0*exp(P/_bulk)
const VariableGradient & _gradmd_qp_var
Gradient(_mass-density at quadpoints)
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
void PorousFlow1PhaseMD_Gaussian::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented from PorousFlowVariableBase.

Definition at line 58 of file PorousFlow1PhaseMD_Gaussian.C.

Member Data Documentation

const Real PorousFlow1PhaseMD_Gaussian::_al
protected

Gaussian parameter: saturation = exp(-(al*p)^2)

Definition at line 35 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by buildPS(), and computeQpProperties().

const Real PorousFlow1PhaseMD_Gaussian::_al2
protected

_al2 = al*al

Definition at line 38 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by computeQpProperties().

const Real PorousFlow1PhaseMD_Gaussian::_bulk
protected

fluid density = _dens0*exp(P/_bulk)

Definition at line 44 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by buildPS(), and computeQpProperties().

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgradp_qp_dgradv
protectedinherited

d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints

Definition at line 52 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgradp_qp_dv
protectedinherited

d(grad porepressure)/d(PorousFlow variable) at the quadpoints

Definition at line 55 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowVariableBase::_dgrads_qp_dgradv
protectedinherited

d(grad saturation)/d(grad PorousFlow variable) at the quadpoints

Definition at line 67 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<RealGradient> > >* const PorousFlowVariableBase::_dgrads_qp_dv
protectedinherited

d(grad saturation)/d(PorousFlow variable) at the quadpoints

Definition at line 70 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dporepressure_dvar
protectedinherited
MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dsaturation_dvar
protectedinherited
const VariableGradient& PorousFlow1PhaseMD_Gaussian::_gradmd_qp_var
protected

Gradient(_mass-density at quadpoints)

Definition at line 56 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by computeQpProperties().

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_gradp_qp
protectedinherited

Grad(p) at the quadpoints.

Definition at line 49 of file PorousFlowVariableBase.h.

MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_grads_qp
protectedinherited

Grad(s) at the quadpoints.

Definition at line 64 of file PorousFlowVariableBase.h.

const Real PorousFlow1PhaseMD_Gaussian::_logdens0
protected

fluid density = _dens0*exp(P/_bulk)

Definition at line 41 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by buildPS(), and computeQpProperties().

const VariableValue& PorousFlow1PhaseMD_Gaussian::_md_var
protected

Nodal or quadpoint value of mass-density of the fluid phase.

Definition at line 53 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by buildPS(), and computeQpProperties().

const unsigned int PorousFlow1PhaseMD_Gaussian::_md_varnum
protected

Moose variable number of the mass-density.

Definition at line 59 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by computeQpProperties().

const unsigned int PorousFlowVariableBase::_num_components
protectedinherited
const unsigned int PorousFlowVariableBase::_num_pf_vars
protectedinherited
const unsigned int PorousFlowVariableBase::_num_phases
protectedinherited
MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_porepressure
protectedinherited
const unsigned int PorousFlow1PhaseMD_Gaussian::_pvar
protected

PorousFlow variable number of the mass-density.

Definition at line 62 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by computeQpProperties().

const Real PorousFlow1PhaseMD_Gaussian::_recip_bulk
protected

1/_bulk/_al

Definition at line 47 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by buildPS(), and computeQpProperties().

const Real PorousFlow1PhaseMD_Gaussian::_recip_bulk2
protected

(1/_bulk)^2

Definition at line 50 of file PorousFlow1PhaseMD_Gaussian.h.

Referenced by buildPS().

MaterialProperty<std::vector<Real> >& PorousFlowVariableBase::_saturation
protectedinherited

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