LCOV - code coverage report
Current view: top level - src/materials - PorousFlowEffectiveFluidPressure.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 44 44 100.0 %
Date: 2017-11-21 14:47:27 Functions: 6 6 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 "PorousFlowEffectiveFluidPressure.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12          75 : validParams<PorousFlowEffectiveFluidPressure>()
      13             : {
      14          75 :   InputParameters params = validParams<PorousFlowMaterialVectorBase>();
      15         150 :   params.addClassDescription("This Material calculates an effective fluid pressure: "
      16             :                              "effective_stress = total_stress + "
      17             :                              "biot_coeff*effective_fluid_pressure.  The effective_fluid_pressure = "
      18          75 :                              "sum_{phases}(S_phase * P_phase)");
      19          75 :   return params;
      20             : }
      21             : 
      22         225 : PorousFlowEffectiveFluidPressure::PorousFlowEffectiveFluidPressure(
      23         225 :     const InputParameters & parameters)
      24             :   : PorousFlowMaterialVectorBase(parameters),
      25         225 :     _porepressure(_nodal_material
      26         675 :                       ? getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_nodal")
      27         519 :                       : getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_qp")),
      28             :     _porepressure_old(
      29         675 :         _nodal_material ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_nodal")
      30         519 :                         : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_porepressure_qp")),
      31         450 :     _dporepressure_dvar(_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
      32         381 :                                               "dPorousFlow_porepressure_nodal_dvar")
      33             :                                         : getMaterialProperty<std::vector<std::vector<Real>>>(
      34         519 :                                               "dPorousFlow_porepressure_qp_dvar")),
      35         225 :     _saturation(_nodal_material
      36         675 :                     ? getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_nodal")
      37         519 :                     : getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
      38         225 :     _saturation_old(_nodal_material
      39         675 :                         ? getMaterialPropertyOld<std::vector<Real>>("PorousFlow_saturation_nodal")
      40         519 :                         : getMaterialPropertyOld<std::vector<Real>>("PorousFlow_saturation_qp")),
      41         450 :     _dsaturation_dvar(_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
      42         381 :                                             "dPorousFlow_saturation_nodal_dvar")
      43             :                                       : getMaterialProperty<std::vector<std::vector<Real>>>(
      44         519 :                                             "dPorousFlow_saturation_qp_dvar")),
      45         675 :     _pf(_nodal_material ? declareProperty<Real>("PorousFlow_effective_fluid_pressure_nodal")
      46         519 :                         : declareProperty<Real>("PorousFlow_effective_fluid_pressure_qp")),
      47             :     _dpf_dvar(
      48         225 :         _nodal_material
      49         675 :             ? declareProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_nodal_dvar")
      50        2319 :             : declareProperty<std::vector<Real>>("dPorousFlow_effective_fluid_pressure_qp_dvar"))
      51             : {
      52         225 : }
      53             : 
      54             : void
      55       24632 : PorousFlowEffectiveFluidPressure::initQpStatefulProperties()
      56             : {
      57       49264 :   _pf[_qp] = 0.0;
      58       74216 :   for (unsigned ph = 0; ph < _num_phases; ++ph)
      59       74376 :     _pf[_qp] += _saturation[_qp][ph] * _porepressure[_qp][ph];
      60       24632 : }
      61             : 
      62             : void
      63     1206158 : PorousFlowEffectiveFluidPressure::computeQpProperties()
      64             : {
      65     2412316 :   _pf[_qp] = 0.0;
      66     2412316 :   _dpf_dvar[_qp].assign(_num_var, 0.0);
      67     3648490 :   for (unsigned ph = 0; ph < _num_phases; ++ph)
      68             :   {
      69     4884664 :     _pf[_qp] += _saturation[_qp][ph] * _porepressure[_qp][ph];
      70    11286018 :     for (unsigned v = 0; v < _num_var; ++v)
      71    20129704 :       _dpf_dvar[_qp][v] += _dsaturation_dvar[_qp][ph][v] * _porepressure[_qp][ph] +
      72    15097278 :                            _saturation[_qp][ph] * _dporepressure_dvar[_qp][ph][v];
      73             :   }
      74     1208657 : }

Generated by: LCOV version 1.11