www.mooseframework.org
PorousFlowLineSink.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "PorousFlowLineGeometry.h"
13 #include "PorousFlowSumQuantity.h"
14 #include "PorousFlowDictator.h"
15 
20 {
21 public:
23 
25 
26 protected:
27  virtual Real computeQpResidual() override;
28  virtual Real computeQpJacobian() override;
29  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
30 
32  virtual void addPoints() override;
33 
35  Real jac(unsigned int jvar);
36 
38  Real ptqp() const;
39 
45  Real dptqp(unsigned pvar) const;
46 
48  virtual Real computeQpBaseOutflow(unsigned current_dirac_ptid) const = 0;
49 
51  virtual void computeQpBaseOutflowJacobian(unsigned jvar,
52  unsigned current_dirac_ptid,
53  Real & outflow,
54  Real & outflowp) const = 0;
55 
58 
65 
67  const bool _has_porepressure;
68 
70  const bool _has_temperature;
71 
73  const bool _has_mass_fraction;
74 
77 
79  const bool _has_mobility;
80 
82  const bool _has_enthalpy;
83 
86 
88  const enum class PorTchoice { pressure, temperature } _p_or_t;
89 
91  const bool _use_mass_fraction;
92 
95 
97  const bool _use_mobility;
98 
100  const bool _use_enthalpy;
101 
104 
106  const unsigned int _ph;
107 
109  const unsigned int _sp;
110 
113 
116 
119 
122 
125 
128 
131 
134 
137 
140 
143 
146 
149 
152 
155 
158 
161 };
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)
static InputParameters validParams()
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)
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.
OutputTools< Real >::VariableValue VariableValue
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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)
const InputParameters & parameters() const
const VariableValue & _multiplying_var
mass flux is multiplied by this variable evaluated at quadpoints
Approximates a line sink a sequence of Dirac Points.
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.
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.
const MaterialProperty< Real > *const _temperature
Quadpoint temperature.
Real dptqp(unsigned pvar) const
If _p_or_t==0, then returns d(quadpoint porepressure)/d(PorousFlow variable), else returns d(quadpoin...