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

Base class for thermophysical variable materials, which assemble materials for primary variables such as porepressure and saturation at the nodes and quadpoints for all phases as required. More...

#include <PorousFlowVariableBase.h>

Inheritance diagram for PorousFlowVariableBase:
[legend]

Public Member Functions

 PorousFlowVariableBase (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

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

Base class for thermophysical variable materials, which assemble materials for primary variables such as porepressure and saturation at the nodes and quadpoints for all phases as required.

Definition at line 24 of file PorousFlowVariableBase.h.

Constructor & Destructor Documentation

PorousFlowVariableBase::PorousFlowVariableBase ( const InputParameters &  parameters)

Definition at line 20 of file PorousFlowVariableBase.C.

21  : DerivativeMaterialInterface<PorousFlowMaterial>(parameters),
22 
23  _num_phases(_dictator.numPhases()),
24  _num_components(_dictator.numComponents()),
25  _num_pf_vars(_dictator.numVariables()),
26 
27  _porepressure(_nodal_material
28  ? declareProperty<std::vector<Real>>("PorousFlow_porepressure_nodal")
29  : declareProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
31  _nodal_material
32  ? declareProperty<std::vector<std::vector<Real>>>("dPorousFlow_porepressure_nodal_dvar")
33  : declareProperty<std::vector<std::vector<Real>>>("dPorousFlow_porepressure_qp_dvar")),
34  _gradp_qp(_nodal_material
35  ? nullptr
36  : &declareProperty<std::vector<RealGradient>>("PorousFlow_grad_porepressure_qp")),
37  _dgradp_qp_dgradv(_nodal_material ? nullptr
38  : &declareProperty<std::vector<std::vector<Real>>>(
39  "dPorousFlow_grad_porepressure_qp_dgradvar")),
40  _dgradp_qp_dv(_nodal_material ? nullptr
41  : &declareProperty<std::vector<std::vector<RealGradient>>>(
42  "dPorousFlow_grad_porepressure_qp_dvar")),
43 
44  _saturation(_nodal_material ? declareProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
45  : declareProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
47  _nodal_material
48  ? declareProperty<std::vector<std::vector<Real>>>("dPorousFlow_saturation_nodal_dvar")
49  : declareProperty<std::vector<std::vector<Real>>>("dPorousFlow_saturation_qp_dvar")),
50  _grads_qp(_nodal_material
51  ? nullptr
52  : &declareProperty<std::vector<RealGradient>>("PorousFlow_grad_saturation_qp")),
53  _dgrads_qp_dgradv(_nodal_material ? nullptr
54  : &declareProperty<std::vector<std::vector<Real>>>(
55  "dPorousFlow_grad_saturation_qp_dgradvar")),
56  _dgrads_qp_dv(_nodal_material ? nullptr
57  : &declareProperty<std::vector<std::vector<RealGradient>>>(
58  "dPorousFlow_grad_saturation_qp_dv"))
59 {
60 }
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
MaterialProperty< std::vector< std::vector< Real > > > *const _dgrads_qp_dgradv
d(grad saturation)/d(grad PorousFlow variable) at the quadpoints
const unsigned int _num_pf_vars
Number of PorousFlow variables.
MaterialProperty< std::vector< RealGradient > > *const _gradp_qp
Grad(p) at the quadpoints.
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgrads_qp_dv
d(grad saturation)/d(PorousFlow variable) at the quadpoints
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)
MaterialProperty< std::vector< std::vector< Real > > > *const _dgradp_qp_dgradv
d(grad porepressure)/d(grad PorousFlow variable) at the quadpoints
const unsigned int _num_components
Number of components.
const unsigned int _num_phases
Number of phases.
MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgradp_qp_dv
d(grad porepressure)/d(PorousFlow variable) at the quadpoints
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
MaterialProperty< std::vector< RealGradient > > *const _grads_qp
Grad(s) at the quadpoints.

Member Function Documentation

void PorousFlowVariableBase::computeQpProperties ( )
overrideprotectedvirtual

Prepare the derivative matrices with zeroes

