www.mooseframework.org
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PorousFlowLineSink Class Referenceabstract

Approximates a line sink a sequence of Dirac Points. More...

#include <PorousFlowLineSink.h>

Inheritance diagram for PorousFlowLineSink:
[legend]

Public Member Functions

 PorousFlowLineSink (const InputParameters &parameters)
 

Protected Types

enum  PorTchoice { PorTchoice::pressure, PorTchoice::temperature }
 whether the flux is a function of pressure or temperature More...
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
virtual void addPoints () override
 Add Dirac Points to the borehole. More...
 
Real jac (unsigned int jvar)
 Jacobian contribution for the derivative wrt the variable jvar. More...
 
Real ptqp () const
 If _p_or_t==0, then returns the quadpoint porepressure, else returns the quadpoint temperature. More...
 
Real dptqp (unsigned pvar) const
 If _p_or_t==0, then returns d(quadpoint porepressure)/d(PorousFlow variable), else returns d(quadpoint temperature)/d(PorousFlow variable) More...
 
virtual Real computeQpBaseOutflow (unsigned current_dirac_ptid) const =0
 Returns the flux from the line sink (before modification by mobility, etc). Derived classes should override this. More...
 
virtual void computeQpBaseOutflowJacobian (unsigned jvar, unsigned current_dirac_ptid, Real &outflow, Real &outflowp) const =0
 Calculates the BaseOutflow as well as its derivative wrt jvar. Derived classes should override this. More...
 
bool parseNextLineReals (std::ifstream &ifs, std::vector< Real > &myvec)
 Reads a space-separated line of floats from ifs and puts in myvec. More...
 

Protected Attributes

const PorousFlowDictator_dictator
 PorousFlowDictator UserObject. More...
 
PorousFlowSumQuantity_total_outflow_mass
 This is used to hold the total fluid flowing into the line sink for each time step. More...
 
const bool _has_porepressure
 Whether a quadpoint porepressure material exists (for error checking) More...
 
const bool _has_temperature
 Whether a quadpoint temperature material exists (for error checking) More...
 
const bool _has_mass_fraction
 Whether a mass_fraction material exists (for error checking) More...
 
const bool _has_relative_permeability
 Whether a relative permeability material exists (for error checking) More...
 
const bool _has_mobility
 Whether enough materials exist to form the mobility (for error checking) More...
 
const bool _has_enthalpy
 Whether an enthalpy material exists (for error checking) More...
 
const bool _has_internal_energy
 Whether an internal-energy material exists (for error checking) More...
 
enum PorousFlowLineSink::PorTchoice _p_or_t
 
const bool _use_mass_fraction
 Whether the flux will be multiplied by the mass fraction. More...
 
const bool _use_relative_permeability
 Whether the flux will be multiplied by the relative permeability. More...
 
const bool _use_mobility
 Whether the flux will be multiplied by the mobility. More...
 
const bool _use_enthalpy
 Whether the flux will be multiplied by the enthalpy. More...
 
const bool _use_internal_energy
 Whether the flux will be multiplied by the internal-energy. More...
 
const unsigned int _ph
 The phase number. More...
 
const unsigned int _sp
 The component number (only used if _use_mass_fraction==true) More...
 
const MaterialProperty< std::vector< Real > > *const _pp
 Quadpoint pore pressure in each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dpp_dvar
 d(quadpoint pore pressure in each phase)/d(PorousFlow variable) More...
 
const MaterialProperty< Real > *const _temperature
 Quadpoint temperature. More...
 
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
 d(quadpoint temperature)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _fluid_density_node
 Fluid density for each phase (at the node) More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_node_dvar
 d(Fluid density for each phase (at the node))/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _fluid_viscosity
 Viscosity of each component in each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_viscosity_dvar
 d(Viscosity of each component in each phase)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _relative_permeability
 Relative permeability of each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _drelative_permeability_dvar
 d(Relative permeability of each phase)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _mass_fractions
 Mass fraction of each component in each phase. More...
 
const MaterialProperty< std::vector< std::vector< std::vector< Real > > > > *const _dmass_fractions_dvar
 d(Mass fraction of each component in each phase)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _enthalpy
 Enthalpy of each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _denthalpy_dvar
 d(enthalpy of each phase)/d(PorousFlow variable) More...
 
