LCOV - code coverage report
Current view: top level - include/actions - PorousFlowActionBase.h (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 1 1 100.0 %
Date: 2017-11-20 14:50:56 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             : #ifndef POROUSFLOWACTIONBASE_H
       8             : #define POROUSFLOWACTIONBASE_H
       9             : 
      10             : #include "Action.h"
      11             : #include "PorousFlowDependencies.h"
      12             : 
      13             : class PorousFlowActionBase;
      14             : 
      15             : template <>
      16             : InputParameters validParams<PorousFlowActionBase>();
      17             : 
      18             : /**
      19             :  * Base class for PorousFlow actions.  This act() method simply
      20             :  * defines the name of the PorousFlowDictator.  However, this
      21             :  * class also contains a number of utility functions that may
      22             :  * be used by derived classes
      23             :  */
      24         210 : class PorousFlowActionBase : public Action, public PorousFlowDependencies
      25             : {
      26             : public:
      27             :   PorousFlowActionBase(const InputParameters & params);
      28             : 
      29             :   virtual void act() override;
      30             : 
      31             : protected:
      32             :   /**
      33             :    * List of Kernels, AuxKernels, Materials, etc, to be added.
      34             :    * This list will be used to determine what Materials need
      35             :    * to be added.
      36             :    * Actions may add or remove things from this list
      37             :    */
      38             :   std::vector<std::string> _objects_to_add;
      39             : 
      40             :   /// The name of the PorousFlowDictator object to be added
      41             :   const std::string _dictator_name;
      42             : 
      43             :   /// gravity
      44             :   const RealVectorValue _gravity;
      45             : 
      46             :   /// Name of the mass-fraction variables (if any)
      47             :   const std::vector<VariableName> & _mass_fraction_vars;
      48             : 
      49             :   /// Number of mass-fraction variables
      50             :   const unsigned _num_mass_fraction_vars;
      51             : 
      52             :   /// Name of the temperature variable (if any)
      53             :   const std::vector<VariableName> & _temperature_var;
      54             : 
      55             :   /// displacement NonlinearVariable names (if any)
      56             :   const std::vector<NonlinearVariableName> & _displacements;
      57             : 
      58             :   /// number of displacement variables supplied
      59             :   const unsigned _ndisp;
      60             : 
      61             :   /// displacement Variable names
      62             :   std::vector<VariableName> _coupled_displacements;
      63             : 
      64             :   /// Coordinate system of the simulation (eg RZ, XYZ, etc)
      65             :   Moose::CoordinateSystemType _coord_system;
      66             : 
      67             :   /**
      68             :    * add the PorousFlowDictator object
      69             :    */
      70             :   virtual void addDictator() = 0;
      71             : 
      72             :   /**
      73             :    * Add an AuxVariable and AuxKernel to calculate saturation
      74             :    * @param phase Saturation for this fluid phase
      75             :    */
      76             :   void addSaturationAux(unsigned phase);
      77             : 
      78             :   /**
      79             :    * Add AuxVariables and AuxKernels to calculate Darcy velocity.
      80             :    * @param gravity gravitational acceleration pointing downwards (eg (0, 0, -9.8))
      81             :    */
      82             :   void addDarcyAux(const RealVectorValue & gravity);
      83             : 
      84             :   /**
      85             :    * Add AuxVariables and AuxKernels to compute effective stress.
      86             :    */
      87             :   void addStressAux();
      88             : 
      89             :   /**
      90             :    * Adds a nodal and a quadpoint Temperature material
      91             :    * @param at_nodes Add nodal temperature Material
      92             :    */
      93             :   void addTemperatureMaterial(bool at_nodes);
      94             : 
      95             :   /**
      96             :    * Adds a nodal and a quadpoint MassFraction material
      97             :    * @param at_nodes Add nodal mass-fraction material
      98             :    */
      99             :   void addMassFractionMaterial(bool at_nodes);
     100             : 
     101             :   /**
     102             :    * Adds a nodal and a quadpoint effective fluid pressure material
     103             :    * @param at_nodes Add nodal effective fluid pressure material
     104             :    */
     105             :   void addEffectiveFluidPressureMaterial(bool at_nodes);
     106             : 
     107             :   /**
     108             :    * Adds a quadpoint volumetric strain material
     109             :    * @param displacements the names of the displacement variables
     110             :    * @param consistent_with_displaced_mesh The volumetric strain should be consistent with the
     111             :    * displaced mesh
     112             :    */
     113             :   void addVolumetricStrainMaterial(const std::vector<VariableName> & displacements,
     114             :                                    bool consistent_with_displaced_mesh);
     115             : 
     116             :   /**
     117             :    * Adds a single-component fluid Material
     118             :    * @param phase the phase number of the fluid
     119             :    * @param fp the name of the FluidProperties UserObject
     120             :    * @param compute_density_and_viscosity compute the density and viscosity of the fluid
     121             :    * @param compute_internal_energy compute the fluid internal energy
     122             :    * @param compute_enthalpy compute the fluid enthalpy
     123             :    * @param at_nodes add a nodal material
     124             :    */
     125             :   void addSingleComponentFluidMaterial(bool at_nodes,
     126             :                                        unsigned phase,
     127             :                                        bool compute_density_and_viscosity,
     128             :                                        bool compute_internal_energy,
     129             :                                        bool compute_enthalpy,
     130             :                                        const UserObjectName & fp);
     131             : 
     132             :   /**
     133             :    * Adds a brine fluid Material
     134             :    * @param xnacl the variable containing the mass fraction of NaCl in the fluid
     135             :    * @param phase the phase number of the fluid
     136             :    * @param compute_density_and_viscosity compute the density and viscosity of the fluid
     137             :    * @param compute_internal_energy compute the fluid internal energy
     138             :    * @param compute_enthalpy compute the fluid enthalpy
     139             :    * @param at_nodes add a nodal material
     140             :    */
     141             :   void addBrineMaterial(const VariableName xnacl,
     142             :                         bool at_nodes,
     143             :                         unsigned phase,
     144             :                         bool compute_density_and_viscosity,
     145             :                         bool compute_internal_energy,
     146             :                         bool compute_enthalpy);
     147             : 
     148             :   /**
     149             :    * Adds a relative-permeability Material of the Corey variety
     150             :    * @param phase the phase number of the fluid
     151             :    * @param n The Corey exponent
     152             :    * @param s_res The residual saturation for this phase
     153             :    * @param sum_s_res The sum of residual saturations over all phases
     154             :    */
     155             :   void
     156             :   addRelativePermeabilityCorey(bool at_nodes, unsigned phase, Real n, Real s_res, Real sum_s_res);
     157             : 
     158             :   /**
     159             :    * Adds a relative-permeability Material of the FLAC variety
     160             :    * @param phase the phase number of the fluid
     161             :    * @param m The FLAC exponent
     162             :    * @param s_res The residual saturation for this phase
     163             :    * @param sum_s_res The sum of residual saturations over all phases
     164             :    */
     165             :   void
     166             :   addRelativePermeabilityFLAC(bool at_nodes, unsigned phase, Real m, Real s_res, Real sum_s_res);
     167             : 
     168             :   /**
     169             :    * Adds a van Genuchten capillary pressure UserObject
     170             :    * @param m van Genuchten exponent
     171             :    * @param alpha van Genuchten alpha
     172             :    * @param userobject_name name of the user object
     173             :    */
     174             :   void addCapillaryPressureVG(Real m, Real alpha, std::string userobject_name);
     175             : 
     176             :   /**
     177             :    * Adds a PorousFlowJoiner for the material_property Material
     178             :    * @param at_nodes if true: the Joiner should produce a nodal material, otherwise: produce a QP
     179             :    * material
     180             :    * @param material_property Join this PorousFlow Material
     181             :    * @param output_name The name given to this PorousFlowJoiner in the input file
     182             :    */
     183             :   void
     184             :   addJoiner(bool at_nodes, const std::string & material_property, const std::string & output_name);
     185             : 
     186             :   /**
     187             :    * Adds a PorousFlowJoiner for the fluid density
     188             :    * @param at_nodes if true: the Joiner should produce a nodal material, otherwise: produce a QP
     189             :    * material
     190             :    */
     191             :   void joinDensity(bool at_nodes);
     192             : 
     193             :   /**
     194             :    * Adds a PorousFlowJoiner for the fluid viscosity
     195             :    * @param at_nodes if true: the Joiner should produce a nodal material, otherwise: produce a QP
     196             :    * material
     197             :    */
     198             :   void joinViscosity(bool at_nodes);
     199             : 
     200             :   /**
     201             :    * Adds a PorousFlowJoiner for the fluid relative permeability
     202             :    * @param at_nodes if true: the Joiner should produce a nodal material, otherwise: produce a QP
     203             :    * material
     204             :    */
     205             :   void joinRelativePermeability(bool at_nodes);
     206             : 
     207             :   /**
     208             :    * Adds a PorousFlowJoiner for the fluid internal energy
     209             :    * @param at_nodes if true: the Joiner should produce a nodal material, otherwise: produce a QP
     210             :    * material
     211             :    */
     212             :   void joinInternalEnergy(bool at_nodes);
     213             : 
     214             :   /**
     215             :    * Adds a PorousFlowJoiner for the fluid enthalpy
     216             :    * @param at_nodes if true: the Joiner should produce a nodal material, otherwise: produce a QP
     217             :    * material
     218             :    */
     219             :   void joinEnthalpy(bool at_nodes);
     220             : };
     221             : 
     222             : #endif // POROUSFLOWACTIONBASE_H

Generated by: LCOV version 1.11