26 "If true, then fluxes are multiplied by (density*permeability_nn/viscosity), " 27 "where the '_nn' indicates the component normal to the boundary. In this " 28 "case bare_flux is measured in Pa.s^-1. This can be used in conjunction " 31 "If true, then fluxes are multiplied by relative " 32 "permeability. This can be used in conjunction " 35 "pressures",
"Tuple of pressure values. Must be monotonically increasing.");
38 "Tuple of flux values (measured in kg.m^-2.s^-1 for use_mobility=false, and " 39 "in Pa.s^-1 if use_mobility=true). This flux is OUT of the medium: hence " 40 "positive values of flux means this will be a SINK, while negative values " 41 "indicate this flux will be a SOURCE. A piecewise-linear fit is performed to " 42 "the (pressure,bare_fluxes) pairs to obtain the flux at any arbitrary " 43 "pressure, and the first or last bare_flux values are used if the quad-point " 44 "pressure falls outside this range.");
45 params.
addParam<FunctionName>(
"multiplying_fcn",
47 "If this function is provided, the flux " 48 "will be multiplied by this function. " 49 "This is useful for spatially or " 50 "temporally varying sinks");
53 "A RichardsDensity UserObject that defines the fluid density as a function of pressure.");
56 "A RichardsRelPerm UserObject (eg RichardsRelPermPower) that defines the " 57 "fluid relative permeability as a function of the saturation Variable.");
59 "The other variable in the 2-phase system. If " 60 "Variable=porepressure, the other_var=saturation, and " 63 "This flag is needed to correctly calculate the Jacobian entries. " 64 "If set to true, this Sink will extract fluid from the phase with " 65 "porepressure as its Variable (usually the liquid phase). If set " 66 "to false, this Sink will extract fluid from the phase with " 67 "saturation as its variable (usually the gas phase)");
69 params.
addClassDescription(
"Sink of fluid, controlled by (pressure, bare_fluxes) interpolation. " 70 "This is for use in Q2P models");
76 _use_mobility(getParam<bool>(
"use_mobility")),
77 _use_relperm(getParam<bool>(
"use_relperm")),
78 _sink_func(getParam<
std::vector<
Real>>(
"pressures"),
79 getParam<
std::vector<
Real>>(
"bare_fluxes")),
80 _m_func(getFunction(
"multiplying_fcn")),
83 _other_var_nodal(coupledDofValues(
"other_var")),
84 _other_var_num(coupled(
"other_var")),
85 _var_is_pp(getParam<bool>(
"var_is_porepressure")),
86 _viscosity(getParam<
Real>(
"fluid_viscosity")),
92 _dnodal_density_dp(0),
108 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
116 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
128 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
139 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
const VariableTestValue & _test
virtual void computeOffDiagJacobian(unsigned int jvar) override
void prepareNodalValues()
calculates the nodal values of pressure, mobility, and derivatives thereof
virtual void computeJacobian() override
virtual void computeResidual() override
virtual void computeOffDiagJacobian(unsigned int jvar) override
virtual Real drelperm(Real seff) const =0
derivative of relative permeability wrt effective saturation This must be over-ridden in your derived...
const MooseArray< Point > & _normals
std::vector< Real > _nodal_density
nodal values of fluid density
LinearInterpolation _sink_func
piecewise-linear function of porepressure (this defines the strength of the sink) ...
virtual Real ddensity(Real p) const =0
derivative of fluid density wrt porepressure This must be over-ridden in derived classes to provide a...
bool _use_mobility
whether to multiply the sink flux by permeability*density/viscosity
Q2PPiecewiseLinearSink(const InputParameters ¶meters)
unsigned int number() const
Base class for Richards relative permeability classes that provide relative permeability as a functio...
static InputParameters validParams()
T sample(const T &x) const
Real jac(unsigned int wrt_num)
derivative of residual wrt the wrt_num variable
unsigned int _other_var_num
the variable number of the other variable
static InputParameters validParams()
Applies a fully-upwinded flux sink to a boundary The sink is a piecewise linear function of porepress...
virtual Real computeQpResidual() override
bool _var_is_pp
whether the Variable for this BC is porepressure or not
virtual void computeJacobian() override
virtual Real density(Real p) const =0
fluid density as a function of porepressure This must be over-ridden in derived classes to provide an...
const MooseArray< Point > & _q_point
TensorValue< Real > RealTensorValue
T sampleDerivative(const T &x) const
Real deriv(unsigned n, unsigned alpha, unsigned beta, Real x)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
registerMooseObject("RichardsApp", Q2PPiecewiseLinearSink)
virtual Real relperm(Real seff) const =0
relative permeability as a function of effective saturation This must be over-ridden in your derived ...
std::vector< Real > _dnodal_density_dp
d(_nodal_density)/d(porepressure)
std::vector< Real > _pp
nodal values of porepressure
const RichardsRelPerm & _relperm
fluid relative permeability
virtual Real computeQpJacobian() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const DoFValue & dofValues() const override
const MaterialProperty< RealTensorValue > & _permeability
permeability
bool _use_relperm
whether to multiply the sink flux by relative permeability
std::vector< Real > _dnodal_relperm_ds
d(_nodal_relperm)/d(saturation)
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
virtual void computeResidual() override
virtual Real value(Real t, const Point &p) const
unsigned int _num_nodes
number of nodes in this element.
std::vector< Real > _nodal_relperm
nodal values of relative permeability
std::vector< Real > _sat
nodal values of saturation
const RichardsDensity & _density
fluid density
const Function & _m_func
sink flux gets multiplied by this function
static const std::string k
const VariableValue & _other_var_nodal
the other variable in the 2-phase system (this is saturation if Variable=porepressure, and viceversa)