LCOV - code coverage report
Current view: top level - include/dirackernels - PorousFlowLineSink.h (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 1 1 100.0 %
Date: 2017-11-21 14:47:27 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      21             : /**
      22             :  * Approximates a line sink a sequence of Dirac Points
      23             :  */
      24          16 : class PorousFlowLineSink : public PorousFlowLineGeometry
      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             : 
      34             :   /// Add Dirac Points to the borehole
      35             :   virtual void addPoints() override;
      36             : 
      37             :   /// Jacobian contribution for the derivative wrt the variable jvar
      38             :   Real jac(unsigned int jvar);
      39             : 
      40             :   /// If _p_or_t==0, then returns the quadpoint porepressure, else returns the quadpoint temperature
      41             :   Real ptqp() const;
      42             : 
      43             :   /**
      44             :    * If _p_or_t==0, then returns d(quadpoint porepressure)/d(PorousFlow variable), else returns
      45             :    * d(quadpoint temperature)/d(PorousFlow variable)
      46             :    * @param pvar The PorousFlow variable number
      47             :    */
      48             :   Real dptqp(unsigned pvar) const;
      49             : 
      50             :   /// Returns the flux from the line sink (before modification by mobility, etc).  Derived classes should override this
      51             :   virtual Real computeQpBaseOutflow(unsigned current_dirac_ptid) const = 0;
      52             : 
      53             :   /// Calculates the BaseOutflow as well as its derivative wrt jvar.  Derived classes should override this
      54             :   virtual void computeQpBaseOutflowJacobian(unsigned jvar,
      55             :                                             unsigned current_dirac_ptid,
      56             :                                             Real & outflow,
      57             :                                             Real & outflowp) const = 0;
      58             : 
      59             :   /// PorousFlow UserObject
      60             :   const PorousFlowDictator & _dictator;
      61             : 
      62             :   /**
      63             :    * This is used to hold the total fluid flowing into the line sink for each time step.
      64             :    * Hence, it is positive for production wells where fluid is flowing
      65             :    * from porespace into the line sink (and hence removed from the model)
      66             :    */
      67             :   PorousFlowSumQuantity & _total_outflow_mass;
      68             : 
      69             :   /// Whether a quadpoint porepressure material exists (for error checking)
      70             :   const bool _has_porepressure;
      71             : 
      72             :   /// Whether a quadpoint temperature material exists (for error checking)
      73             :   const bool _has_temperature;
      74             : 
      75             :   /// Whether a mass_fraction material exists (for error checking)
      76             :   const bool _has_mass_fraction;
      77             : 
      78             :   /// Whether a relative permeability material exists (for error checking)
      79             :   const bool _has_relative_permeability;
      80             : 
      81             :   /// Whether enough materials exist to form the mobility (for error checking)
      82             :   const bool _has_mobility;
      83             : 
      84             :   /// Whether an enthalpy material exists (for error checking)
      85             :   const bool _has_enthalpy;
      86             : 
      87             :   /// Whether an internal-energy material exists (for error checking)
      88             :   const bool _has_internal_energy;
      89             : 
      90             :   /// whether the flux  is a function of pressure or temperature
      91             :   const enum class PorTchoice { pressure, temperature } _p_or_t;
      92             : 
      93             :   /// Whether the flux will be multiplied by the mass fraction
      94             :   const bool _use_mass_fraction;
      95             : 
      96             :   /// Whether the flux will be multiplied by the relative permeability
      97             :   const bool _use_relative_permeability;
      98             : 
      99             :   /// Whether the flux will be multiplied by the mobility
     100             :   const bool _use_mobility;
     101             : 
     102             :   /// Whether the flux will be multiplied by the enthalpy
     103             :   const bool _use_enthalpy;
     104             : 
     105             :   /// Whether the flux will be multiplied by the internal-energy
     106             :   const bool _use_internal_energy;
     107             : 
     108             :   /// The phase number
     109             :   const unsigned int _ph;
     110             : 
     111             :   /// The component number (only used if _use_mass_fraction==true)
     112             :   const unsigned int _sp;
     113             : 
     114             :   /// Quadpoint pore pressure in each phase
     115             :   const MaterialProperty<std::vector<Real>> * const _pp;
     116             : 
     117             :   /// d(quadpoint pore pressure in each phase)/d(PorousFlow variable)
     118             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dpp_dvar;
     119             : 
     120             :   /// Quadpoint temperature
     121             :   const MaterialProperty<Real> * const _temperature;
     122             : 
     123             :   /// d(quadpoint temperature)/d(PorousFlow variable)
     124             :   const MaterialProperty<std::vector<Real>> * const _dtemperature_dvar;
     125             : 
     126             :   /// Fluid density for each phase (at the node)
     127             :   const MaterialProperty<std::vector<Real>> * const _fluid_density_node;
     128             : 
     129             :   /// d(Fluid density for each phase (at the node))/d(PorousFlow variable)
     130             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_density_node_dvar;
     131             : 
     132             :   /// Viscosity of each component in each phase
     133             :   const MaterialProperty<std::vector<Real>> * const _fluid_viscosity;
     134             : 
     135             :   /// d(Viscosity of each component in each phase)/d(PorousFlow variable)
     136             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_viscosity_dvar;
     137             : 
     138             :   /// Relative permeability of each phase
     139             :   const MaterialProperty<std::vector<Real>> * const _relative_permeability;
     140             : 
     141             :   /// d(Relative permeability of each phase)/d(PorousFlow variable)
     142             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _drelative_permeability_dvar;
     143             : 
     144             :   /// Mass fraction of each component in each phase
     145             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _mass_fractions;
     146             : 
     147             :   /// d(Mass fraction of each component in each phase)/d(PorousFlow variable)
     148             :   const MaterialProperty<std::vector<std::vector<std::vector<Real>>>> * const _dmass_fractions_dvar;
     149             : 
     150             :   /// Enthalpy of each phase
     151             :   const MaterialProperty<std::vector<Real>> * const _enthalpy;
     152             : 
     153             :   /// d(enthalpy of each phase)/d(PorousFlow variable)
     154             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _denthalpy_dvar;
     155             : 
     156             :   /// Internal_Energy of each phase
     157             :   const MaterialProperty<std::vector<Real>> * const _internal_energy;
     158             : 
     159             :   /// d(internal_energy of each phase)/d(PorousFlow variable)
     160             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dinternal_energy_dvar;
     161             : };
     162             : 
     163             : #endif // POROUSFLOWLINESINK_H

Generated by: LCOV version 1.11