www.mooseframework.org
PorousFlowLineSink.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef POROUSFLOWLINESINK_H
9 #define POROUSFLOWLINESINK_H
10 
11 // Moose Includes
12 #include "PorousFlowLineGeometry.h"
13 #include "PorousFlowSumQuantity.h"
14 #include "PorousFlowDictator.h"
15 
16 class PorousFlowLineSink;
17 
18 template <>
19 InputParameters validParams<PorousFlowLineSink>();
20 
25 {
26 public:
27  PorousFlowLineSink(const InputParameters & parameters);
28 
29 protected:
30  virtual Real computeQpResidual() override;
31  virtual Real computeQpJacobian() override;
32  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
33 
35  virtual void addPoints() override;
36 
38  Real jac(unsigned int jvar);
39 
41  Real ptqp() const;
42 
48  Real dptqp(unsigned pvar) const;
49 
51  virtual Real computeQpBaseOutflow(unsigned current_dirac_ptid) const = 0;
52 
54  virtual void computeQpBaseOutflowJacobian(unsigned jvar,
55  unsigned current_dirac_ptid,
56  Real & outflow,
57  Real & outflowp) const = 0;
58 
61 
68 
70  const bool _has_porepressure;
71 
73  const bool _has_temperature;
74 
76  const bool _has_mass_fraction;
77 
80 
82  const bool _has_mobility;
83 
85  const bool _has_enthalpy;
86 
89 
91  const enum class PorTchoice { pressure, temperature } _p_or_t;
92 
94  const bool _use_mass_fraction;
95 
98 
100  const bool _use_mobility;
101 
103  const bool _use_enthalpy;
104 
107 
109  const unsigned int _ph;
110 
112  const unsigned int _sp;
113 
115  const MaterialProperty<std::vector<Real>> * const _pp;
116 
118  const MaterialProperty<std::vector<std::vector<Real>>> * const _dpp_dvar;
119 
121  const MaterialProperty<Real> * const _temperature;
122 
124  const MaterialProperty<std::vector<Real>> * const _dtemperature_dvar;
125 
127  const MaterialProperty<std::vector<Real>> * const _fluid_density_node;
128 
130  const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_density_node_dvar;
131 
133  const MaterialProperty<std::vector<Real>> * const _fluid_viscosity;
134 
136  const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_viscosity_dvar;
137 
139  const MaterialProperty<std::vector<Real>> * const _relative_permeability;
140 
142  const MaterialProperty<std::vector<std::vector<Real>>> * const _drelative_permeability_dvar;
143 
145  const MaterialProperty<std::vector<std::vector<Real>>> * const _mass_fractions;
146 
148  const MaterialProperty<std::vector<std::vector<std::vector<Real>>>> * const _dmass_fractions_dvar;
149 
151  const MaterialProperty<std::vector<Real>> * const _enthalpy;
152 
154  const MaterialProperty<std::vector<std::vector<Real>>> * const _denthalpy_dvar;
155 
157  const MaterialProperty<std::vector<Real>> * const _internal_energy;
158 
160  const MaterialProperty<std::vector<std::vector<Real>>> * const _dinternal_energy_dvar;
161 };
162 
163 #endif // POROUSFLOWLINESINK_H
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.
Approximates a borehole by a sequence of Dirac Points.
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.
virtual Real computeQpResidual() override
const bool _has_porepressure
Whether a quadpoint porepressure material exists (for error checking)
virtual Real computeQpJacobian() override
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)
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 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)
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...
Real ptqp() const
If _p_or_t==0, then returns the quadpoint porepressure, else returns the quadpoint temperature...
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)
Sums into _total This is used, for instance, to record the total mass flowing into a borehole...
const MaterialProperty< std::vector< Real > > *const _pp
Quadpoint pore pressure in each phase.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
PorTchoice
whether the flux is a function of pressure or temperature
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.
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
virtual void addPoints() override
Add Dirac Points to the borehole.
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)
PorousFlowLineSink(const InputParameters &parameters)
const bool _has_mass_fraction
Whether a mass_fraction material exists (for error checking)
InputParameters validParams< PorousFlowLineSink >()
Approximates a line sink a sequence of Dirac Points.
Real dptqp(unsigned pvar) const
If _p_or_t==0, then returns d(quadpoint porepressure)/d(PorousFlow variable), else returns d(quadpoin...
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
Real jac(unsigned int jvar)
Jacobian contribution for the derivative wrt the variable jvar.
const bool _use_mobility
Whether the flux will be multiplied by the mobility.
const MaterialProperty< Real > *const _temperature
Quadpoint temperature.