LCOV - code coverage report
Current view: top level - src/materials - PorousFlowMatrixInternalEnergy.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 28 29 96.6 %
Date: 2017-11-20 10:17:24 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 "PorousFlowMatrixInternalEnergy.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12          24 : validParams<PorousFlowMatrixInternalEnergy>()
      13             : {
      14          24 :   InputParameters params = validParams<PorousFlowMaterialVectorBase>();
      15          72 :   params.addRequiredParam<Real>("specific_heat_capacity",
      16             :                                 "Specific heat capacity of the rock grains (J/kg/K).  Internal "
      17             :                                 "energy = specific_heat_capacity * density * temperature, and this "
      18             :                                 "is multiplied by (1 - porosity) to find the energy density of the "
      19          24 :                                 "rock in a rock-fluid system.");
      20          72 :   params.addRequiredParam<Real>("density", "Density of the rock grains");
      21          48 :   params.set<bool>("at_nodes") = true;
      22          48 :   params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity by "
      23             :                              "using a weighted sum.  Thermal conductivity = "
      24             :                              "dry_thermal_conductivity + S^exponent * (wet_thermal_conductivity - "
      25          24 :                              "dry_thermal_conductivity), where S is the aqueous saturation");
      26          24 :   return params;
      27             : }
      28             : 
      29          72 : PorousFlowMatrixInternalEnergy::PorousFlowMatrixInternalEnergy(const InputParameters & parameters)
      30             :   : PorousFlowMaterialVectorBase(parameters),
      31         216 :     _cp(getParam<Real>("specific_heat_capacity")),
      32         216 :     _density(getParam<Real>("density")),
      33          72 :     _heat_cap(_cp * _density),
      34         144 :     _temperature_nodal(getMaterialProperty<Real>("PorousFlow_temperature_nodal")),
      35             :     _dtemperature_nodal_dvar(
      36         144 :         getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")),
      37         144 :     _en_nodal(declareProperty<Real>("PorousFlow_matrix_internal_energy_nodal")),
      38             :     _den_nodal_dvar(
      39         648 :         declareProperty<std::vector<Real>>("dPorousFlow_matrix_internal_energy_nodal_dvar"))
      40             : {
      41          72 :   if (_nodal_material != true)
      42           0 :     mooseError("PorousFlowMatrixInternalEnergy classes are only defined for at_nodes = true");
      43          72 : }
      44             : 
      45             : void
      46         780 : PorousFlowMatrixInternalEnergy::initQpStatefulProperties()
      47             : {
      48        2340 :   _en_nodal[_qp] = _heat_cap * _temperature_nodal[_qp];
      49         780 : }
      50             : 
      51             : void
      52       71752 : PorousFlowMatrixInternalEnergy::computeQpProperties()
      53             : {
      54      215256 :   _en_nodal[_qp] = _heat_cap * _temperature_nodal[_qp];
      55             : 
      56      143504 :   _den_nodal_dvar[_qp].assign(_num_var, 0.0);
      57      494764 :   for (unsigned v = 0; v < _num_var; ++v)
      58      634518 :     _den_nodal_dvar[_qp][v] = _heat_cap * _dtemperature_nodal_dvar[_qp][v];
      59       74251 : }

Generated by: LCOV version 1.11