const MaterialProperty< std::vector< Real > > *const _internal_energy
 Internal_Energy of each phase. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > *const _dinternal_energy_dvar
 d(internal_energy of each phase)/d(PorousFlow variable) More...
 
const Real _line_length
 Line length. This is only used if there is only one borehole point. More...
 
const RealVectorValue _line_direction
 Line direction. 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...
 
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...
 

Detailed Description

Approximates a line sink a sequence of Dirac Points.

Definition at line 25 of file PorousFlowLineSink.h.

Member Enumeration Documentation

◆ PorTchoice

enum PorousFlowLineSink::PorTchoice
strongprotected

whether the flux is a function of pressure or temperature

Enumerator
pressure 
temperature 

Definition at line 92 of file PorousFlowLineSink.h.

const std::string temperature
Definition: NS.h:27
const std::string pressure
Definition: NS.h:26
enum PorousFlowLineSink::PorTchoice _p_or_t

Constructor & Destructor Documentation

◆ PorousFlowLineSink()

PorousFlowLineSink::PorousFlowLineSink ( const InputParameters &  parameters)

Definition at line 53 of file PorousFlowLineSink.C.

54  : PorousFlowLineGeometry(parameters),
55  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
57  const_cast<PorousFlowSumQuantity &>(getUserObject<PorousFlowSumQuantity>("SumQuantityUO"))),
58 
60  hasMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp") &&
61  hasMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_porepressure_qp_dvar")),
62  _has_temperature(hasMaterialProperty<Real>("PorousFlow_temperature_qp") &&
63  hasMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")),
65  hasMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal") &&
66  hasMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
67  "dPorousFlow_mass_frac_nodal_dvar")),
69  hasMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal") &&
70  hasMaterialProperty<std::vector<std::vector<Real>>>(
71  "dPorousFlow_relative_permeability_nodal_dvar")),
73  hasMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal") &&
74  hasMaterialProperty<std::vector<std::vector<Real>>>(
75  "dPorousFlow_relative_permeability_nodal_dvar") &&
76  hasMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_nodal") &&
77  hasMaterialProperty<std::vector<std::vector<Real>>>(
78  "dPorousFlow_fluid_phase_density_nodal_dvar") &&
79  hasMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_nodal") &&
80  hasMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_nodal_dvar")),
81  _has_enthalpy(hasMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal") &&
82  hasMaterialProperty<std::vector<std::vector<Real>>>(
83  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")),
85  hasMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_internal_energy_nodal") &&
86  hasMaterialProperty<std::vector<std::vector<Real>>>(
87  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")),
88 
89  _p_or_t(getParam<MooseEnum>("function_of").getEnum<PorTchoice>()),
90  _use_mass_fraction(isParamValid("mass_fraction_component")),
91  _use_relative_permeability(getParam<bool>("use_relative_permeability")),
92  _use_mobility(getParam<bool>("use_mobility")),
93  _use_enthalpy(getParam<bool>("use_enthalpy")),
94  _use_internal_energy(getParam<bool>("use_internal_energy")),
95 
96  _ph(getParam<unsigned int>("fluid_phase")),
97  _sp(_use_mass_fraction ? getParam<unsigned int>("mass_fraction_component") : 0),
98 
100  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")
101  : nullptr),
103  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
104  "dPorousFlow_porepressure_qp_dvar")
105  : nullptr),
107  ? &getMaterialProperty<Real>("PorousFlow_temperature_qp")
108  : nullptr),
111  ? &getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")
112  : nullptr),
115  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_nodal")
116  : nullptr),
118  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
119  "dPorousFlow_fluid_phase_density_nodal_dvar")
120  : nullptr),
122  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_nodal")
123  : nullptr),
125  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
126  "dPorousFlow_viscosity_nodal_dvar")
127  : nullptr),
131  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")
132  : nullptr),
135  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
136  "dPorousFlow_relative_permeability_nodal_dvar")
137  : nullptr),
140  ? &getMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal")
141  : nullptr),
143  ? &getMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
144  "dPorousFlow_mass_frac_nodal_dvar")
145  : nullptr),
146  _enthalpy(_has_enthalpy ? &getMaterialPropertyByName<std::vector<Real>>(
147  "PorousFlow_fluid_phase_enthalpy_nodal")
148  : nullptr),
149  _denthalpy_dvar(_has_enthalpy ? &getMaterialPropertyByName<std::vector<std::vector<Real>>>(
150  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")
151  : nullptr),
152  _internal_energy(_has_internal_energy ? &getMaterialPropertyByName<std::vector<Real>>(
153  "PorousFlow_fluid_phase_internal_energy_nodal")
154  : nullptr),
156  ? &getMaterialPropertyByName<std::vector<std::vector<Real>>>(
157  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")
158  : nullptr)
159 {
160  // zero the outflow mass
162 
163  if (_ph >= _dictator.numPhases())
164  paramError("fluid_phase",
165  "The Dictator proclaims that the maximum phase index in this simulation is ",
166  _dictator.numPhases() - 1,
167  " whereas you have used ",
168  _ph,
169  ". Remember that indexing starts at 0. You must try harder.");
170 
172  paramError(
173  "mass_fraction_component",
174  "The Dictator proclaims that the maximum fluid component index in this simulation is ",
175  _dictator.numComponents() - 1,
176  " whereas you have used ",
177  _sp,
178  ". Remember that indexing starts at 0. Please be assured that the Dictator has noted your "
179  "error.");
180 
182  mooseError("PorousFlowLineSink: You have specified function_of=porepressure, but you do not "
183  "have a quadpoint porepressure material");
184 
186  mooseError("PorousFlowLineSink: You have specified function_of=temperature, but you do not "
187  "have a quadpoint temperature material");
188 
190  mooseError("PorousFlowLineSink: You have specified a fluid component, but do not have a nodal "
191  "mass-fraction material");
192 
194  mooseError("PorousFlowLineSink: You have set use_relative_permeability=true, but do not have a "
195  "nodal relative permeability material");
196 
198  mooseError("PorousFlowLineSink: You have set use_mobility=true, but do not have nodal density, "
199  "relative permeability or viscosity material");
200 
202  mooseError("PorousFlowLineSink: You have set use_enthalpy=true, but do not have a nodal "
203  "enthalpy material");
204 
206  mooseError("PorousFlowLineSink: You have set use_internal_energy=true, but do not have a nodal "
207  "internal-energy material");
208 
209  // To correctly compute the Jacobian terms,
210  // tell MOOSE that this DiracKernel depends on all the PorousFlow Variables
211  const std::vector<MooseVariableFEBase *> & coupled_vars = _dictator.getCoupledMooseVars();
212  for (unsigned int i = 0; i < coupled_vars.size(); i++)
213  addMooseVariableDependency(coupled_vars[i]);
214 }
const bool _has_internal_energy
Whether an internal-energy material exists (for error checking)
const bool _use_enthalpy
Whether the flux will be multiplied by the enthalpy.
const unsigned int _ph
The phase number.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const bool _has_enthalpy
Whether an enthalpy material exists (for error checking)
const MaterialProperty< std::vector< Real > > *const _fluid_density_node
Fluid density for each phase (at the node)
const bool _has_temperature
Whether a quadpoint temperature material exists (for error checking)
const bool _has_relative_permeability
Whether a relative permeability material exists (for error checking)
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_viscosity_dvar
d(Viscosity of each component in each phase)/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > *const _fluid_viscosity
Viscosity of each component in each phase.
unsigned int numComponents() const
The number of fluid components.
const bool _use_relative_permeability
Whether the flux will be multiplied by the relative permeability.
const MaterialProperty< std::vector< Real > > *const _relative_permeability
Relative permeability of each phase.
void zero()
Sets _total = 0.
const bool _has_porepressure
Whether a quadpoint porepressure material exists (for error checking)
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
d(quadpoint temperature)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > *const _dpp_dvar
d(quadpoint pore pressure in each phase)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > *const _mass_fractions
Mass fraction of each component in each phase.
const bool _has_mobility
Whether enough materials exist to form the mobility (for error checking)
PorousFlowLineGeometry(const InputParameters &parameters)
Creates a new PorousFlowLineGeometry This reads the file containing the lines of the form weight x y ...
const MaterialProperty< std::vector< std::vector< Real > > > *const _dinternal_energy_dvar
d(internal_energy of each phase)/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > *const _enthalpy
Enthalpy of each phase.
unsigned int numPhases() const
The number of fluid phases.
const MaterialProperty< std::vector< std::vector< Real > > > *const _drelative_permeability_dvar
d(Relative permeability of each phase)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_node_dvar
d(Fluid density for each phase (at the node))/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > *const _pp
Quadpoint pore pressure in each phase.
PorousFlowSumQuantity & _total_outflow_mass
This is used to hold the total fluid flowing into the line sink for each time step.
const bool _use_mass_fraction
Whether the flux will be multiplied by the mass fraction.
const MaterialProperty< std::vector< Real > > *const _internal_energy
Internal_Energy of each phase.
const bool _use_internal_energy
Whether the flux will be multiplied by the internal-energy.
const MaterialProperty< std::vector< std::vector< Real > > > *const _denthalpy_dvar
d(enthalpy of each phase)/d(PorousFlow variable)
const bool _has_mass_fraction
Whether a mass_fraction material exists (for error checking)
const unsigned int _sp
The component number (only used if _use_mass_fraction==true)
const MaterialProperty< std::vector< std::vector< std::vector< Real > > > > *const _dmass_fractions_dvar
d(Mass fraction of each component in each phase)/d(PorousFlow variable)
enum PorousFlowLineSink::PorTchoice _p_or_t
const bool _use_mobility
Whether the flux will be multiplied by the mobility.
const MaterialProperty< Real > *const _temperature
Quadpoint temperature.

Member Function Documentation

◆ addPoints()

void PorousFlowLineSink::addPoints ( )
overrideprotectedvirtual

Add Dirac Points to the borehole.

Reimplemented from PorousFlowLineGeometry.

Definition at line 217 of file PorousFlowLineSink.C.

218 {
219  // This function gets called just before the DiracKernel is evaluated
220  // so this is a handy place to zero this out.
222 
224 }
virtual void addPoints() override
Add Dirac Points to the line sink.
void zero()
Sets _total = 0.
PorousFlowSumQuantity & _total_outflow_mass
This is used to hold the total fluid flowing into the line sink for each time step.

◆ computeQpBaseOutflow()

virtual Real PorousFlowLineSink::computeQpBaseOutflow ( unsigned  current_dirac_ptid) const
protectedpure virtual

Returns the flux from the line sink (before modification by mobility, etc). Derived classes should override this.

Implemented in PorousFlowPeacemanBorehole, and PorousFlowPolyLineSink.

Referenced by computeQpResidual().

◆ computeQpBaseOutflowJacobian()

virtual void PorousFlowLineSink::computeQpBaseOutflowJacobian ( unsigned  jvar,
unsigned  current_dirac_ptid,
Real &  outflow,
Real &  outflowp 
) const
protectedpure virtual

Calculates the BaseOutflow as well as its derivative wrt jvar. Derived classes should override this.

Implemented in PorousFlowPeacemanBorehole, and PorousFlowPolyLineSink.

Referenced by jac().

◆ computeQpJacobian()

Real PorousFlowLineSink::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 258 of file PorousFlowLineSink.C.

259 {
260  return jac(_var.number());
261 }
Real jac(unsigned int jvar)
Jacobian contribution for the derivative wrt the variable jvar.

◆ computeQpOffDiagJacobian()

Real PorousFlowLineSink::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 264 of file PorousFlowLineSink.C.

265 {
266  return jac(jvar);
267 }
Real jac(unsigned int jvar)
Jacobian contribution for the derivative wrt the variable jvar.

◆ computeQpResidual()

Real PorousFlowLineSink::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 227 of file PorousFlowLineSink.C.

228 {
229  // Get the ID we initially assigned to this point
230  const unsigned current_dirac_ptid = currentPointCachedID();
231  Real outflow = computeQpBaseOutflow(current_dirac_ptid);
232  if (outflow == 0.0)
233  return 0.0;
234 
236  outflow *= (*_relative_permeability)[_i][_ph];
237 
238  if (_use_mobility)
239  outflow *= (*_relative_permeability)[_i][_ph] * (*_fluid_density_node)[_i][_ph] /
240  (*_fluid_viscosity)[_i][_ph];
241 
242  if (_use_mass_fraction)
243  outflow *= (*_mass_fractions)[_i][_ph][_sp];
244 
245  if (_use_enthalpy)
246  outflow *= (*_enthalpy)[_i][_ph];
247 
249  outflow *= (*_internal_energy)[_i][_ph];
250 
252  outflow * _dt); // this is not thread safe, but DiracKernel's aren't currently threaded
253 
254  return outflow;
255 }
void add(Real contrib)
Adds contrib to _total.
const bool _use_enthalpy
Whether the flux will be multiplied by the enthalpy.
const unsigned int _ph
The phase number.
const bool _use_relative_permeability
Whether the flux will be multiplied by the relative permeability.
virtual Real computeQpBaseOutflow(unsigned current_dirac_ptid) const =0
Returns the flux from the line sink (before modification by mobility, etc). Derived classes should ov...
PorousFlowSumQuantity & _total_outflow_mass
This is used to hold the total fluid flowing into the line sink for each time step.
const bool _use_mass_fraction
Whether the flux will be multiplied by the mass fraction.
const bool _use_internal_energy
Whether the flux will be multiplied by the internal-energy.
const unsigned int _sp
The component number (only used if _use_mass_fraction==true)
const bool _use_mobility
Whether the flux will be multiplied by the mobility.

