www.mooseframework.org
PorousFlowDarcyVelocityComponent.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<AuxKernel>();
19  params.addRequiredParam<RealVectorValue>("gravity",
20  "Gravitational acceleration vector downwards (m/s^2)");
21  params.addRequiredParam<UserObjectName>(
22  "PorousFlowDictator", "The UserObject that holds the list of PorousFlow variable names");
23  params.addParam<unsigned int>("fluid_phase", 0, "The index corresponding to the fluid phase");
24  MooseEnum component("x=0 y=1 z=2");
25  params.addRequiredParam<MooseEnum>(
26  "component", component, "The spatial component of the Darcy flux to return");
27  params.addClassDescription("Darcy velocity (in m^3.s^-1.m^-2, or m.s^-1) -(k_ij * krel /mu "
28  "(nabla_j P - w_j)), where k_ij is the permeability tensor, krel is "
29  "the relative permeability, mu is the fluid viscosity, P is the fluid "
30  "pressure, and w_j is the fluid weight.");
31  return params;
32 }
33 
35  const InputParameters & parameters)
36  : AuxKernel(parameters),
37  _relative_permeability(
38  getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_qp")),
39  _fluid_viscosity(getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_qp")),
40  _permeability(getMaterialProperty<RealTensorValue>("PorousFlow_permeability_qp")),
41  _grad_p(getMaterialProperty<std::vector<RealGradient>>("PorousFlow_grad_porepressure_qp")),
42  _fluid_density_qp(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_qp")),
43  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
44  _ph(getParam<unsigned int>("fluid_phase")),
45  _component(getParam<MooseEnum>("component")),
46  _gravity(getParam<RealVectorValue>("gravity"))
47 {
48  if (_ph >= _dictator.numPhases())
49  paramError("fluid_phase",
50  "The Dictator proclaims that the maximum phase index in this simulation is ",
51  _dictator.numPhases() - 1,
52  " whereas you have used ",
53  _ph,
54  ". Remember that indexing starts at 0. The Dictator is watching you, to "
55  "ensure your wellbeing.");
56 }
57 
58 Real
60 {
61  return -(_permeability[_qp] * (_grad_p[_qp][_ph] - _fluid_density_qp[_qp][_ph] * _gravity) *
63 }
PorousFlowDarcyVelocityComponent::_grad_p
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
Definition: PorousFlowDarcyVelocityComponent.h:48
PorousFlowDarcyVelocityComponent::computeValue
virtual Real computeValue()
Definition: PorousFlowDarcyVelocityComponent.C:59
validParams< PorousFlowDarcyVelocityComponent >
InputParameters validParams< PorousFlowDarcyVelocityComponent >()
Definition: PorousFlowDarcyVelocityComponent.C:16
PorousFlowDarcyVelocityComponent::_relative_permeability
const MaterialProperty< std::vector< Real > > & _relative_permeability
Relative permeability of each phase.
Definition: PorousFlowDarcyVelocityComponent.h:39
libMesh::RealGradient
VectorValue< Real > RealGradient
Definition: GrainForceAndTorqueInterface.h:17
PorousFlowDarcyVelocityComponent::_component
unsigned int _component
Desired spatial component.
Definition: PorousFlowDarcyVelocityComponent.h:60
PorousFlowDarcyVelocityComponent::_gravity
const RealVectorValue _gravity
Gravitational acceleration.
Definition: PorousFlowDarcyVelocityComponent.h:63
registerMooseObject
registerMooseObject("PorousFlowApp", PorousFlowDarcyVelocityComponent)
PorousFlowDarcyVelocityComponent::_permeability
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
Definition: PorousFlowDarcyVelocityComponent.h:45
PorousFlowDictator
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
Definition: PorousFlowDictator.h:71
PorousFlowDictator::numPhases
unsigned int numPhases() const
The number of fluid phases.
Definition: PorousFlowDictator.C:105
PorousFlowDarcyVelocityComponent::_fluid_density_qp
const MaterialProperty< std::vector< Real > > & _fluid_density_qp
Fluid density for each phase (at the qp)
Definition: PorousFlowDarcyVelocityComponent.h:51
MaterialTensorCalculatorTools::component
Real component(const SymmTensor &symm_tensor, unsigned int index)
Definition: MaterialTensorCalculatorTools.C:16
PorousFlowDarcyVelocityComponent
Computes a component of the Darcy velocity: -k_ij * krel /mu (nabla_j P - w_j) where k_ij is the perm...
Definition: PorousFlowDarcyVelocityComponent.h:30
PorousFlowDarcyVelocityComponent::_dictator
const PorousFlowDictator & _dictator
PorousFlowDicatator UserObject.
Definition: PorousFlowDarcyVelocityComponent.h:54
PorousFlowDarcyVelocityComponent::_fluid_viscosity
const MaterialProperty< std::vector< Real > > & _fluid_viscosity
Viscosity of each component in each phase.
Definition: PorousFlowDarcyVelocityComponent.h:42
PorousFlowDarcyVelocityComponent::_ph
const unsigned int _ph
Index of the fluid phase.
Definition: PorousFlowDarcyVelocityComponent.h:57
PorousFlowDarcyVelocityComponent::PorousFlowDarcyVelocityComponent
PorousFlowDarcyVelocityComponent(const InputParameters &parameters)
Definition: PorousFlowDarcyVelocityComponent.C:34
PorousFlowDarcyVelocityComponent.h