www.mooseframework.org
PorousFlowDarcyVelocityComponent.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<AuxKernel>();
21  params.addRequiredParam<RealVectorValue>("gravity",
22  "Gravitational acceleration vector downwards (m/s^2)");
23  params.addRequiredParam<UserObjectName>(
24  "PorousFlowDictator", "The UserObject that holds the list of PorousFlow variable names");
25  params.addParam<unsigned int>("fluid_phase", 0, "The index corresponding to the fluid phase");
26  MooseEnum component("x=0 y=1 z=2");
27  params.addRequiredParam<MooseEnum>(
28  "component", component, "The spatial component of the Darcy flux to return");
29  params.addClassDescription("Darcy velocity (in m^3.s^-1.m^-2, or m.s^-1) -(k_ij * krel /mu "
30  "(nabla_j P - w_j)), where k_ij is the permeability tensor, krel is "
31  "the relative permeability, mu is the fluid viscosity, P is the fluid "
32  "pressure, and w_j is the fluid weight.");
33  return params;
34 }
35 
37  const InputParameters & parameters)
38  : AuxKernel(parameters),
39  _relative_permeability(
40  getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_qp")),
41  _fluid_viscosity(getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_qp")),
42  _permeability(getMaterialProperty<RealTensorValue>("PorousFlow_permeability_qp")),
43  _grad_p(getMaterialProperty<std::vector<RealGradient>>("PorousFlow_grad_porepressure_qp")),
44  _fluid_density_qp(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_qp")),
45  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
46  _ph(getParam<unsigned int>("fluid_phase")),
47  _component(getParam<MooseEnum>("component")),
48  _gravity(getParam<RealVectorValue>("gravity"))
49 {
50  if (_ph >= _dictator.numPhases())
51  mooseError(
52  "The Dictator proclaims that the number of phases in this simulation is ",
54  " whereas you have used the AuxKernel PorousFlowDarcyVelocityComponent with fluid_phase = ",
55  _ph,
56  ". The Dictator is watching you, to ensure your wellbeing.");
57 }
58 
59 Real
61 {
62  // note that in the following, _relative_permeaility and _fluid_viscosity are upwinded (nodal)
63  // values
64  return -(_permeability[_qp] * (_grad_p[_qp][_ph] - _fluid_density_qp[_qp][_ph] * _gravity) *
66 }
Real component(const SymmTensor &symm_tensor, unsigned int index)
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
const MaterialProperty< std::vector< Real > > & _relative_permeability
Relative permeability of each phase.
const RealVectorValue _gravity
Gravitational acceleration.
PorousFlowDarcyVelocityComponent(const InputParameters &parameters)
unsigned int _component
Desired spatial component.
const PorousFlowDictator & _dictator
PorousFlow UserObject.
const MaterialProperty< std::vector< Real > > & _fluid_viscosity
Viscosity of each component in each phase.
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
const unsigned int _ph
Index of the fluid phase.
unsigned int numPhases() const
the number of fluid phases
InputParameters validParams< PorousFlowDarcyVelocityComponent >()
const MaterialProperty< std::vector< Real > > & _fluid_density_qp
Fluid density for each phase (at the qp)