www.mooseframework.org
PorousFlowDarcyVelocityComponentLowerDimensional.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 #include "MooseMesh.h"
12 #include "Assembly.h"
13 
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<PorousFlowDarcyVelocityComponent>();
21  params.addCoupledVar("aperture", 1.0, "Aperture of the fracture");
22  params.addClassDescription(
23  "Darcy velocity on a lower-dimensional element embedded in a higher-dimensional mesh. Units "
24  "m^3.s^-1.m^-2, or m.s^-1. Darcy velocity = -(k_ij * krel /(mu * a) (nabla_j P - w_j)), "
25  "where k_ij is the permeability tensor, krel is the relative permeability, mu is the fluid "
26  "viscosity, P is the fluid pressure, a is the fracture aperture and w_j is the fluid weight. "
27  " The difference between this AuxKernel and PorousFlowDarcyVelocity is that this one "
28  "projects gravity along the element's tangent direction. NOTE! For a meaningful answer, "
29  "your permeability tensor must NOT contain terms that rotate tangential vectors to "
30  "non-tangential vectors.");
31  return params;
32 }
33 
35  const InputParameters & parameters)
36  : PorousFlowDarcyVelocityComponent(parameters), _aperture(coupledValue("aperture"))
37 {
38 }
39 
40 Real
42 {
43  const unsigned elem_dim = _current_elem->dim();
44  if (elem_dim == _mesh.dimension())
45  mooseError("The variable ",
46  _var.name(),
47  " must must be defined on lower-dimensional elements "
48  "only since it employs "
49  "PorousFlowDarcyVelocityComponentLowerDimensional\n");
50 
51  // MOOSE will automatically make grad(P) lie along the element's tangent direction
52  // but we need to project gravity in that direction too
53 
54  // tang_xi is the element's tangent vector in xi direction
55  const std::vector<RealGradient> & tang_xi = _assembly.getFE(FEType(), elem_dim)->get_dxyzdxi();
56  RealVectorValue tangential_gravity =
57  (_gravity * tang_xi[_qp] / tang_xi[_qp].norm_sq()) * tang_xi[_qp];
58  if (elem_dim == 2)
59  {
60  // tang_eta is the element's tangent vector in eta direction
61  const std::vector<RealGradient> & tang_eta =
62  _assembly.getFE(FEType(), elem_dim)->get_dxyzdeta();
63  tangential_gravity += (_gravity * tang_eta[_qp] / tang_eta[_qp].norm_sq()) * tang_eta[_qp];
64  }
65 
66  return -(_permeability[_qp] *
67  (_grad_p[_qp][_ph] - _fluid_density_qp[_qp][_ph] * tangential_gravity) *
69  _aperture[_qp];
70 }
PorousFlowDarcyVelocityComponent::_grad_p
const MaterialProperty< std::vector< RealGradient > > & _grad_p
Gradient of the pore pressure in each phase.
Definition: PorousFlowDarcyVelocityComponent.h:48
PorousFlowDarcyVelocityComponentLowerDimensional::_aperture
const VariableValue & _aperture
Fracture aperture (width)
Definition: PorousFlowDarcyVelocityComponentLowerDimensional.h:39
registerMooseObject
registerMooseObject("PorousFlowApp", PorousFlowDarcyVelocityComponentLowerDimensional)
PorousFlowDarcyVelocityComponent::_relative_permeability
const MaterialProperty< std::vector< Real > > & _relative_permeability
Relative permeability of each phase.
Definition: PorousFlowDarcyVelocityComponent.h:39
PorousFlowDarcyVelocityComponentLowerDimensional::PorousFlowDarcyVelocityComponentLowerDimensional
PorousFlowDarcyVelocityComponentLowerDimensional(const InputParameters &parameters)
Definition: PorousFlowDarcyVelocityComponentLowerDimensional.C:34
PorousFlowDarcyVelocityComponent::_component
unsigned int _component
Desired spatial component.
Definition: PorousFlowDarcyVelocityComponent.h:60
PorousFlowDarcyVelocityComponent::_gravity
const RealVectorValue _gravity
Gravitational acceleration.
Definition: PorousFlowDarcyVelocityComponent.h:63
PorousFlowDarcyVelocityComponent::_permeability
const MaterialProperty< RealTensorValue > & _permeability
Permeability of porous material.
Definition: PorousFlowDarcyVelocityComponent.h:45
PorousFlowDarcyVelocityComponent::_fluid_density_qp
const MaterialProperty< std::vector< Real > > & _fluid_density_qp
Fluid density for each phase (at the qp)
Definition: PorousFlowDarcyVelocityComponent.h:51
PorousFlowDarcyVelocityComponentLowerDimensional::computeValue
virtual Real computeValue() override
Definition: PorousFlowDarcyVelocityComponentLowerDimensional.C:41
PorousFlowDarcyVelocityComponentLowerDimensional
Computes a component of the Darcy velocity: -k_ij * krel /(mu a) (nabla_j P - w_j) where k_ij is the ...
Definition: PorousFlowDarcyVelocityComponentLowerDimensional.h:30
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::_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
PorousFlowDarcyVelocityComponentLowerDimensional.h
validParams< PorousFlowDarcyVelocityComponentLowerDimensional >
InputParameters validParams< PorousFlowDarcyVelocityComponentLowerDimensional >()
Definition: PorousFlowDarcyVelocityComponentLowerDimensional.C:18
validParams< PorousFlowDarcyVelocityComponent >
InputParameters validParams< PorousFlowDarcyVelocityComponent >()
Definition: PorousFlowDarcyVelocityComponent.C:16