◆ dptqp()

Real PorousFlowLineSink::dptqp ( unsigned  pvar) const
protected

If _p_or_t==0, then returns d(quadpoint porepressure)/d(PorousFlow variable), else returns d(quadpoint temperature)/d(PorousFlow variable)

Parameters
pvarThe PorousFlow variable number

Definition at line 341 of file PorousFlowLineSink.C.

Referenced by PorousFlowPolyLineSink::computeQpBaseOutflowJacobian(), and PorousFlowPeacemanBorehole::computeQpBaseOutflowJacobian().

342 {
343  return (_p_or_t == PorTchoice::pressure ? (*_dpp_dvar)[_qp][_ph][pvar]
344  : (*_dtemperature_dvar)[_qp][pvar]);
345 }
const unsigned int _ph
The phase number.
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
d(quadpoint temperature)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > *const _dpp_dvar
d(quadpoint pore pressure in each phase)/d(PorousFlow variable)
enum PorousFlowLineSink::PorTchoice _p_or_t

◆ jac()

Real PorousFlowLineSink::jac ( unsigned int  jvar)
protected

Jacobian contribution for the derivative wrt the variable jvar.

Definition at line 270 of file PorousFlowLineSink.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

271 {
273  return 0.0;
274  const unsigned pvar = _dictator.porousFlowVariableNum(jvar);
275 
276  Real outflow;
277  Real outflowp;
278  const unsigned current_dirac_ptid = currentPointCachedID();
279  computeQpBaseOutflowJacobian(jvar, current_dirac_ptid, outflow, outflowp);
280  if (outflow == 0.0 && outflowp == 0.0)
281  return 0.0;
282 
284  {
285  const Real relperm_prime = (_i != _j ? 0.0 : (*_drelative_permeability_dvar)[_i][_ph][pvar]);
286  outflowp = (*_relative_permeability)[_i][_ph] * outflowp + relperm_prime * outflow;
287  outflow *= (*_relative_permeability)[_i][_ph];
288  }
289 
290  if (_use_mobility)
291  {
292  const Real mob = (*_relative_permeability)[_i][_ph] * (*_fluid_density_node)[_i][_ph] /
293  (*_fluid_viscosity)[_i][_ph];
294  const Real mob_prime =
295  (_i != _j
296  ? 0.0
297  : (*_drelative_permeability_dvar)[_i][_ph][pvar] * (*_fluid_density_node)[_i][_ph] /
298  (*_fluid_viscosity)[_i][_ph] +
299  (*_relative_permeability)[_i][_ph] *
300  (*_dfluid_density_node_dvar)[_i][_ph][pvar] / (*_fluid_viscosity)[_i][_ph] -
301  (*_relative_permeability)[_i][_ph] * (*_fluid_density_node)[_i][_ph] *
302  (*_dfluid_viscosity_dvar)[_i][_ph][pvar] /
303  Utility::pow<2>((*_fluid_viscosity)[_i][_ph]));
304  outflowp = mob * outflowp + mob_prime * outflow;
305  outflow *= mob;
306  }
307 
308  if (_use_mass_fraction)
309  {
310  const Real mass_fractions_prime =
311  (_i != _j ? 0.0 : (*_dmass_fractions_dvar)[_i][_ph][_sp][pvar]);
312  outflowp = (*_mass_fractions)[_i][_ph][_sp] * outflowp + mass_fractions_prime * outflow;
313  outflow *= (*_mass_fractions)[_i][_ph][_sp];
314  }
315 
316  if (_use_enthalpy)
317  {
318  const Real enthalpy_prime = (_i != _j ? 0.0 : (*_denthalpy_dvar)[_i][_ph][pvar]);
319  outflowp = (*_enthalpy)[_i][_ph] * outflowp + enthalpy_prime * outflow;
320  outflow *= (*_enthalpy)[_i][_ph];
321  }
322 
324  {
325  const Real internal_energy_prime = (_i != _j ? 0.0 : (*_dinternal_energy_dvar)[_i][_ph][pvar]);
326  outflowp = (*_internal_energy)[_i][_ph] * outflowp + internal_energy_prime * outflow;
327  // this multiplication was performed, but the code does not need to know: outflow *=
328  // (*_internal_energy)[_i][_ph];
329  }
330 
331  return outflowp;
332 }
const bool _use_enthalpy
Whether the flux will be multiplied by the enthalpy.
const unsigned int _ph
The phase number.
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const bool _use_relative_permeability
Whether the flux will be multiplied by the relative permeability.
const bool _use_mass_fraction
Whether the flux will be multiplied by the mass fraction.
const bool _use_internal_energy
Whether the flux will be multiplied by the internal-energy.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
const unsigned int _sp
The component number (only used if _use_mass_fraction==true)
virtual void computeQpBaseOutflowJacobian(unsigned jvar, unsigned current_dirac_ptid, Real &outflow, Real &outflowp) const =0
Calculates the BaseOutflow as well as its derivative wrt jvar. Derived classes should override this...
const bool _use_mobility
Whether the flux will be multiplied by the mobility.

