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 water effective saturation as a function of (Pwater, Pgas), and its derivs wrt to 11 : // that pressure 12 : // 13 : #include "RichardsSeff2waterVG.h" 14 : 15 : registerMooseObject("RichardsApp", RichardsSeff2waterVG); 16 : 17 : InputParameters 18 190 : RichardsSeff2waterVG::validParams() 19 : { 20 190 : InputParameters params = RichardsSeff::validParams(); 21 380 : 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 380 : 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 190 : params.addClassDescription("van-Genuchten effective saturation as a function of (Pwater, Pgas) " 33 : "suitable for use for the water phase in two-phase simulations. With " 34 : "Pc=Pgas-Pwater, seff = (1 + (al*pc)^(1/(1-m)))^(-m)"); 35 190 : return params; 36 0 : } 37 : 38 95 : RichardsSeff2waterVG::RichardsSeff2waterVG(const InputParameters & parameters) 39 285 : : RichardsSeff(parameters), _al(getParam<Real>("al")), _m(getParam<Real>("m")) 40 : { 41 95 : } 42 : 43 : Real 44 1690973 : RichardsSeff2waterVG::seff(std::vector<const VariableValue *> p, unsigned int qp) const 45 : { 46 1690973 : Real negpc = (*p[0])[qp] - (*p[1])[qp]; 47 1690973 : return RichardsSeffVG::seff(negpc, _al, _m); 48 : } 49 : 50 : void 51 812691 : RichardsSeff2waterVG::dseff(std::vector<const VariableValue *> p, 52 : unsigned int qp, 53 : std::vector<Real> & result) const 54 : { 55 812691 : Real negpc = (*p[0])[qp] - (*p[1])[qp]; 56 812691 : result[0] = RichardsSeffVG::dseff(negpc, _al, _m); 57 812691 : result[1] = -result[0]; 58 812691 : } 59 : 60 : void 61 402099 : RichardsSeff2waterVG::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 : }