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
 PorousFlow 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 24 of file PorousFlowLineSink.h.

Member Enumeration Documentation

enum PorousFlowLineSink::PorTchoice
strongprotected

whether the flux is a function of pressure or temperature

Enumerator
pressure 
temperature 

Definition at line 91 of file PorousFlowLineSink.h.

const std::string temperature
Definition: NS.h:25
const std::string pressure
Definition: NS.h:24
enum PorousFlowLineSink::PorTchoice _p_or_t

Constructor & Destructor Documentation

PorousFlowLineSink::PorousFlowLineSink ( const InputParameters &  parameters)

Definition at line 51 of file PorousFlowLineSink.C.

52  : PorousFlowLineGeometry(parameters),
53  _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
55  const_cast<PorousFlowSumQuantity &>(getUserObject<PorousFlowSumQuantity>("SumQuantityUO"))),
56 
58  hasMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp") &&
59  hasMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_porepressure_qp_dvar")),
60  _has_temperature(hasMaterialProperty<Real>("PorousFlow_temperature_qp") &&
61  hasMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")),
63  hasMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal") &&
64  hasMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
65  "dPorousFlow_mass_frac_nodal_dvar")),
67  hasMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal") &&
68  hasMaterialProperty<std::vector<std::vector<Real>>>(
69  "dPorousFlow_relative_permeability_nodal_dvar")),
71  hasMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal") &&
72  hasMaterialProperty<std::vector<std::vector<Real>>>(
73  "dPorousFlow_relative_permeability_nodal_dvar") &&
74  hasMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_nodal") &&
75  hasMaterialProperty<std::vector<std::vector<Real>>>(
76  "dPorousFlow_fluid_phase_density_nodal_dvar") &&
77  hasMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_nodal") &&
78  hasMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_viscosity_nodal_dvar")),
79  _has_enthalpy(hasMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal") &&
80  hasMaterialProperty<std::vector<std::vector<Real>>>(
81  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")),
83  hasMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_internal_energy_nodal") &&
84  hasMaterialProperty<std::vector<std::vector<Real>>>(
85  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")),
86 
87  _p_or_t(getParam<MooseEnum>("function_of").getEnum<PorTchoice>()),
88  _use_mass_fraction(isParamValid("mass_fraction_component")),
89  _use_relative_permeability(getParam<bool>("use_relative_permeability")),
90  _use_mobility(getParam<bool>("use_mobility")),
91  _use_enthalpy(getParam<bool>("use_enthalpy")),
92  _use_internal_energy(getParam<bool>("use_internal_energy")),
93 
94  _ph(getParam<unsigned int>("fluid_phase")),
95  _sp(_use_mass_fraction ? getParam<unsigned int>("mass_fraction_component") : 0),
96 
98  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")
99  : nullptr),
101  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
102  "dPorousFlow_porepressure_qp_dvar")
103  : nullptr),
105  ? &getMaterialProperty<Real>("PorousFlow_temperature_qp")
106  : nullptr),
109  ? &getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")
110  : nullptr),
113  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_nodal")
114  : nullptr),
116  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
117  "dPorousFlow_fluid_phase_density_nodal_dvar")
118  : nullptr),
120  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_viscosity_nodal")
121  : nullptr),
123  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
124  "dPorousFlow_viscosity_nodal_dvar")
125  : nullptr),
129  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")
130  : nullptr),
133  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
134  "dPorousFlow_relative_permeability_nodal_dvar")
135  : nullptr),
138  ? &getMaterialProperty<std::vector<std::vector<Real>>>("PorousFlow_mass_frac_nodal")
139  : nullptr),
141  ? &getMaterialProperty<std::vector<std::vector<std::vector<Real>>>>(
142  "dPorousFlow_mass_frac_nodal_dvar")
143  : nullptr),
144  _enthalpy(
146  ? &getMaterialPropertyByName<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal")
147  : nullptr),
149  ? &getMaterialPropertyByName<std::vector<std::vector<Real>>>(
150  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")
151  : nullptr),
153  ? &getMaterialPropertyByName<std::vector<Real>>(
154  "PorousFlow_fluid_phase_internal_energy_nodal")
155  : nullptr),
157  ? &getMaterialPropertyByName<std::vector<std::vector<Real>>>(
158  "dPorousFlow_fluid_phase_internal_energy_nodal_dvar")
159  : nullptr)
160 {
161  // zero the outflow mass
163 
164  if (_ph >= _dictator.numPhases())
165  mooseError("PorousFlowLineSink: The Dictator declares that the number of fluid phases is ",
167  ", but you have set the fluid_phase to ",
168  _ph,
169  ". You must try harder.");
171  mooseError("PorousFlowLineSink: The Dictator declares that the number of fluid components is ",
173  ", but you have set the mass_fraction_component to ",
174  _sp,
175  ". Please be assured that the Dictator has noted your error.");
177  mooseError("PorousFlowLineSink: You have specified function_of=porepressure, but you do not "
178  "have a quadpoint porepressure material");
180  mooseError("PorousFlowLineSink: You have specified function_of=temperature, but you do not "
181  "have a quadpoint temperature material");
183  mooseError("PorousFlowLineSink: You have specified a fluid component, but do not have a nodal "
184  "mass-fraction material");
186  mooseError("PorousFlowLineSink: You have set use_relative_permeability=true, but do not have a "
187  "nodal relative permeability material");
189  mooseError("PorousFlowLineSink: You have set use_mobility=true, but do not have nodal density, "
190  "relative permeability or viscosity material");
192  mooseError("PorousFlowLineSink: You have set use_enthalpy=true, but do not have a nodal "
193  "enthalpy material");
195  mooseError("PorousFlowLineSink: You have set use_internal_energy=true, but do not have a nodal "
196  "internal-energy material");
197 
198  // To correctly compute the Jacobian terms,
199  // tell MOOSE that this DiracKernel depends on all the PorousFlow Variables
200  const std::vector<MooseVariable *> & coupled_vars = _dictator.getCoupledMooseVars();
201  for (unsigned int i = 0; i < coupled_vars.size(); i++)
202  addMooseVariableDependency(coupled_vars[i]);
203 }
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
PorousFlow 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.
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.
unsigned int numComponents() const
the number of fluid components
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.
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.
unsigned int numPhases() const
the number of fluid phases
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

