https://mooseframework.inl.gov
PorousFlowCapillaryPressure.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 
13 
35 {
36 public:
38 
40 
41  virtual void initialize() final{};
42  virtual void initialSetup() override;
43 
52  virtual Real capillaryPressure(Real saturation, unsigned qp = 0) const;
53  virtual ADReal capillaryPressure(const ADReal & saturation, unsigned qp = 0) const;
54 
62  virtual Real dCapillaryPressure(Real saturation, unsigned qp = 0) const;
63  virtual ADReal dCapillaryPressure(const ADReal & saturation, unsigned qp = 0) const;
64 
72  virtual Real d2CapillaryPressure(Real saturation, unsigned qp = 0) const;
73 
81  virtual Real effectiveSaturation(Real pc, unsigned qp = 0) const = 0;
82 
90  virtual Real dEffectiveSaturation(Real pc, unsigned qp = 0) const = 0;
91 
99  virtual Real d2EffectiveSaturation(Real pc, unsigned qp = 0) const = 0;
100 
108  Real saturation(Real pc, unsigned qp = 0) const;
109  ADReal saturation(const ADReal & pc, unsigned qp = 0) const;
110 
118  Real dSaturation(Real pc, unsigned qp = 0) const;
119  ADReal dSaturation(const ADReal & pc, unsigned int qp = 0) const;
120 
128  Real d2Saturation(Real pc, unsigned qp = 0) const;
129 
130 protected:
140 
149  Real extensionSaturation() const;
150 
160  Real interceptFunction(Real s) const;
161 
171  Real interceptFunctionDeriv(Real s) const;
172 
181  Real capillaryPressureLogExt(Real s) const;
182 
191  Real dCapillaryPressureLogExt(Real s) const;
192 
201  Real d2CapillaryPressureLogExt(Real s) const;
202 
208  virtual Real capillaryPressureCurve(Real saturation, unsigned qp = 0) const = 0;
209 
215  virtual Real dCapillaryPressureCurve(Real saturation, unsigned qp = 0) const = 0;
216 
222  virtual Real d2CapillaryPressureCurve(Real saturation, unsigned qp = 0) const = 0;
223 
225  const Real _sat_lr;
229  bool _log_ext;
231  const Real _pc_max;
232 
249  const Real _log10;
250 };
virtual Real dCapillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Derivative of raw capillary pressure wrt true saturation.
virtual Real effectiveSaturation(Real pc, unsigned qp=0) const =0
Effective saturation as a function of capillary pressure.
virtual Real d2EffectiveSaturation(Real pc, unsigned qp=0) const =0
Second derivative of effective saturation wrt capillary pressure.
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.
DualNumber< Real, DNDerivativeType, true > ADReal
virtual Real capillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Raw capillary pressure curve (does not include logarithmic extension)
Base class for capillary pressure for multiphase flow in porous media.
Real _slope_ext
Gradient of the logarithmic extension This is computed only for qp=0.
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
Real interceptFunctionDeriv(Real s) const
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation...
Real extensionSaturation() const
Calculates the saturation where the logarithmic extension to capillary pressure meets the raw curve u...
virtual Real capillaryPressure(Real saturation, unsigned qp=0) const
Capillary pressure is calculated as a function of true saturation.
Real dSaturation(Real pc, unsigned qp=0) const
Derivative of saturation wrt capillary pressure.
Real d2CapillaryPressureLogExt(Real s) const
The second derivative of capillary pressure in the logarithmic extension This implementation assumes ...
PorousFlowCapillaryPressure(const InputParameters &parameters)
Real _pc_ext
Capillary pressure where the extension meets the raw curve.
virtual Real d2CapillaryPressure(Real saturation, unsigned qp=0) const
Second derivative of capillary pressure wrt true saturation.
virtual Real d2CapillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Second derivative of raw capillary pressure wrt true saturation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real interceptFunction(Real s) const
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation...
Real capillaryPressureLogExt(Real s) const
The capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is...
virtual Real dCapillaryPressure(Real saturation, unsigned qp=0) const
Derivative of capillary pressure wrt true saturation.
Real _sat_ext
Saturation where the logarithmic extension meets the raw curve This is computed only for qp=0...
const Real _sat_lr
Liquid residual saturation.
const InputParameters & parameters() const
bool _log_ext
Flag to use a logarithmic extension for low saturation.
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
Real d2Saturation(Real pc, unsigned qp=0) const
Second derivative of saturation wrt capillary pressure.
Real dCapillaryPressureLogExt(Real s) const
The derivative of capillary pressure in the logarithmic extension This implementation assumes capilla...
virtual Real dEffectiveSaturation(Real pc, unsigned qp=0) const =0
Derivative of effective saturation wrt capillary pressure.