LCOV - code coverage report
Current view: top level - src/userobjects - RichardsDensityConstBulk.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 15 16 93.8 %
Date: 2025-09-04 07:56:35 Functions: 5 5 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             : //  Fluid density assuming constant bulk modulus
      11             : //
      12             : #include "RichardsDensityConstBulk.h"
      13             : 
      14             : registerMooseObject("RichardsApp", RichardsDensityConstBulk);
      15             : 
      16             : InputParameters
      17         890 : RichardsDensityConstBulk::validParams()
      18             : {
      19         890 :   InputParameters params = RichardsDensity::validParams();
      20        1780 :   params.addRequiredParam<Real>("dens0", "Reference density of fluid.  Eg 1000");
      21        1780 :   params.addRequiredParam<Real>("bulk_mod", "Bulk modulus of fluid.  Eg 2E9");
      22         890 :   params.addClassDescription(
      23             :       "Fluid density assuming constant bulk modulus.  dens0 * Exp(pressure/bulk)");
      24         890 :   return params;
      25           0 : }
      26             : 
      27         442 : RichardsDensityConstBulk::RichardsDensityConstBulk(const InputParameters & parameters)
      28        1326 :   : RichardsDensity(parameters), _dens0(getParam<Real>("dens0")), _bulk(getParam<Real>("bulk_mod"))
      29             : {
      30         442 : }
      31             : 
      32             : Real
      33    55883336 : RichardsDensityConstBulk::density(Real p) const
      34             : {
      35    55883336 :   return _dens0 * std::exp(p / _bulk);
      36             : }
      37             : 
      38             : Real
      39    18464556 : RichardsDensityConstBulk::ddensity(Real p) const
      40             : {
      41    18464556 :   return density(p) / _bulk;
      42             : }
      43             : 
      44             : Real
      45     6278624 : RichardsDensityConstBulk::d2density(Real p) const
      46             : {
      47     6278624 :   return density(p) / _bulk / _bulk;
      48             : }

Generated by: LCOV version 1.14