◆ parseNextLineReals()

bool PorousFlowLineGeometry::parseNextLineReals ( std::ifstream &  ifs,
std::vector< Real > &  myvec 
)
protectedinherited

Reads a space-separated line of floats from ifs and puts in myvec.

Definition at line 103 of file PorousFlowLineGeometry.C.

Referenced by PorousFlowLineGeometry::PorousFlowLineGeometry().

105 {
106  std::string line;
107  myvec.clear();
108  bool gotline(false);
109  if (getline(ifs, line))
110  {
111  gotline = true;
112 
113  // Harvest floats separated by whitespace
114  std::istringstream iss(line);
115  Real f;
116  while (iss >> f)
117  {
118  myvec.push_back(f);
119  }
120  }
121  return gotline;
122 }

◆ ptqp()

Real PorousFlowLineSink::ptqp ( ) const
protected

If _p_or_t==0, then returns the quadpoint porepressure, else returns the quadpoint temperature.

Definition at line 335 of file PorousFlowLineSink.C.

Referenced by PorousFlowPolyLineSink::computeQpBaseOutflow(), PorousFlowPeacemanBorehole::computeQpBaseOutflow(), PorousFlowPolyLineSink::computeQpBaseOutflowJacobian(), and PorousFlowPeacemanBorehole::computeQpBaseOutflowJacobian().