void PorousFlowLineSink::addPoints ( )
overrideprotectedvirtual

Add Dirac Points to the borehole.

Reimplemented from PorousFlowLineGeometry.

Definition at line 206 of file PorousFlowLineSink.C.

207 {
208  // This function gets called just before the DiracKernel is evaluated
209  // so this is a handy place to zero this out.
211 
213 }
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.
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().

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().

Real PorousFlowLineSink::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 247 of file PorousFlowLineSink.C.

248 {
249  return jac(_var.number());
250 }
Real jac(unsigned int jvar)
Jacobian contribution for the derivative wrt the variable jvar.
Real PorousFlowLineSink::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 253 of file PorousFlowLineSink.C.

254 {
255  return jac(jvar);
256 }
Real jac(unsigned int jvar)
Jacobian contribution for the derivative wrt the variable jvar.
Real PorousFlowLineSink::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 216 of file PorousFlowLineSink.C.

217 {
218  // Get the ID we initially assigned to this point
219  const unsigned current_dirac_ptid = currentPointCachedID();
220  Real outflow = computeQpBaseOutflow(current_dirac_ptid);
221  if (outflow == 0.0)
222  return 0.0;
223 
225  outflow *= (*_relative_permeability)[_i][_ph];
226 
227  if (_use_mobility)
228  outflow *= (*_relative_permeability)[_i][_ph] * (*_fluid_density_node)[_i][_ph] /
229  (*_fluid_viscosity)[_i][_ph];
230 
231  if (_use_mass_fraction)
232  outflow *= (*_mass_fractions)[_i][_ph][_sp];
233 
234  if (_use_enthalpy)
235  outflow *= (*_enthalpy)[_i][_ph];
236 
238  outflow *= (*_internal_energy)[_i][_ph];
239 
241  outflow * _dt); // this is not thread safe, but DiracKernel's aren't currently threaded
242 
243  return outflow;
244 }
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.
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 330 of file PorousFlowLineSink.C.

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

331 {
332  return (_p_or_t == PorTchoice::pressure ? (*_dpp_dvar)[_qp][_ph][pvar]
333  : (*_dtemperature_dvar)[_qp][pvar]);
334 }
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
Real PorousFlowLineSink::jac ( unsigned int  jvar)
protected

