LCOV - code coverage report
Current view: top level - src/userobjects - RichardsSeff2gasVG.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 24 25 96.0 %
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             : //  van-Genuchten gas effective saturation as a function of (Pwater, Pgas), and its derivs wrt to
      11             : //  that pressure
      12             : //
      13             : #include "RichardsSeff2gasVG.h"
      14             : 
      15             : registerMooseObject("RichardsApp", RichardsSeff2gasVG);
      16             : 
      17             : InputParameters
      18         188 : RichardsSeff2gasVG::validParams()
      19             : {
      20         188 :   InputParameters params = RichardsSeff::validParams();
      21         376 :   params.addRequiredRangeCheckedParam<Real>("al",
      22             :                                             "al > 0",
      23             :                                             "van-Genuchten alpha parameter.  Must "
      24             :                                             "be positive.  Single-phase VG seff = "
      25             :                                             "(1 + (-al*c)^(1/(1-m)))^(-m)");
      26         376 :   params.addRequiredRangeCheckedParam<Real>(
      27             :       "m",
      28             :       "m > 0 & m < 1",
      29             :       "van-Genuchten m parameter.  Must be between 0 and 1, and optimally "
      30             :       "should be set to >0.5   Single-phase VG seff = (1 + "
      31             :       "(-al*p)^(1/(1-m)))^(-m)");
      32         188 :   params.addClassDescription("van-Genuchten effective saturation as a function of (Pwater, Pgas) "
      33             :                              "suitable for use for the gas phase in two-phase simulations.  With "
      34             :                              "Pc=Pgas-Pwater,   seff = 1 - (1 + (al*pc)^(1/(1-m)))^(-m)");
      35         188 :   return params;
      36           0 : }
      37             : 
      38          94 : RichardsSeff2gasVG::RichardsSeff2gasVG(const InputParameters & parameters)
      39         282 :   : RichardsSeff(parameters), _al(getParam<Real>("al")), _m(getParam<Real>("m"))
      40             : {
      41          94 : }
      42             : 
      43             : Real
      44     1628525 : RichardsSeff2gasVG::seff(std::vector<const VariableValue *> p, unsigned int qp) const
      45             : {
      46     1628525 :   Real negpc = (*p[0])[qp] - (*p[1])[qp];
      47     1628525 :   return 1 - RichardsSeffVG::seff(negpc, _al, _m);
      48             : }
      49             : 
      50             : void
      51      816691 : RichardsSeff2gasVG::dseff(std::vector<const VariableValue *> p,
      52             :                           unsigned int qp,
      53             :                           std::vector<Real> & result) const
      54             : {
      55      816691 :   Real negpc = (*p[0])[qp] - (*p[1])[qp];
      56      816691 :   result[0] = -RichardsSeffVG::dseff(negpc, _al, _m);
      57      816691 :   result[1] = -result[0];
      58      816691 : }
      59             : 
      60             : void
      61      402099 : RichardsSeff2gasVG::d2seff(std::vector<const VariableValue *> p,
      62             :                            unsigned int qp,
      63             :                            std::vector<std::vector<Real>> & result) const
      64             : {
      65      402099 :   Real negpc = (*p[0])[qp] - (*p[1])[qp];
      66      402099 :   result[0][0] = -RichardsSeffVG::d2seff(negpc, _al, _m);
      67      402099 :   result[0][1] = -result[0][0];
      68      402099 :   result[1][0] = -result[0][0];
      69      402099 :   result[1][1] = result[0][0];
      70      402099 : }

Generated by: LCOV version 1.14