Reimplemented in PorousFlow2PhasePS, PorousFlowFluidStateFlashBase, PorousFlow1PhaseP, PorousFlow2PhasePP, PorousFlow1PhaseMD_Gaussian, and PorousFlow1PhaseFullySaturated.

Definition at line 71 of file PorousFlowVariableBase.C.

Referenced by PorousFlow1PhaseFullySaturated::computeQpProperties(), PorousFlow1PhaseMD_Gaussian::computeQpProperties(), PorousFlow2PhasePP::computeQpProperties(), PorousFlow1PhaseP::computeQpProperties(), PorousFlowFluidStateFlashBase::computeQpProperties(), and PorousFlow2PhasePS::computeQpProperties().

72 {
73  // do we really need this stuff here? it seems very inefficient to keep resizing everything!
74  _porepressure[_qp].resize(_num_phases);
75  _dporepressure_dvar[_qp].resize(_num_phases);
76 
77  _saturation[_qp].resize(_num_phases);
78  _dsaturation_dvar[_qp].resize(_num_phases);
79 
80  if (!_nodal_material)
81  {
82  (*_gradp_qp)[_qp].resize(_num_phases);
83  (*_dgradp_qp_dgradv)[_qp].resize(_num_phases);
84  (*_dgradp_qp_dv)[_qp].resize(_num_phases);
85 
86  (*_grads_qp)[_qp].resize(_num_phases);
87  (*_dgrads_qp_dgradv)[_qp].resize(_num_phases);
88  (*_dgrads_qp_dv)[_qp].resize(_num_phases);
89  }
90 
92  for (unsigned phase = 0; phase < _num_phases; ++phase)
93  {
94  _dporepressure_dvar[_qp][phase].assign(_num_pf_vars, 0.0);
95  _dsaturation_dvar[_qp][phase].assign(_num_pf_vars, 0.0);
96  if (!_nodal_material)
97  {
98  (*_dgradp_qp_dgradv)[_qp][phase].assign(_num_pf_vars, 0.0);
99  (*_dgradp_qp_dv)[_qp][phase].assign(_num_pf_vars, RealGradient());
100  (*_dgrads_qp_dgradv)[_qp][phase].assign(_num_pf_vars, 0.0);
101  (*_dgrads_qp_dv)[_qp][phase].assign(_num_pf_vars, RealGradient());
102  }
103  }
104 }
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
const unsigned int _num_pf_vars
Number of PorousFlow variables.
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)
const unsigned int _num_phases
Number of phases.
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
void PorousFlowVariableBase::initQpStatefulProperties ( )
overrideprotectedvirtual

Reimplemented in PorousFlow2PhasePS, PorousFlowFluidStateFlashBase, PorousFlow1PhaseP, PorousFlow2PhasePP, PorousFlow1PhaseMD_Gaussian, and PorousFlow1PhaseFullySaturated.

Definition at line 63 of file PorousFlowVariableBase.C.

Referenced by PorousFlow1PhaseFullySaturated::initQpStatefulProperties(), PorousFlow1PhaseMD_Gaussian::initQpStatefulProperties(), PorousFlow2PhasePP::initQpStatefulProperties(), PorousFlow1PhaseP::initQpStatefulProperties(), PorousFlowFluidStateFlashBase::initQpStatefulProperties(), and PorousFlow2PhasePS::initQpStatefulProperties().

64 {
65  _porepressure[_qp].resize(_num_phases);
66  _saturation[_qp].resize(_num_phases);
67  // the porepressure and saturation values get set by derived classes
68 }
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
const unsigned int _num_phases
Number of phases.
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.

Member Data Documentation

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

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
protected

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
protected

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
protected

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
protected
MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowVariableBase::_dsaturation_dvar
protected
MaterialProperty<std::vector<RealGradient> >* const PorousFlowVariableBase::_gradp_qp
protected

Grad(p) at the quadpoints.

Definition at line 49 of file PorousFlowVariableBase.h.

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

Grad(s) at the quadpoints.

Definition at line 64 of file PorousFlowVariableBase.h.

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

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