LCOV - code coverage report
Current view: top level - src/materials - PorousFlowPorosityHM.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 46 46 100.0 %
Date: 2017-11-21 14:47:27 Functions: 9 9 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 "PorousFlowPorosityHM.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12          24 : validParams<PorousFlowPorosityHM>()
      13             : {
      14          24 :   InputParameters params = validParams<PorousFlowPorosityExponentialBase>();
      15          72 :   params.addRequiredCoupledVar(
      16             :       "porosity_zero",
      17          24 :       "The porosity at zero volumetric strain and reference effective porepressure");
      18          96 :   params.addRangeCheckedParam<Real>(
      19          24 :       "biot_coefficient", 1, "biot_coefficient>=0 & biot_coefficient<=1", "Biot coefficient");
      20          96 :   params.addRequiredRangeCheckedParam<Real>(
      21          24 :       "solid_bulk", "solid_bulk>0", "Bulk modulus of the drained porous solid skeleton");
      22          72 :   params.addRequiredCoupledVar("displacements", "The solid-mechanics displacement variables");
      23          48 :   params.addClassDescription(
      24          24 :       "This Material calculates the porosity for hydro-mechanical simulations");
      25          72 :   params.addCoupledVar(
      26          24 :       "reference_porepressure", 0.0, "porosity = porosity_zero at reference pressure");
      27          24 :   return params;
      28             : }
      29             : 
      30          72 : PorousFlowPorosityHM::PorousFlowPorosityHM(const InputParameters & parameters)
      31             :   : PorousFlowPorosityExponentialBase(parameters),
      32             : 
      33         216 :     _phi0(_nodal_material ? coupledNodalValue("porosity_zero") : coupledValue("porosity_zero")),
      34         216 :     _biot(getParam<Real>("biot_coefficient")),
      35         216 :     _solid_bulk(getParam<Real>("solid_bulk")),
      36          72 :     _coeff((_biot - 1.0) / _solid_bulk),
      37             : 
      38         216 :     _p_reference(_nodal_material ? coupledNodalValue("reference_porepressure")
      39         126 :                                  : coupledValue("reference_porepressure")),
      40             : 
      41         144 :     _ndisp(coupledComponents("displacements")),
      42          72 :     _disp_var_num(_ndisp),
      43             : 
      44         144 :     _vol_strain_qp(getMaterialProperty<Real>("PorousFlow_total_volumetric_strain_qp")),
      45             :     _dvol_strain_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
      46         144 :         "dPorousFlow_total_volumetric_strain_qp_dvar")),
      47             : 
      48         216 :     _pf(_nodal_material ? getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_nodal")
      49         126 :                         : getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
      50         144 :     _dpf_dvar(_nodal_material ? getMaterialProperty<std::vector<Real>>(
      51         162 :                                     "dPorousFlow_effective_fluid_pressure_nodal_dvar")
      52             :                               : getMaterialProperty<std::vector<Real>>(
      53         918 :                                     "dPorousFlow_effective_fluid_pressure_qp_dvar"))
      54             : {
      55         504 :   for (unsigned int i = 0; i < _ndisp; ++i)
      56         648 :     _disp_var_num[i] = coupled("displacements", i);
      57          72 : }
      58             : 
      59             : Real
      60      207792 : PorousFlowPorosityHM::atNegInfinityQp() const
      61             : {
      62      207792 :   return _biot;
      63             : }
      64             : 
      65             : Real
      66      207792 : PorousFlowPorosityHM::atZeroQp() const
      67             : {
      68      415584 :   return _phi0[_qp];
      69             : }
      70             : 
      71             : Real
      72      207792 : PorousFlowPorosityHM::decayQp() const
      73             : {
      74             :   // Note that in the following _strain[_qp] is evaluated at q quadpoint
      75             :   // So _porosity_nodal[_qp], which should be the nodal value of porosity
      76             :   // actually uses the strain at a quadpoint.  This
      77             :   // is OK for LINEAR elements, as strain is constant over the element anyway.
      78             :   const unsigned qp_to_use =
      79      207792 :       (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
      80             : 
      81      831168 :   return -_vol_strain_qp[qp_to_use] + _coeff * (_pf[_qp] - _p_reference[_qp]);
      82             : }
      83             : 
      84             : Real
      85      834400 : PorousFlowPorosityHM::ddecayQp_dvar(unsigned pvar) const
      86             : {
      87     1668800 :   return _coeff * _dpf_dvar[_qp][pvar];
      88             : }
      89             : 
      90             : RealGradient
      91      834400 : PorousFlowPorosityHM::ddecayQp_dgradvar(unsigned pvar) const
      92             : {
      93             :   const unsigned qp_to_use =
      94      834400 :       (_nodal_material && (_bnd || _strain_at_nearest_qp) ? nearestQP(_qp) : _qp);
      95     1668800 :   return -_dvol_strain_qp_dvar[qp_to_use][pvar];
      96        2499 : }

Generated by: LCOV version 1.11