62 virtual Real dmobility(
unsigned nodenum,
unsigned phase,
unsigned pvar)
const;
177 std::unordered_map<unsigned, std::vector<std::vector<unsigned>>>
_num_upwinds;
227 std::vector<unsigned>
computeMaxSwaps(
unsigned elem,
unsigned int num_nodes)
const;
virtual void computeResidualAndJacobian()
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_qp_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the qp) – null for AD pa...
Moose::GenericType< Real, is_ad > GenericReal
virtual GenericReal< is_ad > darcyQp(unsigned int ph) const
The Darcy part of the flux (this is the non-upwinded part)
const GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_density_node
Fluid density for each phase (at the node)
const Elem * _my_elem_darcy
Element pointer cached on the first AD computeOffDiagJacobian() call for an element so that the remai...
void applyUpwinding(const std::vector< unsigned > &max_swaps, JacRes res_or_jac, unsigned int pvar)
Apply selected upwinding/fallback scheme for all phases.
std::unordered_map< unsigned, std::vector< std::vector< unsigned > > > _num_upwinds
Number of nonlinear iterations (in this timestep and this element) that a node is an upwind node for ...
const bool _perm_derivs
Flag to check whether permeabiity derivatives are non-zero.
void fullyUpwind(JacRes res_or_jac, unsigned int ph, unsigned int pvar)
Calculate the residual or Jacobian using full upwinding.
const InputParameters & parameters() const
enum PorousFlowDarcyBaseTempl::FallbackEnum _fallback_scheme
std::vector< std::vector< GenericReal< is_ad > > > _proto_flux
The Darcy flux.
virtual void computeResidualAndJacobian() override
void adComputeProtoFlux(bool do_counting)
For the AD path: fills _proto_flux (per-phase, per-node ADReal) by integrating darcyQp and applying t...
const MaterialProperty< std::vector< RealTensorValue > > *const _dpermeability_dvar
d(permeabiity)/d(PorousFlow variable) – null for AD path
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
std::vector< std::vector< std::vector< Real > > > _jacobian
Derivative of _proto_flux with respect to nodal variables.
virtual void computeResidual() override
std::vector< unsigned > computeMaxSwaps(unsigned elem, unsigned int num_nodes) const
Compute per-phase maximum upwind/downwind swap counts for this element.
const GenericMaterialProperty< RealTensorValue, is_ad > & _permeability
Permeability of porous material.
const GenericMaterialProperty< std::vector< Real >, is_ad > & _pp
Nodal pore pressure in each phase.
void assembleProtoFluxResidual()
Assemble the real-valued residual vector from _proto_flux into the tagged local residual (and apply s...
PorousFlowDarcyBaseTempl(const InputParameters ¶meters)
void quickUpwind(JacRes res_or_jac, unsigned int ph, unsigned int pvar)
Calculate the residual or Jacobian using the nodal mobilities, but without conserving fluid mass...
const RealVectorValue _gravity
Gravity. Defaults to 9.81 m/s^2.
virtual void computeOffDiagJacobian(unsigned int jvar) override
void initializeUpwindTracking(unsigned elem, unsigned int num_nodes)
Ensure per-element upwind/downwind counters are allocated for this element.
const GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_viscosity
Viscosity of each component in each phase.
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
virtual void timestepSetup() override
void computeProtoFluxWithoutMobility()
Build proto fluxes (without mobility weighting) for all phases and nodes.
static InputParameters validParams()
void harmonicMean(JacRes res_or_jac, unsigned int ph, unsigned int pvar)
Calculate the residual or Jacobian by using the harmonic mean of the nodal mobilities for the entire ...
PorousFlowDarcyBaseTempl< true > ADPorousFlowDarcyBase
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_viscosity_dvar
Derivative of the fluid viscosity for each phase wrt PorousFlow variables – null for AD path...
usingGenericKernelMembers
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > *const _dpermeability_dgradvar
d(permeabiity)/d(grad(PorousFlow variable)) – null for AD path
void adComputeJacobian()
For the AD path: performs the proto-flux/upwinding pass and hands the per-node ADReal residuals to ad...
const MaterialProperty< std::vector< std::vector< RealGradient > > > *const _dgrad_p_dvar
Derivative of Grad porepressure in each phase wrt PorousFlow variables – null for AD path...
const unsigned int _num_phases
The number of fluid phases.
const GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_density_qp
Fluid density for each phase (at the qp)
const MaterialProperty< std::vector< std::vector< Real > > > *const _dgrad_p_dgrad_var
Derivative of Grad porepressure in each phase wrt grad(PorousFlow variables) – null for AD path...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real darcyQpJacobian(unsigned int jvar, unsigned int ph) const
Jacobian of the Darcy part of the flux – non-AD path only.
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
virtual Real dmobility(unsigned nodenum, unsigned phase, unsigned pvar) const
The derivative of mobility with respect to PorousFlow variable pvar – non-AD path only...
virtual void jacobianSetup() override
virtual GenericReal< is_ad > mobility(unsigned nodenum, unsigned phase) const
The mobility of the fluid.
std::unordered_map< unsigned, std::vector< std::vector< unsigned > > > _num_downwinds
Number of nonlinear iterations (in this timestep and this element) that a node is an downwind node fo...
const unsigned _full_upwind_threshold
If the number of upwind-downwind swaps is less than this amount then full upwinding is used...
void updateUpwindCounts(unsigned elem, unsigned int num_nodes)
Update upwind/downwind counters from the sign of _proto_flux.
virtual GenericReal< is_ad > computeQpResidual() override
PorousFlowDarcyBaseTempl< false > PorousFlowDarcyBase
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_node_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the node) – null for AD ...
virtual void computeJacobian() override
const GenericMaterialProperty< std::vector< RealGradient >, is_ad > & _grad_p
Gradient of the pore pressure in each phase.
FallbackEnum
If full upwinding is failing due to nodes swapping between upwind and downwind in successive nonlinea...