www.mooseframework.org
PorousFlowCapillaryPressureVG.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 #include "PorousFlowVanGenuchten.h"
12 
14 
17 {
20  "m",
21  "m >= 0 & m <= 1",
22  "van Genuchten exponent m. Must be between 0 and 1, and optimally should be set to >0.5");
24  "alpha", "alpha > 0", "van Genuchten parameter alpha. Must be positive");
25  params.addRangeCheckedParam<Real>("s_scale",
26  1.0,
27  "s_scale > 0.0 & s_scale <= 1.0",
28  "CapillaryPressure = f(Seff * s_scale) - "
29  "f(s_scale), where f is the van Genuchten "
30  "expression. Setting s_scale<1 is unusual "
31  "but sometimes helps fully saturated, "
32  "2-phase PP simulations converge as the "
33  "zero derivative (1/f'(S=1)=0) is removed");
34  params.addClassDescription("van Genuchten capillary pressure");
35  return params;
36 }
37 
39  : PorousFlowCapillaryPressure(parameters),
40  _m(getParam<Real>("m")),
41  _alpha(getParam<Real>("alpha")),
42  _s_scale(getParam<Real>("s_scale")),
43  _pc_sscale(PorousFlowVanGenuchten::capillaryPressure(_s_scale, _alpha, _m, _pc_max))
44 {
45 }
46 
47 Real
48 PorousFlowCapillaryPressureVG::capillaryPressureCurve(Real saturation, unsigned /*qp*/) const
49 {
52 }
53 
54 Real
55 PorousFlowCapillaryPressureVG::dCapillaryPressureCurve(Real saturation, unsigned /*qp*/) const
56 {
59  _s_scale;
60 }
61 
62 Real
63 PorousFlowCapillaryPressureVG::d2CapillaryPressureCurve(Real saturation, unsigned /*qp*/) const
64 {
68 }
69 
70 Real
72 {
73  return (1.0 / _s_scale) *
75 }
76 
77 Real
79 {
80  return (1.0 / _s_scale) *
82 }
83 
84 Real
86 {
87  return (1.0 / _s_scale) *
89 }
Real capillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Capillary pressure as a function of effective saturation.
const Real _m
van Genuchten exponent m
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
virtual Real d2EffectiveSaturation(Real pc, unsigned qp=0) const override
Second derivative of effective saturation wrt capillary pressure.
registerMooseObject("PorousFlowApp", PorousFlowCapillaryPressureVG)
static InputParameters validParams()
Real effectiveSaturationFromSaturation(Real saturation) const
Effective saturation of liquid phase given liquid saturation and residual liquid saturation.
Real saturation(Real pc, unsigned qp=0) const
Saturation as a function of capillary pressure.
virtual Real dCapillaryPressureCurve(Real saturation, unsigned qp=0) const override
Derivative of raw capillary pressure wrt true saturation.
van Genuchten effective saturation, capillary pressure and relative permeability functions.
Base class for capillary pressure for multiphase flow in porous media.
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
virtual Real effectiveSaturation(Real pc, unsigned qp=0) const override
Effective saturation as a function of capillary pressure.
Real d2CapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Second derivative of capillary pressure wrt effective saturation.
virtual Real d2CapillaryPressureCurve(Real saturation, unsigned qp=0) const override
Second derivative of raw capillary pressure wrt true saturation.
const Real _alpha
van Genuchten capillary coefficient alpha
Real effectiveSaturation(Real p, Real alpha, Real m)
Effective saturation as a function of porepressure.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _s_scale
Capillary pressure = f(Seff * s_scale) - pc_sscale, where f is the van Genuchten function. For almost all simulations s_scale=1 will be appropriate.
Real dCapillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Derivative of capillary pressure wrt effective saturation.
void addClassDescription(const std::string &doc_string)
Real d2EffectiveSaturation(Real p, Real alpha, Real m)
Second derivative of effective saturation wrt porepressure.
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
const Real _pc_sscale
pc_sscale = f(s_scale), where f is the van Genuchten function
PorousFlowCapillaryPressureVG(const InputParameters &parameters)
Real dEffectiveSaturation(Real p, Real alpha, Real m)
Derivative of effective saturation wrt porepressure.
van Genuchten form of capillary pressure.
Real capillaryPressure(Real seff, Real alpha, Real m, Real pc_max)
Capillary pressure as a function of effective saturation.
virtual Real dEffectiveSaturation(Real pc, unsigned qp=0) const override
Derivative of effective saturation wrt capillary pressure.
virtual Real capillaryPressureCurve(Real saturation, unsigned qp=0) const override
Raw capillary pressure curve (does not include logarithmic extension)