www.mooseframework.org
PorousFlowAdvectiveFluxCalculatorSaturated.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 
16 {
18  params.addClassDescription(
19  "Computes the advective flux of fluid of given phase, assuming fully-saturated conditions. "
20  "Hence this UserObject is only relevant to single-phase situations. Explicitly, the "
21  "UserObject computes (density / viscosity) * (- permeability * (grad(P) - density * "
22  "gravity)), using the Kuzmin-Turek FEM-TVD multidimensional stabilization scheme");
23  params.addParam<bool>(
24  "multiply_by_density",
25  true,
26  "If true, then the advective flux will be multiplied by density, so it is a mass flux, which "
27  "is the most common way of using PorousFlow. If false, then the advective flux will be a "
28  "volume flux, which is common in poro-mechanics");
29  return params;
30 }
31 
33  const InputParameters & parameters)
35  _multiply_by_density(getParam<bool>("multiply_by_density")),
36  _fluid_density_node(_multiply_by_density ? &getMaterialProperty<std::vector<Real>>(
37  "PorousFlow_fluid_phase_density_nodal")
38  : nullptr),
39  _dfluid_density_node_dvar(_multiply_by_density
40  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
41  "dPorousFlow_fluid_phase_density_nodal_dvar")
42  : nullptr),
43  _fluid_viscosity(getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_nodal")),
44  _dfluid_viscosity_dvar(
45  getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_nodal_dvar"))
46 {
47 }
48 
49 Real
51 {
52  // The following is but one choice.
53  // If you change this, you will probably have to change
54  // - computeVelocity
55  // - the derivative in executeOnElement
56  // - computedU_dvar
59  return 1.0 / _fluid_viscosity[i][_phase];
60 }
61 
62 Real
64 {
67  du = du * (*_fluid_density_node)[i][_phase] +
68  (*_dfluid_density_node_dvar)[i][_phase][pvar] / _fluid_viscosity[i][_phase];
69  return du;
70 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("PorousFlowApp", PorousFlowAdvectiveFluxCalculatorSaturated)
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_viscosity_dvar
Derivative of the fluid viscosity for each phase wrt PorousFlow variables.
const MaterialProperty< std::vector< Real > > & _fluid_viscosity
Viscosity of each component in each phase.
Base class to compute the advective flux of fluid in PorousFlow situations using the Kuzmin-Turek FEM...
const MaterialProperty< std::vector< Real > > *const _fluid_density_node
Fluid density for each phase (at the node)
const bool _multiply_by_density
Whether to multiply the flux by the fluid density.
virtual Real computeU(unsigned i) const override
Computes the value of u at the local node id of the current element (_current_elem) ...
PorousFlowAdvectiveFluxCalculatorSaturated(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computedU_dvar(unsigned i, unsigned pvar) const override
Compute d(u)/d(porous_flow_variable)
Computes the advective flux of fluid of given phase, assuming fully-saturated conditions.
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)