www.mooseframework.org
RichardsFullyUpwindFlux.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef RICHARDSFULLYUPWINDFLUX
9 #define RICHARDSFULLYUPWINDFLUX
10 
11 #include "Kernel.h"
12 #include "RichardsVarNames.h"
13 #include "RichardsDensity.h"
14 #include "RichardsRelPerm.h"
15 #include "RichardsSeff.h"
16 #include "Material.h"
17 
18 // Forward Declarations
20 
21 template <>
22 InputParameters validParams<RichardsFullyUpwindFlux>();
23 
46 class RichardsFullyUpwindFlux : public Kernel
47 {
48 public:
49  RichardsFullyUpwindFlux(const InputParameters & parameters);
50 
51 protected:
57  virtual Real computeQpResidual();
58 
60  virtual void computeResidual();
61 
63  virtual void computeOffDiagJacobian(unsigned int jvar);
64 
66  Real computeQpJac(unsigned int dvar);
67 
75  void upwind(bool compute_res, bool compute_jac, unsigned int jvar);
76 
78  void prepareNodalValues();
79 
85 
87  unsigned int _num_p;
88 
96  unsigned int _pvar;
97 
100 
103 
106 
108  const MaterialProperty<std::vector<Real>> & _viscosity;
109 
111  const MaterialProperty<std::vector<RealVectorValue>> & _flux_no_mob;
112 
114  const MaterialProperty<std::vector<std::vector<RealVectorValue>>> & _dflux_no_mob_dv;
115 
117  const MaterialProperty<std::vector<std::vector<RealTensorValue>>> & _dflux_no_mob_dgradv;
118 
120  unsigned int _num_nodes;
121 
126  std::vector<Real> _mobility;
127 
132  std::vector<std::vector<Real>> _dmobility_dv;
133 
140  std::vector<const VariableValue *> _ps_at_nodes;
141 };
142 
143 #endif // RICHARDSFULLYUPWINDFLUX
unsigned int _num_p
number of richards variables
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & _dflux_no_mob_dv
d(_flux_no_mob)/d(variable)
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:22
Base class for Richards relative permeability classes that provide relative permeability as a functio...
std::vector< const VariableValue * > _ps_at_nodes
Holds the values of pressures at all the nodes of the element Eg: _ps_at_nodes[_pvar] is a pointer to...
std::vector< std::vector< Real > > _dmobility_dv
d(_mobility)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jacobian...
This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels...
virtual void computeResidual()
This simply calls upwind.
virtual void computeOffDiagJacobian(unsigned int jvar)
this simply calls upwind
const RichardsRelPerm & _relperm_UO
user object defining the relative permeability
void upwind(bool compute_res, bool compute_jac, unsigned int jvar)
Do the upwinding for both the residual and jacobian I&#39;ve put both calculations in the same code to tr...
InputParameters validParams< RichardsFullyUpwindFlux >()
const MaterialProperty< std::vector< RealVectorValue > > & _flux_no_mob
permeability*(grad(pressure) - density*gravity) (a vector of these in the multiphase case) ...
const RichardsSeff & _seff_UO
user object defining the effective saturation
RichardsFullyUpwindFlux(const InputParameters &parameters)
unsigned int _pvar
the index of this variable in the list of Richards variables held by _richards_name_UO.
void prepareNodalValues()
calculates the nodal values of mobility, and derivatives thereof
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dflux_no_mob_dgradv
d(_flux_no_mob)/d(grad(variable))
Real computeQpJac(unsigned int dvar)
the derivative of the flux without the upstream mobility terms
unsigned int _num_nodes
number of nodes in this element
const RichardsVarNames & _richards_name_UO
holds info regarding the names of the Richards variables and methods for extracting values of these v...
const MaterialProperty< std::vector< Real > > & _viscosity
viscosities
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
This is a fully upwinded version of RichardsFlux.
const RichardsDensity & _density_UO
user object defining the density
virtual Real computeQpResidual()
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quad...
std::vector< Real > _mobility
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the...