336 {
337  return (_p_or_t == PorTchoice::pressure ? (*_pp)[_qp][_ph] : (*_temperature)[_qp]);
338 }
const unsigned int _ph
The phase number.
const MaterialProperty< std::vector< Real > > *const _pp
Quadpoint pore pressure in each phase.
enum PorousFlowLineSink::PorTchoice _p_or_t
const MaterialProperty< Real > *const _temperature
Quadpoint temperature.

Member Data Documentation

◆ _bottom_point

Point PorousFlowLineGeometry::_bottom_point
protectedinherited

The bottom point of the borehole (where bottom_pressure is defined)

Definition at line 62 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowPeacemanBorehole::computeQpBaseOutflow(), PorousFlowPeacemanBorehole::computeQpBaseOutflowJacobian(), and PorousFlowLineGeometry::PorousFlowLineGeometry().

◆ _denthalpy_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_denthalpy_dvar
protected

d(enthalpy of each phase)/d(PorousFlow variable)

Definition at line 155 of file PorousFlowLineSink.h.

◆ _dfluid_density_node_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_dfluid_density_node_dvar
protected

d(Fluid density for each phase (at the node))/d(PorousFlow variable)

Definition at line 131 of file PorousFlowLineSink.h.

◆ _dfluid_viscosity_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_dfluid_viscosity_dvar
protected

