www.mooseframework.org
Q2PSaturationFlux.h
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 
10 #pragma once
11 
12 #include "Kernel.h"
13 #include "RichardsDensity.h"
14 #include "RichardsRelPerm.h"
15 #include "Material.h"
16 
17 // Forward Declarations
18 
42 class Q2PSaturationFlux : public Kernel
43 {
44 public:
46 
48 
49 protected:
55  virtual Real computeQpResidual() override;
56 
58  virtual void computeResidual() override;
59 
61  virtual void computeOffDiagJacobian(unsigned int jvar) override;
62 
64  virtual void computeJacobian() override;
65 
67  Real computeQpJac(unsigned int dvar);
68 
76  void upwind(bool compute_res, bool compute_jac, unsigned int jvar);
77 
79  void prepareNodalValues();
80 
83 
85  const VariableValue & _pp;
86 
89 
92 
94  unsigned int _pp_var;
95 
98 
101 
104 
107 
109  unsigned int _num_nodes;
110 
115  std::vector<Real> _mobility;
116 
121  std::vector<Real> _dmobility_dp;
122 
127  std::vector<Real> _dmobility_ds;
128 };
virtual Real computeQpResidual() override
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quad...
void prepareNodalValues()
calculates the nodal values of mobility, and derivatives thereof
OutputTools< Real >::VariableGradient VariableGradient
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...
virtual void computeOffDiagJacobian(unsigned int jvar) override
this simply calls upwind
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
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...
const VariableGradient & _grad_pp
grad(porepressure) at the quadpoints
const VariableValue & _pp
porepressure at the quadpoints
unsigned int _pp_var
variable number of the porepressure variable
virtual void computeJacobian() override
this simply calls upwind
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)
static InputParameters validParams()
OutputTools< Real >::VariableValue VariableValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _pp_nodal
porepressure at the nodes
virtual void computeResidual() override
This simply calls upwind.
const InputParameters & parameters() const
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