Approximates a borehole by a sequence of Dirac Points. More...
#include <RichardsBorehole.h>
Public Member Functions | |
RichardsBorehole (const InputParameters ¶meters) | |
Creates a new RichardsBorehole This sets all the variables, but also reads the file containing the lines of the form radius x y z that defines the borehole geometry. More... | |
virtual void | computeResidual () |
Computes the residual. More... | |
virtual Real | computeQpResidual () |
Computes the Qp residual. More... | |
virtual void | computeJacobian () |
Computes the Jacobian. More... | |
virtual Real | computeQpJacobian () |
Computes the diagonal part of the jacobian. More... | |
virtual Real | computeQpOffDiagJacobian (unsigned int jvar) |
Computes the off-diagonal part of the jacobian Note: at March2014 this is never called since moose does not have this functionality. More... | |
Protected Member Functions | |
void | prepareNodalValues () |
calculates the nodal values of pressure, mobility, and derivatives thereof More... | |
Real | jac (unsigned int wrt_num) |
Calculates Jacobian. More... | |
virtual void | addPoints () |
Add Dirac Points to the borehole. More... | |
bool | parseNextLineReals (std::ifstream &ifs, std::vector< Real > &myvec) |
reads a space-separated line of floats from ifs and puts in myvec More... | |
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 various numerical methods, Int J Num Analysis and Modeling, 3 (2008) 375-388. More... | |
Protected Attributes | |
const bool | _fully_upwind |
Whether to use full upwinding. More... | |
const RichardsVarNames & | _richards_name_UO |
Defines the richards variables in the simulation. More... | |
const unsigned int | _num_p |
number of richards variables More... | |
const unsigned int | _pvar |
The moose internal variable number of the richards variable of this Dirac Kernel. More... | |
const RichardsDensity * | _density_UO |
user object defining the density. Only used if _fully_upwind = true More... | |
const RichardsSeff * | _seff_UO |
user object defining the effective saturation. Only used if _fully_upwind = true More... | |
const RichardsRelPerm * | _relperm_UO |
user object defining the relative permeability. Only used if _fully_upwind = true More... | |
unsigned int | _num_nodes |
number of nodes in this element. Only used if _fully_upwind = true More... | |
std::vector< Real > | _mobility |
nodal values of mobility = density*relperm/viscosity These are used if _fully_upwind = true 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 if _fully_upwind = true More... | |
const MaterialProperty< std::vector< Real > > & | _pp |
fluid porepressure (or porepressures in case of multiphase) More... | |
const MaterialProperty< std::vector< std::vector< Real > > > & | _dpp_dv |
d(porepressure_i)/d(variable_j) More... | |
const MaterialProperty< std::vector< Real > > & | _viscosity |
fluid viscosity More... | |
const MaterialProperty< RealTensorValue > & | _permeability |
material permeability More... | |
const MaterialProperty< std::vector< std::vector< Real > > > & | _dseff_dv |
deriviatves of Seff wrt variables More... | |
const MaterialProperty< std::vector< Real > > & | _rel_perm |
relative permeability More... | |
const MaterialProperty< std::vector< std::vector< Real > > > & | _drel_perm_dv |
d(relperm_i)/d(variable_j) More... | |
const MaterialProperty< std::vector< Real > > & | _density |
fluid density More... | |
const MaterialProperty< std::vector< std::vector< Real > > > & | _ddensity_dv |
d(density_i)/d(variable_j) More... | |
std::vector< const VariableValue * > | _ps_at_nodes |
Holds the values of pressures at all the nodes of the element Only used if _fully_upwind = true Eg: _ps_at_nodes[_pvar] is a pointer to this variable's nodal porepressure values So: (*_ps_at_nodes[_pvar])[i] = _var.dofValues()[i] = porepressure of pressure-variable _pvar at node i. More... | |
const Function & | _character |
If positive then the borehole acts as a sink (producion well) for porepressure > borehole pressure, and does nothing otherwise If negative then the borehole acts as a source (injection well) for porepressure < borehole pressure, and does nothing otherwise The flow rate to/from the borehole is multiplied by |character|, so usually character = +/- 1. More... | |
const Real | _p_bot |
bottomhole pressure of borehole More... | |
const RealVectorValue | _unit_weight |
unit weight of fluid in borehole (for calculating bottomhole pressure at each Dirac Point) More... | |
RichardsSumQuantity & | _total_outflow_mass |
This is used to hold the total fluid flowing into the borehole Hence, it is positive for production wells where fluid is flowing from porespace into the borehole and removed from the model. More... | |
std::vector< Real > | _rs |
radii of the borehole More... | |
std::vector< Real > | _xs |
x points of the borehole More... | |
std::vector< Real > | _ys |
y points of the borehole More... | |
std::vector< Real > | _zs |
z points of borehole More... | |
Point | _bottom_point |
the bottom point of the borehole (where bottom_pressure is defined) More... | |
std::vector< Real > | _half_seg_len |
0.5*(length of polyline segments between points) More... | |
std::vector< RealTensorValue > | _rot_matrix |
rotation matrix used in well_constant calculation More... | |
Private Attributes | |
const Real | _re_constant |
borehole constant More... | |
const Real | _well_constant |
well constant More... | |
const Real | _borehole_length |
borehole length. Note this is only used if there is only one borehole point More... | |
const RealVectorValue | _borehole_direction |
borehole direction. Note this is only used if there is only one borehole point More... | |
const std::string | _point_file |
File defining the geometry of the borehole. More... | |
Approximates a borehole by a sequence of Dirac Points.
Definition at line 27 of file RichardsBorehole.h.
RichardsBorehole::RichardsBorehole | ( | const InputParameters & | parameters | ) |
Creates a new RichardsBorehole This sets all the variables, but also reads the file containing the lines of the form radius x y z that defines the borehole geometry.
It also calculates segment-lengths and rotation matrices needed for computing the borehole well constant
Definition at line 41 of file RichardsBorehole.C.
|
protectedvirtualinherited |
|
virtual |
Computes the Jacobian.
This just calls prepareNodalValues, if _fully_upwind then calls DiracKernel::computeJacobian
Definition at line 204 of file RichardsBorehole.C.
|
virtual |
|
virtual |
Computes the off-diagonal part of the jacobian Note: at March2014 this is never called since moose does not have this functionality.
Hence as of March2014 this has never been tested.
Definition at line 221 of file RichardsBorehole.C.
|
virtual |
|
virtual |
Computes the residual.
This just calls prepareNodalValues, if _fully_upwind then calls DiracKernel::computeResidual
Definition at line 128 of file RichardsBorehole.C.
|
protected |
Calculates Jacobian.
wrt_num | differentiate the residual wrt this Richards variable |
Definition at line 230 of file RichardsBorehole.C.
Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().
|
protectedinherited |
reads a space-separated line of floats from ifs and puts in myvec
Definition at line 158 of file PeacemanBorehole.C.
Referenced by PeacemanBorehole::PeacemanBorehole().
|
protected |
calculates the nodal values of pressure, mobility, and derivatives thereof
Definition at line 88 of file RichardsBorehole.C.
Referenced by computeJacobian(), and computeResidual().
|
protectedinherited |
Calculates Peaceman's form of the borehole well constant Z Chen, Y Zhang, Well flow models for various numerical methods, Int J Num Analysis and Modeling, 3 (2008) 375-388.
Definition at line 194 of file PeacemanBorehole.C.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), and jac().
|
privateinherited |
borehole direction. Note this is only used if there is only one borehole point
Definition at line 49 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::PeacemanBorehole().
|
privateinherited |
borehole length. Note this is only used if there is only one borehole point
Definition at line 46 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::PeacemanBorehole().
|
protectedinherited |
the bottom point of the borehole (where bottom_pressure is defined)
Definition at line 94 of file PeacemanBorehole.h.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), jac(), and PeacemanBorehole::PeacemanBorehole().
|
protectedinherited |
If positive then the borehole acts as a sink (producion well) for porepressure > borehole pressure, and does nothing otherwise If negative then the borehole acts as a source (injection well) for porepressure < borehole pressure, and does nothing otherwise The flow rate to/from the borehole is multiplied by |character|, so usually character = +/- 1.
Definition at line 66 of file PeacemanBorehole.h.
Referenced by computeQpJacobian(), Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), and jac().
|
protected |
|
protected |
fluid density
Definition at line 132 of file RichardsBorehole.h.
Referenced by computeQpResidual(), and jac().
|
protected |
user object defining the density. Only used if _fully_upwind = true
Definition at line 87 of file RichardsBorehole.h.
Referenced by prepareNodalValues().
|
protected |
d(_mobility)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jacobian calculations if _fully_upwind = true
Definition at line 108 of file RichardsBorehole.h.
Referenced by jac(), and prepareNodalValues().
|
protected |
d(porepressure_i)/d(variable_j)
Definition at line 114 of file RichardsBorehole.h.
Referenced by jac().
|
protected |
|
protected |
deriviatves of Seff wrt variables
Definition at line 123 of file RichardsBorehole.h.
|
protected |
Whether to use full upwinding.
Definition at line 75 of file RichardsBorehole.h.
Referenced by computeJacobian(), computeQpResidual(), computeResidual(), and jac().
|
protectedinherited |
0.5*(length of polyline segments between points)
Definition at line 97 of file PeacemanBorehole.h.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), jac(), and PeacemanBorehole::PeacemanBorehole().
|
protected |
nodal values of mobility = density*relperm/viscosity These are used if _fully_upwind = true
Definition at line 102 of file RichardsBorehole.h.
Referenced by computeQpResidual(), jac(), and prepareNodalValues().
|
protected |
number of nodes in this element. Only used if _fully_upwind = true
Definition at line 96 of file RichardsBorehole.h.
Referenced by prepareNodalValues().
|
protected |
number of richards variables
Definition at line 81 of file RichardsBorehole.h.
Referenced by prepareNodalValues(), and RichardsBorehole().
|
protectedinherited |
bottomhole pressure of borehole
Definition at line 69 of file PeacemanBorehole.h.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), and jac().
|
protected |
material permeability
Definition at line 120 of file RichardsBorehole.h.
Referenced by computeQpResidual(), and jac().
|
privateinherited |
File defining the geometry of the borehole.
Each row has format radius x y z and the list of such points defines a polyline that is the borehole
Definition at line 56 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::PeacemanBorehole().
|
protected |
fluid porepressure (or porepressures in case of multiphase)
Definition at line 111 of file RichardsBorehole.h.
Referenced by computeQpResidual(), and jac().
|
protected |
Holds the values of pressures at all the nodes of the element Only used if _fully_upwind = true Eg: _ps_at_nodes[_pvar] is a pointer to this variable's nodal porepressure values So: (*_ps_at_nodes[_pvar])[i] = _var.dofValues()[i] = porepressure of pressure-variable _pvar at node i.
Definition at line 145 of file RichardsBorehole.h.
Referenced by computeQpResidual(), jac(), prepareNodalValues(), and RichardsBorehole().
|
protected |
The moose internal variable number of the richards variable of this Dirac Kernel.
Definition at line 84 of file RichardsBorehole.h.
Referenced by computeQpJacobian(), computeQpResidual(), jac(), and prepareNodalValues().
|
privateinherited |
borehole constant
Definition at line 40 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::wellConstant().
|
protected |
relative permeability
Definition at line 126 of file RichardsBorehole.h.
Referenced by computeQpResidual(), and jac().
|
protected |
user object defining the relative permeability. Only used if _fully_upwind = true
Definition at line 93 of file RichardsBorehole.h.
Referenced by prepareNodalValues().
|
protected |
Defines the richards variables in the simulation.
Definition at line 78 of file RichardsBorehole.h.
Referenced by computeQpOffDiagJacobian(), and RichardsBorehole().
|
protectedinherited |
rotation matrix used in well_constant calculation
Definition at line 100 of file PeacemanBorehole.h.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), jac(), and PeacemanBorehole::PeacemanBorehole().
|
protectedinherited |
radii of the borehole
Definition at line 82 of file PeacemanBorehole.h.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), jac(), and PeacemanBorehole::PeacemanBorehole().
|
protected |
user object defining the effective saturation. Only used if _fully_upwind = true
Definition at line 90 of file RichardsBorehole.h.
Referenced by prepareNodalValues().
|
protectedinherited |
This is used to hold the total fluid flowing into the borehole Hence, it is positive for production wells where fluid is flowing from porespace into the borehole and removed from the model.
Definition at line 79 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::addPoints(), Q2PBorehole::computeQpResidual(), computeQpResidual(), and PeacemanBorehole::PeacemanBorehole().
|
protectedinherited |
unit weight of fluid in borehole (for calculating bottomhole pressure at each Dirac Point)
Definition at line 72 of file PeacemanBorehole.h.
Referenced by Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), and jac().
|
protected |
fluid viscosity
Definition at line 117 of file RichardsBorehole.h.
Referenced by computeQpResidual(), jac(), and prepareNodalValues().
|
privateinherited |
well constant
Definition at line 43 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::wellConstant().
|
protectedinherited |
x points of the borehole
Definition at line 85 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::addPoints(), and PeacemanBorehole::PeacemanBorehole().
|
protectedinherited |
y points of the borehole
Definition at line 88 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::addPoints(), and PeacemanBorehole::PeacemanBorehole().
|
protectedinherited |
z points of borehole
Definition at line 91 of file PeacemanBorehole.h.
Referenced by PeacemanBorehole::addPoints(), Q2PBorehole::computeQpResidual(), computeQpResidual(), Q2PBorehole::jac(), jac(), and PeacemanBorehole::PeacemanBorehole().