d(Viscosity of each component in each phase)/d(PorousFlow variable)

Definition at line 137 of file PorousFlowLineSink.h.

◆ _dictator

const PorousFlowDictator& PorousFlowLineSink::_dictator
protected

◆ _dinternal_energy_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_dinternal_energy_dvar
protected

d(internal_energy of each phase)/d(PorousFlow variable)

Definition at line 161 of file PorousFlowLineSink.h.

◆ _dmass_fractions_dvar

const MaterialProperty<std::vector<std::vector<std::vector<Real> > > >* const PorousFlowLineSink::_dmass_fractions_dvar
protected

d(Mass fraction of each component in each phase)/d(PorousFlow variable)

Definition at line 149 of file PorousFlowLineSink.h.

◆ _dpp_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_dpp_dvar
protected

d(quadpoint pore pressure in each phase)/d(PorousFlow variable)

Definition at line 119 of file PorousFlowLineSink.h.

Referenced by dptqp().

◆ _drelative_permeability_dvar

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_drelative_permeability_dvar
protected

d(Relative permeability of each phase)/d(PorousFlow variable)

Definition at line 143 of file PorousFlowLineSink.h.

◆ _dtemperature_dvar

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_dtemperature_dvar
protected

d(quadpoint temperature)/d(PorousFlow variable)

