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

Generated by: LCOV version 1.11