www.mooseframework.org
PorousFlowCapillaryPressure.h
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 
10 #pragma once
11 
12 #include "DiscreteElementUserObject.h"
13 
15 
16 template <>
18 
39 class PorousFlowCapillaryPressure : public DiscreteElementUserObject
40 {
41 public:
42  PorousFlowCapillaryPressure(const InputParameters & parameters);
43 
44  virtual void initialize() final{};
45  virtual void initialSetup() override;
46 
55  virtual Real capillaryPressure(Real saturation, unsigned qp = 0) const;
56 
64  virtual Real dCapillaryPressure(Real saturation, unsigned qp = 0) const;
65 
73  virtual Real d2CapillaryPressure(Real saturation, unsigned qp = 0) const;
74  virtual DualReal capillaryPressure(DualReal saturation, unsigned qp = 0) const;
75 
83  virtual Real effectiveSaturation(Real pc, unsigned qp = 0) const = 0;
84 
92  virtual Real dEffectiveSaturation(Real pc, unsigned qp = 0) const = 0;
93 
101  virtual Real d2EffectiveSaturation(Real pc, unsigned qp = 0) const = 0;
102 
110  Real saturation(Real pc, unsigned qp = 0) const;
111 
119  Real dSaturation(Real pc, unsigned 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;
227  const Real _dseff_ds;
229  bool _log_ext;
231  const Real _pc_max;
232 
237  Real _sat_ext;
242  Real _pc_ext;
249  const Real _log10;
250 };
251 
PorousFlowCapillaryPressure::dSaturation
Real dSaturation(Real pc, unsigned qp=0) const
Derivative of saturation wrt capillary pressure.
Definition: PorousFlowCapillaryPressure.C:103
PorousFlowCapillaryPressure::PorousFlowCapillaryPressure
PorousFlowCapillaryPressure(const InputParameters &parameters)
Definition: PorousFlowCapillaryPressure.C:37
PorousFlowCapillaryPressure::capillaryPressureCurve
virtual Real capillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Raw capillary pressure curve (does not include logarithmic extension)
PorousFlowCapillaryPressure::d2CapillaryPressureLogExt
Real d2CapillaryPressureLogExt(Real s) const
The second derivative of capillary pressure in the logarithmic extension This implementation assumes ...
Definition: PorousFlowCapillaryPressure.C:127
PorousFlowCapillaryPressure::d2EffectiveSaturation
virtual Real d2EffectiveSaturation(Real pc, unsigned qp=0) const =0
Second derivative of effective saturation wrt capillary pressure.
PorousFlowCapillaryPressure::_slope_ext
Real _slope_ext
Gradient of the logarithmic extension This is computed only for qp=0.
Definition: PorousFlowCapillaryPressure.h:247
PorousFlowCapillaryPressure::_log10
const Real _log10
log(10)
Definition: PorousFlowCapillaryPressure.h:249
PorousFlowCapillaryPressure::interceptFunction
Real interceptFunction(Real s) const
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation.
Definition: PorousFlowCapillaryPressure.C:158
PorousFlowCapillaryPressure
Base class for capillary pressure for multiphase flow in porous media.
Definition: PorousFlowCapillaryPressure.h:39
PorousFlowCapillaryPressure::_sat_ext
Real _sat_ext
Saturation where the logarithmic extension meets the raw curve This is computed only for qp=0.
Definition: PorousFlowCapillaryPressure.h:237
PorousFlowCapillaryPressure::d2CapillaryPressureCurve
virtual Real d2CapillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Second derivative of raw capillary pressure wrt true saturation.
PorousFlowCapillaryPressure::initialize
virtual void initialize() final
Definition: PorousFlowCapillaryPressure.h:44
PorousFlowCapillaryPressure::effectiveSaturationFromSaturation
Real effectiveSaturationFromSaturation(Real saturation) const
Effective saturation of liquid phase given liquid saturation and residual liquid saturation.
Definition: PorousFlowCapillaryPressure.C:91
PorousFlowCapillaryPressure::_pc_ext
Real _pc_ext
Capillary pressure where the extension meets the raw curve.
Definition: PorousFlowCapillaryPressure.h:242
PorousFlowCapillaryPressure::dCapillaryPressureLogExt
Real dCapillaryPressureLogExt(Real s) const
The derivative of capillary pressure in the logarithmic extension This implementation assumes capilla...
Definition: PorousFlowCapillaryPressure.C:121
PorousFlowCapillaryPressure::effectiveSaturation
virtual Real effectiveSaturation(Real pc, unsigned qp=0) const =0
Effective saturation as a function of capillary pressure.
PorousFlowCapillaryPressure::dEffectiveSaturation
virtual Real dEffectiveSaturation(Real pc, unsigned qp=0) const =0
Derivative of effective saturation wrt capillary pressure.
PorousFlowCapillaryPressure::capillaryPressure
virtual Real capillaryPressure(Real saturation, unsigned qp=0) const
Capillary pressure is calculated as a function of true saturation.
Definition: PorousFlowCapillaryPressure.C:64
PorousFlowCapillaryPressure::dCapillaryPressure
virtual Real dCapillaryPressure(Real saturation, unsigned qp=0) const
Derivative of capillary pressure wrt true saturation.
Definition: PorousFlowCapillaryPressure.C:73
PorousFlowCapillaryPressure::_sat_lr
const Real _sat_lr
Liquid residual saturation.
Definition: PorousFlowCapillaryPressure.h:225
PorousFlowCapillaryPressure::_pc_max
const Real _pc_max
Maximum capillary pressure (Pa). Note: must be <= 0.
Definition: PorousFlowCapillaryPressure.h:231
PorousFlowCapillaryPressure::interceptFunctionDeriv
Real interceptFunctionDeriv(Real s) const
Calculates the saturation where the logarithmic extension to capillary pressure at low saturation.
Definition: PorousFlowCapillaryPressure.C:167
PorousFlowCapillaryPressure::d2Saturation
Real d2Saturation(Real pc, unsigned qp=0) const
Second derivative of saturation wrt capillary pressure.
Definition: PorousFlowCapillaryPressure.C:109
validParams< PorousFlowCapillaryPressure >
InputParameters validParams< PorousFlowCapillaryPressure >()
Definition: PorousFlowCapillaryPressure.C:14
PorousFlowCapillaryPressure::extensionSaturation
Real extensionSaturation() const
Calculates the saturation where the logarithmic extension to capillary pressure meets the raw curve u...
Definition: PorousFlowCapillaryPressure.C:134
PorousFlowCapillaryPressure::d2CapillaryPressure
virtual Real d2CapillaryPressure(Real saturation, unsigned qp=0) const
Second derivative of capillary pressure wrt true saturation.
Definition: PorousFlowCapillaryPressure.C:82
PorousFlowCapillaryPressure::capillaryPressureLogExt
Real capillaryPressureLogExt(Real s) const
The capillary pressure in the logarithmic extension This implementation assumes capillary-pressure is...
Definition: PorousFlowCapillaryPressure.C:115
PorousFlowCapillaryPressure::_log_ext
bool _log_ext
Flag to use a logarithmic extension for low saturation.
Definition: PorousFlowCapillaryPressure.h:229
PorousFlowCapillaryPressure::initialSetup
virtual void initialSetup() override
Definition: PorousFlowCapillaryPressure.C:51
PorousFlowCapillaryPressure::saturation
Real saturation(Real pc, unsigned qp=0) const
Saturation as a function of capillary pressure.
Definition: PorousFlowCapillaryPressure.C:97
PorousFlowCapillaryPressure::_dseff_ds
const Real _dseff_ds
Derivative of effective saturation with respect to saturation.
Definition: PorousFlowCapillaryPressure.h:227
PorousFlowCapillaryPressure::dCapillaryPressureCurve
virtual Real dCapillaryPressureCurve(Real saturation, unsigned qp=0) const =0
Derivative of raw capillary pressure wrt true saturation.