Definition at line 125 of file PorousFlowLineSink.h.

Referenced by dptqp().

◆ _enthalpy

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_enthalpy
protected

Enthalpy of each phase.

Definition at line 152 of file PorousFlowLineSink.h.

◆ _fluid_density_node

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_fluid_density_node
protected

Fluid density for each phase (at the node)

Definition at line 128 of file PorousFlowLineSink.h.

◆ _fluid_viscosity

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_fluid_viscosity
protected

Viscosity of each component in each phase.

Definition at line 134 of file PorousFlowLineSink.h.

◆ _half_seg_len

std::vector<Real> PorousFlowLineGeometry::_half_seg_len
protectedinherited

◆ _has_enthalpy

const bool PorousFlowLineSink::_has_enthalpy
protected

Whether an enthalpy material exists (for error checking)

Definition at line 86 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _has_internal_energy

const bool PorousFlowLineSink::_has_internal_energy
protected

Whether an internal-energy material exists (for error checking)

Definition at line 89 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _has_mass_fraction

const bool PorousFlowLineSink::_has_mass_fraction
protected

Whether a mass_fraction material exists (for error checking)

Definition at line 77 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _has_mobility

const bool PorousFlowLineSink::_has_mobility
protected

Whether enough materials exist to form the mobility (for error checking)

Definition at line 83 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _has_porepressure

const bool PorousFlowLineSink::_has_porepressure
protected

Whether a quadpoint porepressure material exists (for error checking)

Definition at line 71 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _has_relative_permeability

const bool PorousFlowLineSink::_has_relative_permeability
protected

Whether a relative permeability material exists (for error checking)

Definition at line 80 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _has_temperature

const bool PorousFlowLineSink::_has_temperature
protected

Whether a quadpoint temperature material exists (for error checking)

Definition at line 74 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

◆ _internal_energy

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_internal_energy
protected

Internal_Energy of each phase.