Jacobian contribution for the derivative wrt the variable jvar.

Definition at line 259 of file PorousFlowLineSink.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

260 {
262  return 0.0;
263  const unsigned pvar = _dictator.porousFlowVariableNum(jvar);
264 
265  Real outflow;
266  Real outflowp;
267  const unsigned current_dirac_ptid = currentPointCachedID();
268  computeQpBaseOutflowJacobian(jvar, current_dirac_ptid, outflow, outflowp);
269  if (outflow == 0.0 && outflowp == 0.0)
270  return 0.0;
271 
273  {
274  const Real relperm_prime = (_i != _j ? 0.0 : (*_drelative_permeability_dvar)[_i][_ph][pvar]);
275  outflowp = (*_relative_permeability)[_i][_ph] * outflowp + relperm_prime * outflow;
276  outflow *= (*_relative_permeability)[_i][_ph];
277  }
278 
279  if (_use_mobility)
280  {
281  const Real mob = (*_relative_permeability)[_i][_ph] * (*_fluid_density_node)[_i][_ph] /
282  (*_fluid_viscosity)[_i][_ph];
283  const Real mob_prime =
284  (_i != _j
285  ? 0.0
286  : (*_drelative_permeability_dvar)[_i][_ph][pvar] * (*_fluid_density_node)[_i][_ph] /
287  (*_fluid_viscosity)[_i][_ph] +
288  (*_relative_permeability)[_i][_ph] *
289  (*_dfluid_density_node_dvar)[_i][_ph][pvar] / (*_fluid_viscosity)[_i][_ph] -
290  (*_relative_permeability)[_i][_ph] * (*_fluid_density_node)[_i][_ph] *
291  (*_dfluid_viscosity_dvar)[_i][_ph][pvar] /
292  Utility::pow<2>((*_fluid_viscosity)[_i][_ph]));
293  outflowp = mob * outflowp + mob_prime * outflow;
294  outflow *= mob;
295  }
296 
297  if (_use_mass_fraction)
298  {
299  const Real mass_fractions_prime =
300  (_i != _j ? 0.0 : (*_dmass_fractions_dvar)[_i][_ph][_sp][pvar]);
301  outflowp = (*_mass_fractions)[_i][_ph][_sp] * outflowp + mass_fractions_prime * outflow;
302  outflow *= (*_mass_fractions)[_i][_ph][_sp];
303  }
304 
305  if (_use_enthalpy)
306  {
307  const Real enthalpy_prime = (_i != _j ? 0.0 : (*_denthalpy_dvar)[_i][_ph][pvar]);
308  outflowp = (*_enthalpy)[_i][_ph] * outflowp + enthalpy_prime * outflow;
309  outflow *= (*_enthalpy)[_i][_ph];
310  }
311 
313  {
314  const Real internal_energy_prime = (_i != _j ? 0.0 : (*_dinternal_energy_dvar)[_i][_ph][pvar]);
315  outflowp = (*_internal_energy)[_i][_ph] * outflowp + internal_energy_prime * outflow;
316  // this multiplication was performed, but the code does not need to know: outflow *=
317  // (*_internal_energy)[_i][_ph];
318  }
319 
320  return outflowp;
321 }
const bool _use_enthalpy
Whether the flux will be multiplied by the enthalpy.
const unsigned int _ph
The phase number.
const PorousFlowDictator & _dictator
PorousFlow UserObject.
const bool _use_relative_permeability
Whether the flux will be multiplied by the relative permeability.
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_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)
bool notPorousFlowVariable(unsigned int moose_var_num) const
returns true if moose_var_num is not a porous flow variabe
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
the PorousFlow variable number
const bool _use_mobility
Whether the flux will be multiplied by the mobility.
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 101 of file PorousFlowLineGeometry.C.

Referenced by PorousFlowLineGeometry::PorousFlowLineGeometry().

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

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

Definition at line 324 of file PorousFlowLineSink.C.

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

325 {
326  return (_p_or_t == PorTchoice::pressure ? (*_pp)[_qp][_ph] : (*_temperature)[_qp]);
327 }
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

Point PorousFlowLineGeometry::_bottom_point
protectedinherited

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

Definition at line 60 of file PorousFlowLineGeometry.h.

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

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

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

Definition at line 154 of file PorousFlowLineSink.h.

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 130 of file PorousFlowLineSink.h.

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 136 of file PorousFlowLineSink.h.

