This is a fully upwinded version of RichardsFlux. More...
#include <RichardsFullyUpwindFlux.h>
Public Member Functions | |
RichardsFullyUpwindFlux (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... | |
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 RichardsVarNames & | _richards_name_UO |
holds info regarding the names of the Richards variables and methods for extracting values of these variables More... | |
unsigned int | _num_p |
number of richards variables More... | |
unsigned int | _pvar |
the index of this variable in the list of Richards variables held by _richards_name_UO. More... | |
const RichardsDensity & | _density_UO |
user object defining the density More... | |
const RichardsSeff & | _seff_UO |
user object defining the effective saturation More... | |
const RichardsRelPerm & | _relperm_UO |
user object defining the relative permeability More... | |
const MaterialProperty< std::vector< Real > > & | _viscosity |
viscosities More... | |
const MaterialProperty< std::vector< RealVectorValue > > & | _flux_no_mob |
permeability*(grad(pressure) - density*gravity) (a vector of these in the multiphase case) More... | |
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & | _dflux_no_mob_dv |
d(_flux_no_mob)/d(variable) More... | |
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & | _dflux_no_mob_dgradv |
d(_flux_no_mob)/d(grad(variable)) More... | |
unsigned int | _num_nodes |
number of nodes in this 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< std::vector< Real > > | _dmobility_dv |
d(_mobility)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jacobian calculations More... | |
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 this variable's nodal porepressure values So: (*_ps_at_nodes[_pvar])[i] = _var.dofValues()[i] = value of porepressure at node i. More... | |
This is a fully upwinded version of RichardsFlux.
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 47 of file RichardsFullyUpwindFlux.h.
RichardsFullyUpwindFlux::RichardsFullyUpwindFlux | ( | const InputParameters & | parameters | ) |
Definition at line 39 of file RichardsFullyUpwindFlux.C.
|
overrideprotectedvirtual |
this simply calls upwind
Definition at line 118 of file RichardsFullyUpwindFlux.C.
|
protected |
the derivative of the flux without the upstream mobility terms
Definition at line 125 of file RichardsFullyUpwindFlux.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 103 of file RichardsFullyUpwindFlux.C.
Referenced by upwind().
|
overrideprotectedvirtual |
This simply calls upwind.
Definition at line 111 of file RichardsFullyUpwindFlux.C.
|
protected |
calculates the nodal values of mobility, and derivatives thereof
Definition at line 66 of file RichardsFullyUpwindFlux.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 134 of file RichardsFullyUpwindFlux.C.
Referenced by computeOffDiagJacobian(), and computeResidual().
|
protected |
user object defining the density
Definition at line 101 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues().
|
protected |
d(_flux_no_mob)/d(grad(variable))
Definition at line 119 of file RichardsFullyUpwindFlux.h.
Referenced by computeQpJac().
|
protected |
d(_flux_no_mob)/d(variable)
Definition at line 116 of file RichardsFullyUpwindFlux.h.
Referenced by computeQpJac().
|
protected |
d(_mobility)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jacobian calculations
Definition at line 134 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
permeability*(grad(pressure) - density*gravity) (a vector of these in the multiphase case)
Definition at line 113 of file RichardsFullyUpwindFlux.h.
Referenced by computeQpResidual().
|
protected |
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the residual
Definition at line 128 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
number of nodes in this element
Definition at line 122 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues(), and upwind().
|
protected |
number of richards variables
Definition at line 89 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues(), and RichardsFullyUpwindFlux().
|
protected |
Holds the values of pressures at all the nodes of the element Eg: _ps_at_nodes[_pvar] is a pointer to this variable's nodal porepressure values So: (*_ps_at_nodes[_pvar])[i] = _var.dofValues()[i] = value of porepressure at node i.
Definition at line 142 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues(), and RichardsFullyUpwindFlux().
|
protected |
the index of this variable in the list of Richards variables held by _richards_name_UO.
Eg if richards_vars = 'pwater pgas poil' in the _richards_name_UO and this kernel has variable = pgas, then _pvar = 1 This is used to index correctly into _viscosity, _seff, etc
Definition at line 98 of file RichardsFullyUpwindFlux.h.
Referenced by computeQpJac(), computeQpResidual(), prepareNodalValues(), and upwind().
|
protected |
user object defining the relative permeability
Definition at line 107 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues().
|
protected |
holds info regarding the names of the Richards variables and methods for extracting values of these variables
Definition at line 86 of file RichardsFullyUpwindFlux.h.
Referenced by RichardsFullyUpwindFlux(), and upwind().
|
protected |
user object defining the effective saturation
Definition at line 104 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues().
|
protected |
viscosities
Definition at line 110 of file RichardsFullyUpwindFlux.h.
Referenced by prepareNodalValues().