www.mooseframework.org
Q2PPorepressureFlux.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 Q2PPOREPRESSUREFLUX
9 #define Q2PPOREPRESSUREFLUX
10 
11 #include "Kernel.h"
12 #include "RichardsDensity.h"
13 #include "RichardsRelPerm.h"
14 #include "Material.h"
15 
16 // Forward Declarations
18 
19 template <>
20 InputParameters validParams<Q2PPorepressureFlux>();
21 
45 class Q2PPorepressureFlux : public Kernel
46 {
47 public:
48  Q2PPorepressureFlux(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 & _sat;
87 
89  unsigned int _sat_var;
90 
93 
95  Real _viscosity;
96 
98  const MaterialProperty<RealVectorValue> & _gravity;
99 
101  const MaterialProperty<RealTensorValue> & _permeability;
102 
104  unsigned int _num_nodes;
105 
110  std::vector<Real> _mobility;
111 
116  std::vector<Real> _dmobility_dp;
117 
122  std::vector<Real> _dmobility_ds;
123 };
124 
125 #endif // Q2PPOREPRESSUREFLUX
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...
const RichardsDensity & _density
fluid density
virtual void computeJacobian()
this simply calls upwind
Real _viscosity
fluid viscosity
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Real computeQpJac(unsigned int dvar)
the derivative of the flux without the upstream mobility terms
const VariableValue & _sat
saturation at the nodes
unsigned int _sat_var
variable number of the saturation variable
This is a fully upwinded flux Kernel The Variable of this Kernel should be the porepressure.
Q2PPorepressureFlux(const InputParameters &parameters)
const MaterialProperty< RealTensorValue > & _permeability
permeability
const RichardsRelPerm & _relperm
fluid relative permeability
std::vector< Real > _dmobility_ds
d(_mobility)/d(saturation) These are used in the jacobian calculations
virtual Real computeQpResidual()
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quad...
unsigned int _num_nodes
number of nodes in the element
virtual void computeOffDiagJacobian(unsigned int jvar)
this simply calls upwind
void prepareNodalValues()
calculates the nodal values of mobility, and derivatives thereof
virtual void computeResidual()
This simply calls upwind.
std::vector< Real > _dmobility_dp
d(_mobility)/d(porepressure) These are used in the jacobian calculations
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
InputParameters validParams< Q2PPorepressureFlux >()
std::vector< Real > _mobility
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the...
const MaterialProperty< RealVectorValue > & _gravity
gravity