LCOV - code coverage report
Current view: top level - src/userobjects - RichardsSat.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 21 22 95.5 %
Date: 2025-09-04 07:56:35 Functions: 7 7 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             : //  saturation as a function of effective saturation, and its derivs wrt effective saturation
      11             : //
      12             : #include "RichardsSat.h"
      13             : 
      14             : registerMooseObject("RichardsApp", RichardsSat);
      15             : 
      16             : InputParameters
      17         806 : RichardsSat::validParams()
      18             : {
      19         806 :   InputParameters params = GeneralUserObject::validParams();
      20        1612 :   params.addRequiredRangeCheckedParam<Real>(
      21             :       "s_res",
      22             :       "s_res >= 0 & s_res < 1",
      23             :       "Residual fluid saturation for the phase.  0 <= s_res < 1.");
      24        1612 :   params.addRequiredRangeCheckedParam<Real>(
      25             :       "sum_s_res",
      26             :       "sum_s_res < 1",
      27             :       "Sum of s_res over all phases.  s_res <= sum_s_res < 1.  It is "
      28             :       "up to you to ensure the sum is done correctly.");
      29         806 :   params.addClassDescription("User object yielding saturation for a phase as a function of "
      30             :                              "effective saturation of that phase");
      31         806 :   return params;
      32           0 : }
      33             : 
      34         400 : RichardsSat::RichardsSat(const InputParameters & parameters)
      35             :   : GeneralUserObject(parameters),
      36         400 :     _s_res(getParam<Real>("s_res")),
      37        1200 :     _sum_s_res(getParam<Real>("sum_s_res"))
      38             : {
      39         400 :   if (_sum_s_res < _s_res)
      40           1 :     mooseError("sum_s_res set to ", _sum_s_res, " but it must obey s_res <= sum_s_res < 1");
      41         399 : }
      42             : 
      43             : void
      44        5533 : RichardsSat::initialize()
      45             : {
      46        5533 : }
      47             : 
      48             : void
      49        5533 : RichardsSat::execute()
      50             : {
      51        5533 : }
      52             : 
      53             : void
      54        5533 : RichardsSat::finalize()
      55             : {
      56        5533 : }
      57             : 
      58             : Real
      59    28061498 : RichardsSat::sat(Real seff) const
      60             : {
      61    28061498 :   return _s_res + seff * (1.0 - _sum_s_res);
      62             : }
      63             : 
      64     9920276 : Real RichardsSat::dsat(Real /*seff*/) const { return 1.0 - _sum_s_res; }

Generated by: LCOV version 1.14