https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowVanGenuchten.h
Go to the documentation of this file.
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#pragma once
11
12#include "MooseTypes.h"
13#include "libmesh/utility.h"
14
15#include <iosfwd>
16
33{
42Real effectiveSaturation(Real p, Real alpha, Real m);
43
51Real dEffectiveSaturation(Real p, Real alpha, Real m);
52
60Real d2EffectiveSaturation(Real p, Real alpha, Real m);
61
71Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
72
82Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
83
93Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
94
101template <typename T>
102T
103relativePermeability(const T & seff, Real m)
104{
105 if (MetaPhysicL::raw_value(seff) <= 0.0)
106 return 0.0;
107 else if (MetaPhysicL::raw_value(seff) >= 1.0)
108 return 1.0;
109
110 using std::pow, std::sqrt;
111
112 const T a = 1.0 - pow(seff, 1.0 / m);
113 const T b = 1.0 - pow(a, m);
114
115 return sqrt(seff) * Utility::pow<2>(b);
116}
117
124Real dRelativePermeability(Real seff, Real m);
125
132Real d2RelativePermeability(Real seff, Real m);
133
140template <typename T>
141T
142relativePermeabilityNW(const T & seff, Real m)
143{
144 if (MetaPhysicL::raw_value(seff) <= 0.0)
145 return 0.0;
146 else if (MetaPhysicL::raw_value(seff) >= 1.0)
147 return 1.0;
148
149 using std::pow, std::sqrt;
150
151 const T a = pow(1.0 - seff, 1.0 / m);
152 const T b = pow(1.0 - a, 2.0 * m);
153
154 return sqrt(seff) * b;
155}
156
163Real dRelativePermeabilityNW(Real seff, Real m);
164
172Real d2RelativePermeabilityNW(Real seff, Real m);
173
183{
191 Real S;
192 Real Pc;
193 Real dPc;
194
197 S(0.0),
198 Pc(std::numeric_limits<Real>::max()),
199 dPc(std::numeric_limits<Real>::lowest())
200 {
201 }
202
204 : strategy(strategy), S(S), Pc(Pc), dPc(dPc)
205 {
206 }
207};
208
218{
225 Real S;
226 Real Pc;
227 Real dPc;
228
231 S(1.0),
232 Pc(0.0),
233 dPc(std::numeric_limits<Real>::lowest())
234 {
235 }
236
238 : strategy(strategy), S(S), Pc(Pc), dPc(dPc)
239 {
240 }
241};
242
243void dataStore(std::ostream & stream, LowCapillaryPressureExtension & extension, void * context);
244void dataLoad(std::istream & stream, LowCapillaryPressureExtension & extension, void * context);
245void dataStore(std::ostream & stream, HighCapillaryPressureExtension & extension, void * context);
246void dataLoad(std::istream & stream, HighCapillaryPressureExtension & extension, void * context);
247
265 Real sl,
266 Real slmin,
267 Real sgrdel,
268 Real alpha,
269 Real n,
270 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
271 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
272
289 Real sl,
290 Real slmin,
291 Real sgrdel,
292 Real alpha,
293 Real n,
294 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
295 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
296
312 Real sl,
313 Real slmin,
314 Real sgrdel,
315 Real alpha,
316 Real n,
317 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
318 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
319
334Real
335saturationHys(Real pc,
336 Real slmin,
337 Real sgrdel,
338 Real alpha,
339 Real n,
340 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
341 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
342
356Real
357dsaturationHys(Real pc,
358 Real slmin,
359 Real sgrdel,
360 Real alpha,
361 Real n,
362 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
363 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
364
378Real
379d2saturationHys(Real pc,
380 Real slmin,
381 Real sgrdel,
382 Real alpha,
383 Real n,
384 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
385 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
386
409Real relativePermeabilityHys(Real sl,
410 Real slr,
411 Real sgrdel,
412 Real sgrmax,
413 Real sldel,
414 Real m,
415 Real upper_liquid_param,
416 Real y0,
417 Real y0p,
418 Real y1,
419 Real y1p);
420
443Real drelativePermeabilityHys(Real sl,
444 Real slr,
445 Real sgrdel,
446 Real sgrmax,
447 Real sldel,
448 Real m,
449 Real upper_liquid_param,
450 Real y0,
451 Real y0p,
452 Real y1,
453 Real y1p);
454
474Real relativePermeabilityNWHys(Real sl,
475 Real slr,
476 Real sgrdel,
477 Real sgrmax,
478 Real sldel,
479 Real m,
480 Real gamma,
481 Real k_rg_max,
482 Real y0p);
483
503Real drelativePermeabilityNWHys(Real sl,
504 Real slr,
505 Real sgrdel,
506 Real sgrmax,
507 Real sldel,
508 Real m,
509 Real gamma,
510 Real k_rg_max,
511 Real y0p);
512}
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const Real p
const double T
auto raw_value(const Eigen::Map< T > &in)
van Genuchten effective saturation, capillary pressure and relative permeability functions.
Real d2saturationHys(Real pc, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Second derivative of Hysteretic saturation function with respect to pc.
void dataLoad(std::istream &stream, LowCapillaryPressureExtension &extension, void *context)
T relativePermeabilityNW(const T &seff, Real m)
Relative permeability for a non-wetting phase as a function of effective saturation.
Real d2capillaryPressureHys(Real sl, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Second derivative of capillaryPressureHys with respect to sl.
Real drelativePermeabilityNWHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real gamma, Real k_rg_max, Real y0p)
Derivative of hysteretic relative permeability for gas with respect to the liquid saturation.
Real dRelativePermeability(Real seff, Real m)
Derivative of relative permeability with respect to effective saturation.
void dataStore(std::ostream &stream, LowCapillaryPressureExtension &extension, void *context)
T relativePermeability(const T &seff, Real m)
Relative permeability as a function of effective saturation.
Real saturationHys(Real pc, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Hysteretic saturation function (Eqn(1) of Doughty2007) with extensions (page5 and Fig1 of Doughty2008...
Real relativePermeabilityNWHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real gamma, Real k_rg_max, Real y0p)
Hysteretic relative permeability for gas.
Real d2EffectiveSaturation(Real p, Real alpha, Real m)
Second derivative of effective saturation wrt porepressure.
Real dEffectiveSaturation(Real p, Real alpha, Real m)
Derivative of effective saturation wrt porepressure.
Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Derivative of capillary pressure wrt effective saturation.
Real capillaryPressureHys(Real sl, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Hysteretic capillary pressure function (Eqn(1) of Doughty2007) with extensions (page5 and Fig1 of Dou...
Real drelativePermeabilityHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real upper_liquid_param, Real y0, Real y0p, Real y1, Real y1p)
Derivative of Hysteretic relative permeability for liquid, with respect to liquid saturation.
Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Capillary pressure as a function of effective saturation.
Real dcapillaryPressureHys(Real sl, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Derivative of capillaryPressureHys with respect to sl.
Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Second derivative of capillary pressure wrt effective saturation.
Real effectiveSaturation(Real p, Real alpha, Real m)
Effective saturation as a function of porepressure.
Real relativePermeabilityHys(Real sl, Real slr, Real sgrdel, Real sgrmax, Real sldel, Real m, Real upper_liquid_param, Real y0, Real y0p, Real y1, Real y1p)
Hysteretic relative permeability for liquid.
Real d2RelativePermeabilityNW(Real seff, Real m)
Second derivative of relative permeability for a non-wetting phase with respect to effective saturati...
Real dsaturationHys(Real pc, Real slmin, Real sgrdel, Real alpha, Real n, const LowCapillaryPressureExtension &low_ext=LowCapillaryPressureExtension(), const HighCapillaryPressureExtension &high_ext=HighCapillaryPressureExtension())
Derivative of Hysteretic saturation function with respect to pc.
Real d2RelativePermeability(Real seff, Real m)
Second derivative of relative permeability with respect to effective saturation.
Real dRelativePermeabilityNW(Real seff, Real m)
Derivative of relative permeability for a non-wetting phase with respect to effective saturation.
Parameters associated with the extension of the hysteretic wetting capillary pressure function to hig...
HighCapillaryPressureExtension(const ExtensionStrategy &strategy, Real S, Real Pc, Real dPc)
Parameters associated with the extension of the hysteretic capillary pressure function to low saturat...
LowCapillaryPressureExtension(const ExtensionStrategy &strategy, Real S, Real Pc, Real dPc)