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
31{
40Real effectiveSaturation(Real p, Real alpha, Real m);
41
49Real dEffectiveSaturation(Real p, Real alpha, Real m);
50
58Real d2EffectiveSaturation(Real p, Real alpha, Real m);
59
69Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
70
80Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
81
91Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max);
92
99template <typename T>
100T
101relativePermeability(const T & seff, Real m)
102{
103 if (MetaPhysicL::raw_value(seff) <= 0.0)
104 return 0.0;
105 else if (MetaPhysicL::raw_value(seff) >= 1.0)
106 return 1.0;
107
108 using std::pow, std::sqrt;
109
110 const T a = 1.0 - pow(seff, 1.0 / m);
111 const T b = 1.0 - pow(a, m);
112
113 return sqrt(seff) * Utility::pow<2>(b);
114}
115
122Real dRelativePermeability(Real seff, Real m);
123
130Real d2RelativePermeability(Real seff, Real m);
131
138template <typename T>
139T
140relativePermeabilityNW(const T & seff, Real m)
141{
142 if (MetaPhysicL::raw_value(seff) <= 0.0)
143 return 0.0;
144 else if (MetaPhysicL::raw_value(seff) >= 1.0)
145 return 1.0;
146
147 using std::pow, std::sqrt;
148
149 const T a = pow(1.0 - seff, 1.0 / m);
150 const T b = pow(1.0 - a, 2.0 * m);
151
152 return sqrt(seff) * b;
153}
154
161Real dRelativePermeabilityNW(Real seff, Real m);
162
170Real d2RelativePermeabilityNW(Real seff, Real m);
171
181{
189 Real S;
190 Real Pc;
191 Real dPc;
192
195 S(0.0),
196 Pc(std::numeric_limits<Real>::max()),
197 dPc(std::numeric_limits<Real>::lowest())
198 {
199 }
200
202 : strategy(strategy), S(S), Pc(Pc), dPc(dPc)
203 {
204 }
205};
206
216{
223 Real S;
224 Real Pc;
225 Real dPc;
226
229 S(1.0),
230 Pc(0.0),
231 dPc(std::numeric_limits<Real>::lowest())
232 {
233 }
234
236 : strategy(strategy), S(S), Pc(Pc), dPc(dPc)
237 {
238 }
239};
240
258 Real sl,
259 Real slmin,
260 Real sgrdel,
261 Real alpha,
262 Real n,
263 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
264 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
265
282 Real sl,
283 Real slmin,
284 Real sgrdel,
285 Real alpha,
286 Real n,
287 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
288 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
289
305 Real sl,
306 Real slmin,
307 Real sgrdel,
308 Real alpha,
309 Real n,
310 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
311 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
312
327Real
328saturationHys(Real pc,
329 Real slmin,
330 Real sgrdel,
331 Real alpha,
332 Real n,
333 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
334 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
335
349Real
350dsaturationHys(Real pc,
351 Real slmin,
352 Real sgrdel,
353 Real alpha,
354 Real n,
355 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
356 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
357
371Real
372d2saturationHys(Real pc,
373 Real slmin,
374 Real sgrdel,
375 Real alpha,
376 Real n,
377 const LowCapillaryPressureExtension & low_ext = LowCapillaryPressureExtension(),
378 const HighCapillaryPressureExtension & high_ext = HighCapillaryPressureExtension());
379
402Real relativePermeabilityHys(Real sl,
403 Real slr,
404 Real sgrdel,
405 Real sgrmax,
406 Real sldel,
407 Real m,
408 Real upper_liquid_param,
409 Real y0,
410 Real y0p,
411 Real y1,
412 Real y1p);
413
436Real drelativePermeabilityHys(Real sl,
437 Real slr,
438 Real sgrdel,
439 Real sgrmax,
440 Real sldel,
441 Real m,
442 Real upper_liquid_param,
443 Real y0,
444 Real y0p,
445 Real y1,
446 Real y1p);
447
467Real relativePermeabilityNWHys(Real sl,
468 Real slr,
469 Real sgrdel,
470 Real sgrmax,
471 Real sldel,
472 Real m,
473 Real gamma,
474 Real k_rg_max,
475 Real y0p);
476
496Real drelativePermeabilityNWHys(Real sl,
497 Real slr,
498 Real sgrdel,
499 Real sgrmax,
500 Real sldel,
501 Real m,
502 Real gamma,
503 Real k_rg_max,
504 Real y0p);
505}
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.
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.
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)