LCOV - code coverage report
Current view: top level - src/materials - PorousFlowThermalConductivityFromPorosity.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 27 30 90.0 %
Date: 2017-11-21 14:47:27 Functions: 5 5 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 "PorousFlowThermalConductivityFromPorosity.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12           1 : validParams<PorousFlowThermalConductivityFromPorosity>()
      13             : {
      14           1 :   InputParameters params = validParams<PorousFlowMaterialVectorBase>();
      15           3 :   params.addRequiredParam<RealTensorValue>("lambda_s",
      16           1 :                                            "The thermal conductivity of the solid matrix material");
      17           3 :   params.addRequiredParam<RealTensorValue>("lambda_f",
      18           1 :                                            "The thermal conductivity of the single fluid phase");
      19           2 :   params.set<bool>("at_nodes") = false;
      20           2 :   params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity "
      21             :                              "for the single phase, fully saturated case by using a linear "
      22             :                              "weighted average. "
      23             :                              "Thermal conductivity = phi * lambda_f + (1 - phi) * lambda_s, "
      24             :                              "where phi is porosity, and lambda_f, lambda_s are "
      25           1 :                              "thermal conductivities of the fluid and solid (assumed constant)");
      26           1 :   return params;
      27             : }
      28             : 
      29           3 : PorousFlowThermalConductivityFromPorosity::PorousFlowThermalConductivityFromPorosity(
      30           3 :     const InputParameters & parameters)
      31             :   : PorousFlowMaterialVectorBase(parameters),
      32           6 :     _la_s(getParam<RealTensorValue>("lambda_s")),
      33           6 :     _la_f(getParam<RealTensorValue>("lambda_f")),
      34           6 :     _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
      35           6 :     _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
      36           6 :     _la_qp(declareProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
      37             :     _dla_qp_dvar(
      38          24 :         declareProperty<std::vector<RealTensorValue>>("dPorousFlow_thermal_conductivity_qp_dvar"))
      39             : {
      40           3 :   if (_num_phases != 1)
      41             :     mooseError("The Dictator proclaims that the number of phases is ",
      42           0 :                _dictator.numPhases(),
      43             :                " whereas PorousFlowThermalConductivityFromPorosity can only be used for 1-phase "
      44             :                "simulations.  Be aware "
      45           0 :                "that the Dictator has noted your mistake.");
      46           3 :   if (_nodal_material == true)
      47           0 :     mooseError("PorousFlowThermalConductivity classes are only defined for at_nodes = false");
      48           3 : }
      49             : 
      50             : void
      51          32 : PorousFlowThermalConductivityFromPorosity::computeQpProperties()
      52             : {
      53         192 :   _la_qp[_qp] = _la_s * (1.0 - _porosity_qp[_qp]) + _la_f * _porosity_qp[_qp];
      54             : 
      55          64 :   _dla_qp_dvar[_qp].assign(_num_var, RealTensorValue());
      56         160 :   for (unsigned v = 0; v < _num_var; ++v)
      57         256 :     _dla_qp_dvar[_qp][v] = (_la_f - _la_s) * _dporosity_qp_dvar[_qp][v];
      58        2531 : }

Generated by: LCOV version 1.11