const PorousFlowDictator& PorousFlowLineSink::_dictator
protected
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 160 of file PorousFlowLineSink.h.

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 148 of file PorousFlowLineSink.h.

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 118 of file PorousFlowLineSink.h.

Referenced by dptqp().

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 142 of file PorousFlowLineSink.h.

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

d(quadpoint temperature)/d(PorousFlow variable)

Definition at line 124 of file PorousFlowLineSink.h.

Referenced by dptqp().

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

Enthalpy of each phase.

Definition at line 151 of file PorousFlowLineSink.h.

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

Fluid density for each phase (at the node)

Definition at line 127 of file PorousFlowLineSink.h.

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

Viscosity of each component in each phase.

Definition at line 133 of file PorousFlowLineSink.h.

std::vector<Real> PorousFlowLineGeometry::_half_seg_len
protectedinherited
const bool PorousFlowLineSink::_has_enthalpy
protected

Whether an enthalpy material exists (for error checking)

Definition at line 85 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

const bool PorousFlowLineSink::_has_internal_energy
protected

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

Definition at line 88 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

const bool PorousFlowLineSink::_has_mass_fraction
protected

Whether a mass_fraction material exists (for error checking)

Definition at line 76 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

const bool PorousFlowLineSink::_has_mobility
protected

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

Definition at line 82 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

const bool PorousFlowLineSink::_has_porepressure
protected

Whether a quadpoint porepressure material exists (for error checking)

Definition at line 70 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

const bool PorousFlowLineSink::_has_relative_permeability
protected

Whether a relative permeability material exists (for error checking)

Definition at line 79 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

const bool PorousFlowLineSink::_has_temperature
protected

Whether a quadpoint temperature material exists (for error checking)

Definition at line 73 of file PorousFlowLineSink.h.

Referenced by PorousFlowLineSink().

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

Internal_Energy of each phase.

Definition at line 157 of file PorousFlowLineSink.h.

const RealVectorValue PorousFlowLineGeometry::_line_direction
protectedinherited

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

Definition at line 38 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowPeacemanBorehole::PorousFlowPeacemanBorehole().

const Real PorousFlowLineGeometry::_line_length
protectedinherited

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

Definition at line 35 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowLineGeometry::PorousFlowLineGeometry().

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

Mass fraction of each component in each phase.

Definition at line 145 of file PorousFlowLineSink.h.

enum PorousFlowLineSink::PorTchoice PorousFlowLineSink::_p_or_t
protected
const unsigned int PorousFlowLineSink::_ph
protected

The phase number.

Definition at line 109 of file PorousFlowLineSink.h.

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

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 45 of file PorousFlowLineGeometry.h.

Referenced by PorousFlowLineGeometry::PorousFlowLineGeometry().

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

Quadpoint pore pressure in each phase.

Definition at line 115 of file PorousFlowLineSink.h.

Referenced by ptqp().

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

Relative permeability of each phase.

Definition at line 139 of file PorousFlowLineSink.h.

std::vector<Real> PorousFlowLineGeometry::_rs
protectedinherited
const unsigned int PorousFlowLineSink::_sp
protected

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

Definition at line 112 of file PorousFlowLineSink.h.

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

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

Quadpoint temperature.

Definition at line 121 of file PorousFlowLineSink.h.

Referenced by ptqp().

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 67 of file PorousFlowLineSink.h.

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

const bool PorousFlowLineSink::_use_enthalpy
protected

Whether the flux will be multiplied by the enthalpy.

Definition at line 103 of file PorousFlowLineSink.h.

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

const bool PorousFlowLineSink::_use_internal_energy
protected

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

Definition at line 106 of file PorousFlowLineSink.h.

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

const bool PorousFlowLineSink::_use_mass_fraction
protected

Whether the flux will be multiplied by the mass fraction.

Definition at line 94 of file PorousFlowLineSink.h.

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

const bool PorousFlowLineSink::_use_mobility
protected

Whether the flux will be multiplied by the mobility.

Definition at line 100 of file PorousFlowLineSink.h.

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

const bool PorousFlowLineSink::_use_relative_permeability
protected

Whether the flux will be multiplied by the relative permeability.

Definition at line 97 of file PorousFlowLineSink.h.

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

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

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