www.mooseframework.org
PorousFlowEffectiveFluidPressure.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 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<PorousFlowMaterialVectorBase>();
19  params.set<std::string>("pf_material_type") = "effective_pressure";
20  params.addClassDescription("This Material calculates an effective fluid pressure: "
21  "effective_stress = total_stress + "
22  "biot_coeff*effective_fluid_pressure. The effective_fluid_pressure = "
23  "sum_{phases}(S_phase * P_phase)");
24  return params;
25 }
26 
28  const InputParameters & parameters)
29  : PorousFlowMaterialVectorBase(parameters),
30  _porepressure(_nodal_material
31  ? getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_nodal")
32  : getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
33  _porepressure_old(
34  _nodal_material ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_nodal")
35  : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_qp")),
36  _dporepressure_dvar(_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
37  "dPorousFlow_porepressure_nodal_dvar")
38  : getMaterialProperty<std::vector<std::vector<Real>>>(
39  "dPorousFlow_porepressure_qp_dvar")),
40  _saturation(_nodal_material
41  ? getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
42  : getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
43  _saturation_old(_nodal_material
44  ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_saturation_nodal")
45  : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_saturation_qp")),
46  _dsaturation_dvar(_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
47  "dPorousFlow_saturation_nodal_dvar")
48  : getMaterialProperty<std::vector<std::vector<Real>>>(
49  "dPorousFlow_saturation_qp_dvar")),
50  _pf(_nodal_material ? declareProperty<Real>("PorousFlow_effective_fluid_pressure_nodal")
51  : declareProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
52  _dpf_dvar(
53  _nodal_material
54  ? declareProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_nodal_dvar")
55  : declareProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_qp_dvar"))
56 {
57 }
58 
59 void
61 {
62  _pf[_qp] = 0.0;
63  for (unsigned ph = 0; ph < _num_phases; ++ph)
64  _pf[_qp] += _saturation[_qp][ph] * _porepressure[_qp][ph];
65 }
66 
67 void
69 {
70  _pf[_qp] = 0.0;
71  _dpf_dvar[_qp].assign(_num_var, 0.0);
72  for (unsigned ph = 0; ph < _num_phases; ++ph)
73  {
74  _pf[_qp] += _saturation[_qp][ph] * _porepressure[_qp][ph];
75  for (unsigned v = 0; v < _num_var; ++v)
76  _dpf_dvar[_qp][v] += _dsaturation_dvar[_qp][ph][v] * _porepressure[_qp][ph] +
77  _saturation[_qp][ph] * _dporepressure_dvar[_qp][ph][v];
78  }
79 }
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)
registerMooseObject("PorousFlowApp", PorousFlowEffectiveFluidPressure)
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)
Material designed to calculate the effective fluid pressure that can be used in the mechanical effect...
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.