LCOV - code coverage report
Current view: top level - src/materials - PorousFlowConstantThermalExpansionCoefficient.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 31 32 96.9 %
Date: 2025-09-04 07:55:56 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "PorousFlowConstantThermalExpansionCoefficient.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowConstantThermalExpansionCoefficient);
      13             : 
      14             : InputParameters
      15         598 : PorousFlowConstantThermalExpansionCoefficient::validParams()
      16             : {
      17         598 :   InputParameters params = PorousFlowMaterialVectorBase::validParams();
      18        1794 :   params.addRangeCheckedParam<Real>(
      19        1196 :       "biot_coefficient", 1.0, "biot_coefficient>=0 & biot_coefficient<=1", "Biot coefficient");
      20        1794 :   params.addRangeCheckedParam<Real>("fluid_coefficient",
      21        1196 :                                     2.1E-4,
      22             :                                     "fluid_coefficient>=0",
      23             :                                     "Volumetric coefficient of thermal expansion for the fluid");
      24        1196 :   params.addRequiredRangeCheckedParam<Real>(
      25             :       "drained_coefficient",
      26             :       "drained_coefficient>=0.0",
      27             :       "Volumetric coefficient of thermal expansion of the drained porous skeleton (ie the porous "
      28             :       "rock without fluid, or with a fluid that is free to move in and out of the rock)");
      29        1196 :   params.addPrivateParam<std::string>("pf_material_type", "thermal_expansion");
      30         598 :   params.addClassDescription("Computes the effective thermal expansion coefficient, (biot_coeff - "
      31             :                              "porosity) * drained_coefficient + porosity * fluid_coefficient.");
      32         598 :   return params;
      33           0 : }
      34             : 
      35         465 : PorousFlowConstantThermalExpansionCoefficient::PorousFlowConstantThermalExpansionCoefficient(
      36         465 :     const InputParameters & parameters)
      37             :   : PorousFlowMaterialVectorBase(parameters),
      38         465 :     _biot_coefficient(getParam<Real>("biot_coefficient")),
      39         930 :     _fluid_coefficient(getParam<Real>("fluid_coefficient")),
      40         930 :     _drained_coefficient(getParam<Real>("drained_coefficient")),
      41         465 :     _porosity(_nodal_material ? getMaterialProperty<Real>("PorousFlow_porosity_nodal")
      42        1395 :                               : getMaterialProperty<Real>("PorousFlow_porosity_qp")),
      43         930 :     _coeff(_nodal_material
      44         465 :                ? declareProperty<Real>("PorousFlow_constant_thermal_expansion_coefficient_nodal")
      45         930 :                : declareProperty<Real>("PorousFlow_constant_thermal_expansion_coefficient_qp")),
      46         465 :     _coeff_old(_nodal_material ? getMaterialPropertyOld<Real>(
      47             :                                      "PorousFlow_constant_thermal_expansion_coefficient_nodal")
      48        1395 :                                : getMaterialPropertyOld<Real>(
      49         465 :                                      "PorousFlow_constant_thermal_expansion_coefficient_qp"))
      50             : {
      51         465 : }
      52             : 
      53             : void
      54      256574 : PorousFlowConstantThermalExpansionCoefficient::initQpStatefulProperties()
      55             : {
      56      256574 :   _coeff[_qp] = (_biot_coefficient - _porosity[_qp]) * _drained_coefficient +
      57      256574 :                 _porosity[_qp] * _fluid_coefficient;
      58      256574 : }
      59             : 
      60             : void
      61     1914686 : PorousFlowConstantThermalExpansionCoefficient::computeQpProperties()
      62             : {
      63     1914686 :   _coeff[_qp] = _coeff_old[_qp];
      64     1914686 : }

Generated by: LCOV version 1.14