www.mooseframework.org
Q2PSaturationFlux.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 Q2PSATURATIONFLUX
9 #define Q2PSATURATIONFLUX
10 
11 #include "Kernel.h"
12 #include "RichardsDensity.h"
13 #include "RichardsRelPerm.h"
14 #include "Material.h"
15 
16 // Forward Declarations
17 class Q2PSaturationFlux;
18 
19 template <>
20 InputParameters validParams<Q2PSaturationFlux>();
21 
45 class Q2PSaturationFlux : public Kernel
46 {
47 public:
48  Q2PSaturationFlux(const InputParameters & parameters);
49 
50 protected:
56  virtual Real computeQpResidual();
57 
59  virtual void computeResidual();
60 
62  virtual void computeOffDiagJacobian(unsigned int jvar);
63 
65  virtual void computeJacobian();
66 
68  Real computeQpJac(unsigned int dvar);
69 
77  void upwind(bool compute_res, bool compute_jac, unsigned int jvar);
78 
80  void prepareNodalValues();
81 
84 
86  const VariableValue & _pp;
87 
89  const VariableGradient & _grad_pp;
90 
92  const VariableValue & _pp_nodal;
93 
95  unsigned int _pp_var;
96 
99 
102 
104  const MaterialProperty<RealVectorValue> & _gravity;
105 
107  const MaterialProperty<RealTensorValue> & _permeability;
108 
110  unsigned int _num_nodes;
111 
116  std::vector<Real> _mobility;
117 
122  std::vector<Real> _dmobility_dp;
123 
128  std::vector<Real> _dmobility_ds;
129 };
130 
131 #endif // Q2PSATURATIONFLUX
void prepareNodalValues()
calculates the nodal values of mobility, and derivatives thereof
const RichardsRelPerm & _relperm
fluid relative permeability
std::vector< Real > _mobility
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the...
unsigned int _num_nodes
number of nodes in the element
Base class for Richards relative permeability classes that provide relative permeability as a functio...
std::vector< Real > _dmobility_dp
d(_mobility)/d(porepressure) These are used in the jacobian calculations
virtual void computeJacobian()
this simply calls upwind
Real _viscosity
fluid viscosity
std::vector< Real > _dmobility_ds
d(_mobility)/d(saturation) These are used in the jacobian calculations
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...
virtual Real computeQpResidual()
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quad...
const VariableGradient & _grad_pp
grad(porepressure) at the quadpoints
virtual void computeResidual()
This simply calls upwind.
const VariableValue & _pp
porepressure at the quadpoints
unsigned int _pp_var
variable number of the porepressure variable
This is a fully upwinded flux Kernel The Variable of this Kernel should be the saturation.
const RichardsDensity & _density
fluid density
const MaterialProperty< RealVectorValue > & _gravity
gravity
Q2PSaturationFlux(const InputParameters &parameters)
InputParameters validParams< Q2PSaturationFlux >()
const VariableValue & _pp_nodal
porepressure at the nodes
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
Real computeQpJac(unsigned int dvar)
the derivative of the flux without the upstream mobility terms
const MaterialProperty< RealTensorValue > & _permeability
permeability
virtual void computeOffDiagJacobian(unsigned int jvar)
this simply calls upwind