LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowEffectiveStressCoupling.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 39 40 97.5 %
Date: 2017-11-17 17:48:31 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 "PorousFlowEffectiveStressCoupling.h"
       9             : 
      10             : // MOOSE includes
      11             : #include "Function.h"
      12             : #include "MooseMesh.h"
      13             : #include "MooseVariable.h"
      14             : 
      15             : template <>
      16             : InputParameters
      17          94 : validParams<PorousFlowEffectiveStressCoupling>()
      18             : {
      19          94 :   InputParameters params = validParams<Kernel>();
      20         188 :   params.addClassDescription("Adds -BiotCoefficient*effective_porepressure*grad_test[component]");
      21         282 :   params.addRequiredParam<UserObjectName>(
      22          94 :       "PorousFlowDictator", "The UserObject that holds the list of Porous-Flow variable names.");
      23         376 :   params.addRangeCheckedParam<Real>(
      24          94 :       "biot_coefficient", 1, "biot_coefficient>=0&biot_coefficient<=1", "Biot coefficient");
      25         282 :   params.addRequiredParam<unsigned int>("component",
      26          94 :                                         "The gradient direction (0 for x, 1 for y and 2 for z)");
      27          94 :   return params;
      28             : }
      29             : 
      30          94 : PorousFlowEffectiveStressCoupling::PorousFlowEffectiveStressCoupling(
      31          94 :     const InputParameters & parameters)
      32             :   : Kernel(parameters),
      33         188 :     _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
      34         282 :     _coefficient(getParam<Real>("biot_coefficient")),
      35         282 :     _component(getParam<unsigned int>("component")),
      36         188 :     _pf(getMaterialProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
      37             :     _dpf_dvar(
      38         188 :         getMaterialProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_qp_dvar")),
      39         658 :     _rz(getBlockCoordSystem() == Moose::COORD_RZ)
      40             : {
      41          94 :   if (_component >= _mesh.dimension())
      42             :     mooseError("PorousFlowEffectiveStressCoupling: component should not be greater than the mesh "
      43           0 :                "dimension");
      44          94 : }
      45             : 
      46             : Real
      47     8251648 : PorousFlowEffectiveStressCoupling::computeQpResidual()
      48             : {
      49     8251648 :   if (_rz && _component == 0)
      50       17760 :     return -_coefficient * _pf[_qp] * (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
      51    24744288 :   return -_coefficient * _pf[_qp] * _grad_test[_i][_qp](_component);
      52             : }
      53             : 
      54             : Real
      55    32295424 : PorousFlowEffectiveStressCoupling::computeQpJacobian()
      56             : {
      57    32295424 :   if (_dictator.notPorousFlowVariable(_var.number()))
      58             :     return 0.0;
      59    32249344 :   const unsigned int pvar = _dictator.porousFlowVariableNum(_var.number());
      60    32249344 :   if (_rz && _component == 0)
      61       16512 :     return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] *
      62       22016 :            (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
      63   128975360 :   return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] * _grad_test[_i][_qp](_component);
      64             : }
      65             : 
      66             : Real
      67   100930560 : PorousFlowEffectiveStressCoupling::computeQpOffDiagJacobian(unsigned int jvar)
      68             : {
      69   100930560 :   if (_dictator.notPorousFlowVariable(jvar))
      70             :     return 0.0;
      71   100838400 :   const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
      72   100838400 :   if (_rz && _component == 0)
      73       47232 :     return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] *
      74       62976 :            (_grad_test[_i][_qp](0) + _test[_i][_qp] / _q_point[_qp](0));
      75   403290624 :   return -_coefficient * _phi[_j][_qp] * _dpf_dvar[_qp][pvar] * _grad_test[_i][_qp](_component);
      76        2499 : }

Generated by: LCOV version 1.11