LCOV - code coverage report
Current view: top level - src/materials - PorousFlow1PhaseFullySaturated.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 35 37 94.6 %
Date: 2017-11-20 14:50:56 Functions: 7 7 100.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             : #include "PorousFlow1PhaseFullySaturated.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12          57 : validParams<PorousFlow1PhaseFullySaturated>()
      13             : {
      14          57 :   InputParameters params = validParams<PorousFlowVariableBase>();
      15         171 :   params.addRequiredCoupledVar("porepressure",
      16          57 :                                "Variable that represents the porepressure of the single phase");
      17         114 :   params.addClassDescription("This Material is used for the fully saturated single-phase situation "
      18          57 :                              "where porepressure is the primary variable");
      19          57 :   return params;
      20             : }
      21             : 
      22         171 : PorousFlow1PhaseFullySaturated::PorousFlow1PhaseFullySaturated(const InputParameters & parameters)
      23             :   : PorousFlowVariableBase(parameters),
      24             : 
      25         513 :     _porepressure_var(_nodal_material ? coupledNodalValue("porepressure")
      26         435 :                                       : coupledValue("porepressure")),
      27         342 :     _gradp_qp_var(coupledGradient("porepressure")),
      28         342 :     _porepressure_varnum(coupled("porepressure")),
      29         171 :     _p_var_num(_dictator.isPorousFlowVariable(_porepressure_varnum)
      30         171 :                    ? _dictator.porousFlowVariableNum(_porepressure_varnum)
      31         855 :                    : 0)
      32             : {
      33         171 :   if (_num_phases != 1)
      34             :     mooseError("The Dictator proclaims that the number of phases is ",
      35           0 :                _dictator.numPhases(),
      36             :                " whereas PorousFlow1PhaseFullySaturated can only be used for 1-phase simulations."
      37           0 :                " Be aware that the Dictator has noted your mistake.");
      38         171 : }
      39             : 
      40             : void
      41       25596 : PorousFlow1PhaseFullySaturated::initQpStatefulProperties()
      42             : {
      43       25596 :   PorousFlowVariableBase::initQpStatefulProperties();
      44       25596 :   buildQpPPSS();
      45       25596 : }
      46             : 
      47             : void
      48      611464 : PorousFlow1PhaseFullySaturated::computeQpProperties()
      49             : {
      50             :   // Size vectors correctly and prepare the derivative matrices with zeroes
      51      611464 :   PorousFlowVariableBase::computeQpProperties();
      52             : 
      53      611464 :   buildQpPPSS();
      54             : 
      55      611464 :   if (!_nodal_material)
      56     1578120 :     (*_gradp_qp)[_qp][0] = _gradp_qp_var[_qp];
      57             : 
      58             :   // _porepressure is only dependent on _porepressure, and its derivative is 1
      59      611464 :   if (_dictator.isPorousFlowVariable(_porepressure_varnum))
      60             :   {
      61             :     // _porepressure is a PorousFlow variable
      62     1222928 :     _dporepressure_dvar[_qp][0][_p_var_num] = 1.0;
      63      611464 :     if (!_nodal_material)
      64     1052080 :       (*_dgradp_qp_dgradv)[_qp][0][_p_var_num] = 1.0;
      65             :   }
      66      611464 : }
      67             : 
      68             : void
      69      637060 : PorousFlow1PhaseFullySaturated::buildQpPPSS()
      70             : {
      71     1911180 :   _porepressure[_qp][0] = _porepressure_var[_qp];
      72     1274120 :   _saturation[_qp][0] = 1.0;
      73      639559 : }

Generated by: LCOV version 1.11