LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowDesorpedMassVolumetricExpansion.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 36 37 97.3 %
Date: 2017-11-21 14:47:27 Functions: 8 8 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 "PorousFlowDesorpedMassVolumetricExpansion.h"
       9             : 
      10             : // MOOSE includes
      11             : #include "MooseVariable.h"
      12             : 
      13             : template <>
      14             : InputParameters
      15           2 : validParams<PorousFlowDesorpedMassVolumetricExpansion>()
      16             : {
      17           2 :   InputParameters params = validParams<TimeKernel>();
      18           6 :   params.addRequiredParam<UserObjectName>(
      19           2 :       "PorousFlowDictator", "The UserObject that holds the list of Porous-Flow variable names.");
      20           6 :   params.addRequiredCoupledVar(
      21           2 :       "conc_var", "The variable that represents the concentration of desorped species");
      22           4 :   params.addClassDescription("Desorped_mass * rate_of_solid_volumetric_expansion");
      23           2 :   return params;
      24             : }
      25             : 
      26           2 : PorousFlowDesorpedMassVolumetricExpansion::PorousFlowDesorpedMassVolumetricExpansion(
      27           2 :     const InputParameters & parameters)
      28             :   : TimeKernel(parameters),
      29           4 :     _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
      30           4 :     _conc_var_number(coupled("conc_var")),
      31           4 :     _conc(coupledValue("conc_var")),
      32           4 :     _porosity(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
      33           4 :     _dporosity_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
      34             :     _dporosity_dgradvar(
      35           4 :         getMaterialProperty<std::vector<RealGradient>>("dPorousFlow_porosity_qp_dgradvar")),
      36           4 :     _strain_rate_qp(getMaterialProperty<Real>("PorousFlow_volumetric_strain_rate_qp")),
      37             :     _dstrain_rate_qp_dvar(getMaterialProperty<std::vector<RealGradient>>(
      38          20 :         "dPorousFlow_volumetric_strain_rate_qp_dvar"))
      39             : {
      40           2 : }
      41             : 
      42             : Real
      43        7632 : PorousFlowDesorpedMassVolumetricExpansion::computeQpResidual()
      44             : {
      45       38160 :   return _test[_i][_qp] * (1.0 - _porosity[_qp]) * _conc[_qp] * _strain_rate_qp[_qp];
      46             : }
      47             : 
      48             : Real
      49        1560 : PorousFlowDesorpedMassVolumetricExpansion::computeQpJacobian()
      50             : {
      51        1560 :   return computeQpJac(_var.number());
      52             : }
      53             : 
      54             : Real
      55        5568 : PorousFlowDesorpedMassVolumetricExpansion::computeQpOffDiagJacobian(unsigned int jvar)
      56             : {
      57        5568 :   return computeQpJac(jvar);
      58             : }
      59             : 
      60             : Real
      61        7128 : PorousFlowDesorpedMassVolumetricExpansion::computeQpJac(unsigned int jvar) const
      62             : {
      63             :   Real deriv = 0.0;
      64             : 
      65        7128 :   if (jvar == _conc_var_number)
      66         864 :     deriv = (1.0 - _porosity[_qp]) * _phi[_j][_qp] * _strain_rate_qp[_qp];
      67             : 
      68        7128 :   if (_dictator.notPorousFlowVariable(jvar))
      69           0 :     return _test[_i][_qp] * deriv;
      70        7128 :   const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
      71             : 
      72       35640 :   deriv -= _dporosity_dgradvar[_qp][pvar] * _grad_phi[_j][_qp] * _conc[_qp] * _strain_rate_qp[_qp];
      73       21384 :   deriv -= _dporosity_dvar[_qp][pvar] * _phi[_j][_qp] * _conc[_qp] * _strain_rate_qp[_qp];
      74        7128 :   deriv +=
      75       21384 :       (1.0 - _porosity[_qp]) * _conc[_qp] * _dstrain_rate_qp_dvar[_qp][pvar] * _grad_phi[_j][_qp];
      76             : 
      77       14256 :   return _test[_i][_qp] * deriv;
      78        2499 : }

Generated by: LCOV version 1.11