www.mooseframework.org
PorousFlowEffectiveFluidPressure.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowMaterialVectorBase>();
15  params.addClassDescription("This Material calculates an effective fluid pressure: "
16  "effective_stress = total_stress + "
17  "biot_coeff*effective_fluid_pressure. The effective_fluid_pressure = "
18  "sum_{phases}(S_phase * P_phase)");
19  return params;
20 }
21 
23  const InputParameters & parameters)
24  : PorousFlowMaterialVectorBase(parameters),
25  _porepressure(_nodal_material
26  ? getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_nodal")
27  : getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
28  _porepressure_old(
29  _nodal_material ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_nodal")
30  : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_qp")),
31  _dporepressure_dvar(_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
32  "dPorousFlow_porepressure_nodal_dvar")
33  : getMaterialProperty<std::vector<std::vector<Real>>>(
34  "dPorousFlow_porepressure_qp_dvar")),
35  _saturation(_nodal_material
36  ? getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
37  : getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
38  _saturation_old(_nodal_material
39  ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_saturation_nodal")
40  : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_saturation_qp")),
41  _dsaturation_dvar(_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
42  "dPorousFlow_saturation_nodal_dvar")
43  : getMaterialProperty<std::vector<std::vector<Real>>>(
44  "dPorousFlow_saturation_qp_dvar")),
45  _pf(_nodal_material ? declareProperty<Real>("PorousFlow_effective_fluid_pressure_nodal")
46  : declareProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
47  _dpf_dvar(
48  _nodal_material
49  ? declareProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_nodal_dvar")
50  : declareProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_qp_dvar"))
51 {
52 }
53 
54 void
56 {
57  _pf[_qp] = 0.0;
58  for (unsigned ph = 0; ph < _num_phases; ++ph)
59  _pf[_qp] += _saturation[_qp][ph] * _porepressure[_qp][ph];
60 }
61 
62 void
64 {
65  _pf[_qp] = 0.0;
66  _dpf_dvar[_qp].assign(_num_var, 0.0);
67  for (unsigned ph = 0; ph < _num_phases; ++ph)
68  {
69  _pf[_qp] += _saturation[_qp][ph] * _porepressure[_qp][ph];
70  for (unsigned v = 0; v < _num_var; ++v)
71  _dpf_dvar[_qp][v] += _dsaturation_dvar[_qp][ph][v] * _porepressure[_qp][ph] +
72  _saturation[_qp][ph] * _dporepressure_dvar[_qp][ph][v];
73  }
74 }
const unsigned int _num_phases
Number of phases.
MaterialProperty< Real > & _pf
computed effective fluid pressure (at quadpoints or nodes)
const MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
MaterialProperty< std::vector< Real > > & _dpf_dvar
d(_pf)/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > & _saturation
quadpoint or nodal saturation of each phase
InputParameters validParams< PorousFlowMaterialVectorBase >()
Base class for all PorousFlow vector materials.
const MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
d(saturation)/d(PorousFlow variable)
const unsigned int _num_var
Number of PorousFlow variables.
PorousFlowEffectiveFluidPressure(const InputParameters &parameters)
InputParameters validParams< PorousFlowEffectiveFluidPressure >()
const MaterialProperty< std::vector< Real > > & _porepressure
quadpoint or nodal porepressure of each phase