LCOV - code coverage report
Current view: top level - src/materials - PorousFlowDiffusivityConst.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 17 20 85.0 %
Date: 2017-11-21 14:47:27 Functions: 5 5 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 "PorousFlowDiffusivityConst.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12           9 : validParams<PorousFlowDiffusivityConst>()
      13             : {
      14           9 :   InputParameters params = validParams<PorousFlowDiffusivityBase>();
      15          27 :   params.addRequiredParam<std::vector<Real>>(
      16           9 :       "tortuosity", "List of tortuosities. Order is i) phase 0; ii) phase 1; etc");
      17          18 :   params.addClassDescription(
      18           9 :       "This Material provides constant tortuosity and diffusion coefficients");
      19           9 :   return params;
      20             : }
      21             : 
      22          27 : PorousFlowDiffusivityConst::PorousFlowDiffusivityConst(const InputParameters & parameters)
      23             :   : PorousFlowDiffusivityBase(parameters),
      24          81 :     _input_tortuosity(getParam<std::vector<Real>>("tortuosity"))
      25             : {
      26             :   // Check that the number of tortuosities entered is equal to the number of phases
      27          27 :   if (_input_tortuosity.size() != _num_phases)
      28             :     mooseError("The number of tortuosity values entered is not equal to the number of phases "
      29           0 :                "specified in the Dictator");
      30             : 
      31             :   // Check that all tortuosities are (0, 1]
      32          87 :   for (unsigned int i = 0; i < _num_phases; ++i)
      33          60 :     if (_input_tortuosity[i] <= 0.0 || _input_tortuosity[i] > 1)
      34             :       mooseError("All tortuosities must be greater than zero and less than (or equal to) one in ",
      35           0 :                  _name,
      36             :                  ".\nNote: the definition of tortuosity used is l/le, where l is the straight line "
      37           0 :                  "length and le is the effective flow length");
      38          27 : }
      39             : 
      40             : void
      41       54296 : PorousFlowDiffusivityConst::computeQpProperties()
      42             : {
      43       54296 :   PorousFlowDiffusivityBase::computeQpProperties();
      44             : 
      45      108592 :   _tortuosity[_qp] = _input_tortuosity;
      46       56795 : }

Generated by: LCOV version 1.11