LCOV - code coverage report
Current view: top level - include/bcs - PorousFlowSink.h (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 1 1 100.0 %
Date: 2017-11-16 18:50:22 Functions: 1 2 50.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 POROUSFLOWSINK_H
       9             : #define POROUSFLOWSINK_H
      10             : 
      11             : #include "IntegratedBC.h"
      12             : #include "Function.h"
      13             : #include "PorousFlowDictator.h"
      14             : 
      15             : // Forward Declarations
      16             : class PorousFlowSink;
      17             : 
      18             : template <>
      19             : InputParameters validParams<PorousFlowSink>();
      20             : 
      21             : /**
      22             :  * Applies a flux sink to a boundary.
      23             :  * The strength of the flux is specified by flux_function.
      24             :  * In addition, this sink can be multiplied by:
      25             :  *  (1) the relative permeability of the fluid at the nodes
      26             :  *  (2) perm_nn*density/viscosity (the so-called mobility)
      27             :  *      where perm_nn is the permeability tensor projected
      28             :  *      to the normal direction.
      29             :  *  (3) the mass_fraction of a component at the nodes
      30             :  *  (4) the enthalpy of the phase
      31             :  *  (5) the internal energy of the phase
      32             :  *  (6) the thermal conductivity of the medium
      33             :  */
      34          26 : class PorousFlowSink : public IntegratedBC
      35             : {
      36             : public:
      37             :   PorousFlowSink(const InputParameters & parameters);
      38             : 
      39             : protected:
      40             :   virtual Real computeQpResidual() override;
      41             :   virtual Real computeQpJacobian() override;
      42             :   virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
      43             : 
      44             :   /// PorousFlow UserObject
      45             :   const PorousFlowDictator & _dictator;
      46             : 
      47             :   /// Whether this BC involves fluid (whether the user has supplied a fluid phase number)
      48             :   const bool _involves_fluid;
      49             : 
      50             :   /// The phase number
      51             :   const unsigned int _ph;
      52             : 
      53             :   /// Whether the flux will be multiplied by the mass fraction
      54             :   const bool _use_mass_fraction;
      55             : 
      56             :   /// Whether there is a "mass_fraction" Material.  This is just for error checking
      57             :   const bool _has_mass_fraction;
      58             : 
      59             :   /// The component number (only used if _use_mass_fraction==true)
      60             :   const unsigned int _sp;
      61             : 
      62             :   /// whether to multiply the sink flux by permeability*density/viscosity
      63             :   const bool _use_mobility;
      64             : 
      65             :   /// Whether there are Materials that can form "mobility".  This is just for error checking
      66             :   const bool _has_mobility;
      67             : 
      68             :   /// whether to multiply the sink flux by relative permeability
      69             :   const bool _use_relperm;
      70             : 
      71             :   /// Whether there is a "relperm" Material.  This is just for error checking
      72             :   const bool _has_relperm;
      73             : 
      74             :   /// whether to multiply the sink flux by enthalpy
      75             :   const bool _use_enthalpy;
      76             : 
      77             :   /// whether there is an "enthalpy" Material.  This is just for error checking
      78             :   const bool _has_enthalpy;
      79             : 
      80             :   /// whether to multiply the sink flux by internal_energy
      81             :   const bool _use_internal_energy;
      82             : 
      83             :   /// whether there is an "internal_energy" Material.  This is just for error checking
      84             :   const bool _has_internal_energy;
      85             : 
      86             :   /// whether to multiply the sink flux by thermal_conductivity
      87             :   const bool _use_thermal_conductivity;
      88             : 
      89             :   /// whether there is an "thermal_conductivity" Material.  This is just for error checking
      90             :   const bool _has_thermal_conductivity;
      91             : 
      92             :   /// The flux
      93             :   Function & _m_func;
      94             : 
      95             :   /// Permeability of porous material
      96             :   const MaterialProperty<RealTensorValue> * const _permeability;
      97             : 
      98             :   /// d(Permeability)/d(PorousFlow variable)
      99             :   const MaterialProperty<std::vector<RealTensorValue>> * const _dpermeability_dvar;
     100             : 
     101             :   /// d(Permeability)/d(grad(PorousFlow variable))
     102             :   const MaterialProperty<std::vector<std::vector<RealTensorValue>>> * const _dpermeability_dgradvar;
     103             : 
     104             :   /// Fluid density for each phase (at the node)
     105             :   const MaterialProperty<std::vector<Real>> * const _fluid_density_node;
     106             : 
     107             :   /// d(Fluid density for each phase (at the node))/d(PorousFlow variable)
     108             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_density_node_dvar;
     109             : 
     110             :   /// Viscosity of each component in each phase
     111             :   const MaterialProperty<std::vector<Real>> * const _fluid_viscosity;
     112             : 
     113             :   /// d(Viscosity of each component in each phase)/d(PorousFlow variable)
     114             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_viscosity_dvar;
     115             : 
     116             :   /// Relative permeability of each phase
     117             :   const MaterialProperty<std::vector<Real>> * const _relative_permeability;
     118             : 
     119             :   /// d(Relative permeability of each phase)/d(PorousFlow variable)
     120             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _drelative_permeability_dvar;
     121             : 
     122             :   /// Mass fraction of each component in each phase
     123             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _mass_fractions;
     124             : 
     125             :   /// d(Mass fraction of each component in each phase)/d(PorousFlow variable)
     126             :   const MaterialProperty<std::vector<std::vector<std::vector<Real>>>> * const _dmass_fractions_dvar;
     127             : 
     128             :   /// Enthalpy of each phase
     129             :   const MaterialProperty<std::vector<Real>> * const _enthalpy;
     130             : 
     131             :   /// d(enthalpy of each phase)/d(PorousFlow variable)
     132             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _denthalpy_dvar;
     133             : 
     134             :   /// Internal_Energy of each phase
     135             :   const MaterialProperty<std::vector<Real>> * const _internal_energy;
     136             : 
     137             :   /// d(internal_energy of each phase)/d(PorousFlow variable)
     138             :   const MaterialProperty<std::vector<std::vector<Real>>> * const _dinternal_energy_dvar;
     139             : 
     140             :   /// Thermal_Conductivity of porous material
     141             :   const MaterialProperty<RealTensorValue> * const _thermal_conductivity;
     142             : 
     143             :   /// d(Thermal_Conductivity)/d(PorousFlow variable)
     144             :   const MaterialProperty<std::vector<RealTensorValue>> * const _dthermal_conductivity_dvar;
     145             : 
     146             :   /// derivative of residual with respect to the jvar variable
     147             :   Real jac(unsigned int jvar) const;
     148             : 
     149             :   /// The flux gets multiplied by this quantity
     150             :   virtual Real multiplier() const;
     151             : 
     152             :   /// d(multiplier)/d(Porous flow variable pvar)
     153             :   virtual Real dmultiplier_dvar(unsigned int pvar) const;
     154             : };
     155             : 
     156             : #endif // POROUSFLOWSINK_H

Generated by: LCOV version 1.11