LCOV - code coverage report
Current view: top level - include/kernels - PorousFlowMassTimeDerivative.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             : 
       8             : #ifndef POROUSFLOWMASSTIMEDERIVATIVE_H
       9             : #define POROUSFLOWMASSTIMEDERIVATIVE_H
      10             : 
      11             : #include "TimeDerivative.h"
      12             : #include "PorousFlowDictator.h"
      13             : 
      14             : // Forward Declarations
      15             : class PorousFlowMassTimeDerivative;
      16             : 
      17             : template <>
      18             : InputParameters validParams<PorousFlowMassTimeDerivative>();
      19             : 
      20             : /**
      21             :  * Kernel = (mass_component - mass_component_old)/dt
      22             :  * where mass_component =
      23             :  * porosity*sum_phases(density_phase*saturation_phase*massfrac_phase^component)
      24             :  * It is lumped to the nodes
      25             :  */
      26         264 : class PorousFlowMassTimeDerivative : public TimeKernel
      27             : {
      28             : public:
      29             :   PorousFlowMassTimeDerivative(const InputParameters & parameters);
      30             : 
      31             : protected:
      32             :   virtual Real computeQpResidual() override;
      33             :   virtual Real computeQpJacobian() override;
      34             :   virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
      35             : 
      36             :   /// the fluid component index
      37             :   const unsigned int _fluid_component;
      38             : 
      39             :   /// holds info on the PorousFlow variables
      40             :   const PorousFlowDictator & _dictator;
      41             : 
      42             :   /// whether the Variable for this Kernel is a porous-flow variable according to the Dictator
      43             :   const bool _var_is_porflow_var;
      44             : 
      45             :   /// number of fluid phases
      46             :   const unsigned int _num_phases;
      47             : 
      48             :   /// whether the porosity uses the volumetric strain at the closest quadpoint
      49             :   const bool _strain_at_nearest_qp;
      50             : 
      51             :   /// porosity at the nodes, but it can depend on grad(variables) which are actually evaluated at the qps
      52             :   const MaterialProperty<Real> & _porosity;
      53             : 
      54             :   /// old value of porosity
      55             :   const MaterialProperty<Real> & _porosity_old;
      56             : 
      57             :   /// d(porosity)/d(porous-flow variable) - these derivatives will be wrt variables at the nodes
      58             :   const MaterialProperty<std::vector<Real>> & _dporosity_dvar;
      59             : 
      60             :   /// d(porosity)/d(grad porous-flow variable) - remember these derivatives will be wrt grad(vars) at qps
      61             :   const MaterialProperty<std::vector<RealGradient>> & _dporosity_dgradvar;
      62             : 
      63             :   /// the nearest qp to the node
      64             :   const MaterialProperty<unsigned int> * const _nearest_qp;
      65             : 
      66             :   /// nodal fluid density
      67             :   const MaterialProperty<std::vector<Real>> & _fluid_density;
      68             : 
      69             :   /// old value of nodal fluid density
      70             :   const MaterialProperty<std::vector<Real>> & _fluid_density_old;
      71             : 
      72             :   /// d(nodal fluid density)/d(porous-flow variable)
      73             :   const MaterialProperty<std::vector<std::vector<Real>>> & _dfluid_density_dvar;
      74             : 
      75             :   /// nodal fluid saturation
      76             :   const MaterialProperty<std::vector<Real>> & _fluid_saturation_nodal;
      77             : 
      78             :   /// old value of fluid saturation
      79             :   const MaterialProperty<std::vector<Real>> & _fluid_saturation_nodal_old;
      80             : 
      81             :   /// d(nodal fluid saturation)/d(porous-flow variable)
      82             :   const MaterialProperty<std::vector<std::vector<Real>>> & _dfluid_saturation_nodal_dvar;
      83             : 
      84             :   /// nodal mass fraction
      85             :   const MaterialProperty<std::vector<std::vector<Real>>> & _mass_frac;
      86             : 
      87             :   /// old value of nodal mass fraction
      88             :   const MaterialProperty<std::vector<std::vector<Real>>> & _mass_frac_old;
      89             : 
      90             :   /// d(nodal mass fraction)/d(porous-flow variable)
      91             :   const MaterialProperty<std::vector<std::vector<std::vector<Real>>>> & _dmass_frac_dvar;
      92             : 
      93             :   /**
      94             :    * Derivative of residual with respect to PorousFlow variable number pvar
      95             :    * This is used by both computeQpJacobian and computeQpOffDiagJacobian
      96             :    * @param pvar take the derivative of the residual wrt this PorousFlow variable
      97             :    */
      98             :   Real computeQpJac(unsigned int pvar);
      99             : };
     100             : 
     101             : #endif // POROUSFLOWMASSTIMEDERIVATIVE_H

Generated by: LCOV version 1.11