www.mooseframework.org
PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent.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 {
19  params.addClassDescription(
20  "Computes the advective flux of fluid of given phase and fluid component. Explicitly, the "
21  "UserObject computes (mass_fraction * density / viscosity) * (- permeability * (grad(P) - "
22  "density * gravity)), using the Kuzmin-Turek FEM-TVD multidimensional stabilization scheme");
23  params.addParam<unsigned int>(
24  "fluid_component", 0, "The index corresponding to the fluid component for this UserObject");
25  return params;
26 }
27 
31  _fluid_component(getParam<unsigned int>("fluid_component")),
32  _mass_fractions(
33  getMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal")),
34  _dmass_fractions_dvar(getMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
35  "dPorousFlow_mass_frac_nodal_dvar"))
36 {
38  paramError("fluid_component",
39  "Fluid component number entered is greater than the number of fluid components "
40  "specified in the Dictator. Remember that indexing starts at 0");
41 }
42 
43 Real
45 {
48 }
49 
50 Real
52  unsigned pvar) const
53 {
54  Real du = _mass_fractions[i][_phase][_fluid_component] *
58  return du;
59 }
unsigned int numComponents() const
The number of fluid components.
virtual Real computeU(unsigned i) const override
Computes the value of u at the local node id of the current element (_current_elem) ...
Computes the advective flux of fluid of given phase and fluid component.
InputParameters validParams< PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent >()
virtual Real computeU(unsigned i) const override
Computes the value of u at the local node id of the current element (_current_elem) ...
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.
const MaterialProperty< std::vector< std::vector< Real > > > & _mass_fractions
Mass fraction of each component in each phase.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
virtual Real computedU_dvar(unsigned i, unsigned pvar) const override
Compute d(u)/d(porous_flow_variable)
registerMooseObject("PorousFlowApp", PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent)
const MaterialProperty< std::vector< std::vector< std::vector< Real > > > > & _dmass_fractions_dvar
Derivative of the mass fraction of each component in each phase wrt PorousFlow variables.
InputParameters validParams< PorousFlowAdvectiveFluxCalculatorSaturated >()