This is a fully upwinded flux Kernel The Variable of this Kernel should be the porepressure. More...
#include <Q2PPorepressureFlux.h>
Public Member Functions | |
Q2PPorepressureFlux (const InputParameters ¶meters) | |
Protected Member Functions | |
virtual Real | computeQpResidual () override |
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quadpoints and then add the upwind mobility parts. More... | |
virtual void | computeResidual () override |
This simply calls upwind. More... | |
virtual void | computeOffDiagJacobian (MooseVariableFEBase &jvar) override |
this simply calls upwind More... | |
virtual void | computeJacobian () override |
this simply calls upwind More... | |
Real | computeQpJac (unsigned int dvar) |
the derivative of the flux without the upstream mobility terms More... | |
void | upwind (bool compute_res, bool compute_jac, unsigned int jvar) |
Do the upwinding for both the residual and jacobian I've put both calculations in the same code to try to reduce code duplication. More... | |
void | prepareNodalValues () |
calculates the nodal values of mobility, and derivatives thereof More... | |
Protected Attributes | |
const RichardsDensity & | _density |
fluid density More... | |
const VariableValue & | _sat |
saturation at the nodes More... | |
unsigned int | _sat_var |
variable number of the saturation variable More... | |
const RichardsRelPerm & | _relperm |
fluid relative permeability More... | |
Real | _viscosity |
fluid viscosity More... | |
const MaterialProperty< RealVectorValue > & | _gravity |
gravity More... | |
const MaterialProperty< RealTensorValue > & | _permeability |
permeability More... | |
unsigned int | _num_nodes |
number of nodes in the element More... | |
std::vector< Real > | _mobility |
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the residual More... | |
std::vector< Real > | _dmobility_dp |
d(_mobility)/d(porepressure) These are used in the jacobian calculations More... | |
std::vector< Real > | _dmobility_ds |
d(_mobility)/d(saturation) These are used in the jacobian calculations More... | |
This is a fully upwinded flux Kernel The Variable of this Kernel should be the porepressure.
The residual for the kernel is the darcy flux. This is R_i = int{mobility*flux_no_mob} = int{mobility*grad(pot)*permeability*grad(test_i)} for node i. where int is the integral over the element, and pot = Porepressure - density*gravity.x
However, in fully-upwind, the first step is to take the mobility outside the integral. R_i = mobility*int{flux_no_mob} = mobility*F_i NOTE: R_i is exactly the mass flux flowing out of node i. Similarly, F_i is a measure of fluid flowing out of node i.
This leads to the definition of upwinding:
If F_i is positive then R_i = mobility_i * F_i That is, we use the upwind value of mobility.
For the F_i<0 nodes we construct their R_i using mass conservation
Definition at line 46 of file Q2PPorepressureFlux.h.
Q2PPorepressureFlux::Q2PPorepressureFlux | ( | const InputParameters & | parameters | ) |
Definition at line 43 of file Q2PPorepressureFlux.C.
|
overrideprotectedvirtual |
this simply calls upwind
Definition at line 103 of file Q2PPorepressureFlux.C.
|
overrideprotectedvirtual |
this simply calls upwind
Definition at line 109 of file Q2PPorepressureFlux.C.
|
protected |
the derivative of the flux without the upstream mobility terms
Definition at line 115 of file Q2PPorepressureFlux.C.
Referenced by upwind().
|
overrideprotectedvirtual |
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quadpoints and then add the upwind mobility parts.
Definition at line 88 of file Q2PPorepressureFlux.C.
Referenced by upwind().
|
overrideprotectedvirtual |
This simply calls upwind.
Definition at line 97 of file Q2PPorepressureFlux.C.
|
protected |
calculates the nodal values of mobility, and derivatives thereof
Definition at line 60 of file Q2PPorepressureFlux.C.
Referenced by upwind().
|
protected |
Do the upwinding for both the residual and jacobian I've put both calculations in the same code to try to reduce code duplication.
This is because when calculating the jacobian we need to calculate the residual to see which nodes are upwind and which are downwind
Definition at line 128 of file Q2PPorepressureFlux.C.
Referenced by computeJacobian(), computeOffDiagJacobian(), and computeResidual().
|
protected |
fluid density
Definition at line 85 of file Q2PPorepressureFlux.h.
Referenced by computeQpJac(), computeQpResidual(), and prepareNodalValues().
|
protected |
d(_mobility)/d(porepressure) These are used in the jacobian calculations
Definition at line 118 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
d(_mobility)/d(saturation) These are used in the jacobian calculations
Definition at line 124 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
gravity
Definition at line 100 of file Q2PPorepressureFlux.h.
Referenced by computeQpJac(), and computeQpResidual().
|
protected |
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the residual
Definition at line 112 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
number of nodes in the element
Definition at line 106 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
permeability
Definition at line 103 of file Q2PPorepressureFlux.h.
Referenced by computeQpJac(), and computeQpResidual().
|
protected |
fluid relative permeability
Definition at line 94 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues().
|
protected |
saturation at the nodes
Definition at line 88 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues().
|
protected |
variable number of the saturation variable
Definition at line 91 of file Q2PPorepressureFlux.h.
Referenced by upwind().
|
protected |
fluid viscosity
Definition at line 97 of file Q2PPorepressureFlux.h.
Referenced by prepareNodalValues().