21 "A RichardsDensity UserObject that defines the fluid density as a function of pressure.");
24 "A RichardsRelPerm UserObject (eg RichardsRelPermPower) that defines the " 25 "fluid relative permeability as a function of the saturation Variable.");
27 "The other variable in the 2-phase system. If " 28 "Variable=porepressure, the other_var=saturation, and " 31 "This flag is needed to correctly calculate the Jacobian entries. " 32 "If set to true, this Sink will extract fluid from the phase with " 33 "porepressure as its Variable (usually the liquid phase). If set " 34 "to false, this Sink will extract fluid from the phase with " 35 "saturation as its variable (usually the gas phase)");
37 params.
addClassDescription(
"Approximates a borehole in the mesh with given bottomhole pressure, " 38 "and radii using a number of point sinks whose positions are read " 39 "from a file. This DiracKernel is for use by Q2P models");
47 _other_var_nodal(coupledDofValues(
"other_var")),
48 _other_var_num(coupled(
"other_var")),
49 _var_is_pp(getParam<bool>(
"var_is_porepressure")),
50 _viscosity(getParam<
Real>(
"fluid_viscosity")),
71 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
79 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
93 for (
unsigned int nodenum = 0; nodenum <
_num_nodes; ++nodenum)
116 if (character == 0.0)
119 const Real bh_pressure =
135 if (current_dirac_ptid > 0)
143 _rs[current_dirac_ptid]);
144 if ((character < 0.0 &&
_pp[
_i] < bh_pressure) || (character > 0.0 &&
_pp[
_i] > bh_pressure))
150 if (current_dirac_ptid + 1 <
_zs.size() ||
_zs.size() == 1)
157 _rs[current_dirac_ptid]);
158 if ((character < 0.0 &&
_pp[
_i] < bh_pressure) || (character > 0.0 &&
_pp[
_i] > bh_pressure))
197 if (character == 0.0)
200 const Real bh_pressure =
217 const bool deriv_wrt_pp =
221 if (current_dirac_ptid > 0)
228 _rs[current_dirac_ptid]);
229 if ((character < 0.0 &&
_pp[
_i] < bh_pressure) || (character > 0.0 &&
_pp[
_i] > bh_pressure))
233 outflowp +=
std::abs(character) * wc *
240 if (current_dirac_ptid <
_zs.size() - 1 ||
_zs.size() == 1)
247 _rs[current_dirac_ptid]);
248 if ((character < 0.0 &&
_pp[
_i] < bh_pressure) || (character > 0.0 &&
_pp[
_i] > bh_pressure))
252 outflowp +=
std::abs(character) * wc *
unsigned int _num_nodes
number of nodes in this element.
const RichardsRelPerm & _relperm
fluid relative permeability
const MooseArray< Point > & _q_point
virtual Real drelperm(Real seff) const =0
derivative of relative permeability wrt effective saturation This must be over-ridden in your derived...
virtual Real ddensity(Real p) const =0
derivative of fluid density wrt porepressure This must be over-ridden in derived classes to provide a...
std::vector< Real > _dmobility_dp
nodal d(mobility)/d(porepressure)
Real wellConstant(const RealTensorValue &perm, const RealTensorValue &rot, const Real &half_len, const Elem *ele, const Real &rad)
Calculates Peaceman's form of the borehole well constant Z Chen, Y Zhang, Well flow models for variou...
unsigned int number() const
Base class for Richards relative permeability classes that provide relative permeability as a functio...
const unsigned int _other_var_num
the variable number of the other variable
registerMooseObject("RichardsApp", Q2PBorehole)
std::vector< Real > _rs
radii of the borehole
const OutputTools< T >::VariableTestValue & _test
virtual Real computeQpResidual()
Computes the Qp residual.
static const std::string density
unsigned currentPointCachedID()
const VariableValue & _other_var_nodal
the other variable in the 2-phase system (this is saturation if Variable=porepressure, and viceversa)
Approximates a borehole by a sequence of Dirac Points.
static InputParameters validParams()
Creates a new PeacemanBorehole This reads the file containing the lines of the form radius x y z that...
std::vector< Real > _mobility
nodal mobility
Q2PBorehole(const InputParameters ¶meters)
virtual void computeResidual()
Computes the residual.
void prepareNodalValues()
calculates the nodal values of pressure, mobility, and derivatives thereof
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
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...
TensorValue< Real > RealTensorValue
virtual void computeJacobian()
Computes the Jacobian.
static InputParameters validParams()
Creates a new Q2PBorehole This sets all the variables, but also reads the file containing the lines o...
const Real _viscosity
viscosity
std::vector< Real > _sat
nodal saturation
const RealVectorValue _unit_weight
unit weight of fluid in borehole (for calculating bottomhole pressure at each Dirac Point) ...
MooseVariableField< T > & _var
virtual Real computeQpJacobian()
Computes the diagonal part of the jacobian.
virtual Real relperm(Real seff) const =0
relative permeability as a function of effective saturation This must be over-ridden in your derived ...
virtual const DoFValue & dofValues() const =0
void add(Real contrib)
adds contrib to _total
RichardsSumQuantity & _total_outflow_mass
This is used to hold the total fluid flowing into the borehole Hence, it is positive for production w...
const RichardsDensity & _density
fluid density
const Elem *const & _current_elem
const Real _p_bot
bottomhole pressure of borehole
std::vector< Real > _dmobility_ds
nodal d(mobility)/d(saturation)
const bool _var_is_pp
whether the Variable for this BC is porepressure or not
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Approximates a borehole by a sequence of Dirac Points.
virtual void computeJacobian() override
const MaterialProperty< RealTensorValue > & _permeability
permeability
Real jac(unsigned int jvar)
Calculates Jacobian.
Point _bottom_point
the bottom point of the borehole (where bottom_pressure is defined)
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
std::vector< RealTensorValue > _rot_matrix
rotation matrix used in well_constant calculation
std::vector< Real > _half_seg_len
0.5*(length of polyline segments between points)
virtual Real value(Real t, const Point &p) const
std::vector< Real > _zs
z points of borehole
std::vector< Real > _pp
nodal porepressure
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Computes the off-diagonal part of the jacobian.
virtual void computeResidual() override
const Function & _character
If positive then the borehole acts as a sink (producion well) for porepressure > borehole pressure...