Definition at line 158 of file PorousFlowLineSink.h.

◆ _line_direction

const RealVectorValue PorousFlowLineGeometry::_line_direction
protectedinherited

Line direction. This is only used if there is only one borehole point.

Definition at line 40 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowPeacemanBorehole::PorousFlowPeacemanBorehole().

◆ _line_length

const Real PorousFlowLineGeometry::_line_length
protectedinherited

Line length. This is only used if there is only one borehole point.

Definition at line 37 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowLineGeometry::PorousFlowLineGeometry().

◆ _mass_fractions

const MaterialProperty<std::vector<std::vector<Real> > >* const PorousFlowLineSink::_mass_fractions
protected

Mass fraction of each component in each phase.

Definition at line 146 of file PorousFlowLineSink.h.

◆ _p_or_t

enum PorousFlowLineSink::PorTchoice PorousFlowLineSink::_p_or_t
protected

◆ _ph

const unsigned int PorousFlowLineSink::_ph
protected

The phase number.

Definition at line 110 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), dptqp(), jac(), PorousFlowLineSink(), and ptqp().

◆ _point_file

const std::string PorousFlowLineGeometry::_point_file
protectedinherited

File defining the geometry of the borehole.

Each row has format weight x y z and the list of such points defines a polyline that is the line sink

Definition at line 47 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowLineGeometry::PorousFlowLineGeometry().

◆ _pp

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_pp
protected

Quadpoint pore pressure in each phase.

Definition at line 116 of file PorousFlowLineSink.h.

Referenced by ptqp().

◆ _relative_permeability

const MaterialProperty<std::vector<Real> >* const PorousFlowLineSink::_relative_permeability
protected

Relative permeability of each phase.

Definition at line 140 of file PorousFlowLineSink.h.

◆ _rs

std::vector<Real> PorousFlowLineGeometry::_rs
protectedinherited

◆ _sp

const unsigned int PorousFlowLineSink::_sp
protected

The component number (only used if _use_mass_fraction==true)

Definition at line 113 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), jac(), and PorousFlowLineSink().

◆ _temperature

const MaterialProperty<Real>* const PorousFlowLineSink::_temperature
protected

Quadpoint temperature.

Definition at line 122 of file PorousFlowLineSink.h.

Referenced by ptqp().

◆ _total_outflow_mass

PorousFlowSumQuantity& PorousFlowLineSink::_total_outflow_mass
protected

This is used to hold the total fluid flowing into the line sink for each time step.

Hence, it is positive for production wells where fluid is flowing from porespace into the line sink (and hence removed from the model)

Definition at line 68 of file PorousFlowLineSink.h.

Referenced by addPoints(), computeQpResidual(), and PorousFlowLineSink().

◆ _use_enthalpy

const bool PorousFlowLineSink::_use_enthalpy
protected

Whether the flux will be multiplied by the enthalpy.

Definition at line 104 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), jac(), and PorousFlowLineSink().

◆ _use_internal_energy

const bool PorousFlowLineSink::_use_internal_energy
protected

Whether the flux will be multiplied by the internal-energy.

Definition at line 107 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), jac(), and PorousFlowLineSink().

◆ _use_mass_fraction

const bool PorousFlowLineSink::_use_mass_fraction
protected

Whether the flux will be multiplied by the mass fraction.

Definition at line 95 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), jac(), and PorousFlowLineSink().

◆ _use_mobility

const bool PorousFlowLineSink::_use_mobility
protected

Whether the flux will be multiplied by the mobility.

Definition at line 101 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), jac(), and PorousFlowLineSink().

◆ _use_relative_permeability

const bool PorousFlowLineSink::_use_relative_permeability
protected

Whether the flux will be multiplied by the relative permeability.

Definition at line 98 of file PorousFlowLineSink.h.

Referenced by computeQpResidual(), jac(), and PorousFlowLineSink().

◆ _xs

std::vector<Real> PorousFlowLineGeometry::_xs
protectedinherited

◆ _ys

std::vector<Real> PorousFlowLineGeometry::_ys
protectedinherited

◆ _zs

std::vector<Real> PorousFlowLineGeometry::_zs
protectedinherited

The documentation for this class was generated from the following files: