# idaholab/moose

Merge pull request #13132 from WilkAndy/sat_not_effsat_13131

PorousFlow uses saturation not effective saturation
permcody committed Mar 28, 2019
2 parents 85f7bd2 + 27cb709 commit 0e86a30c118bcfeb3d783c917d645e53ff7c3155
 @@ -7,7 +7,7 @@ and the porous medium. Capillary pressure, $P_c$, is commonly defined as [citep! P_c = P_{nw} - P_w, \end{equation} where $P_{nw}$ is the pressure of the non-wetting phase (typically the gas phase), and $P_w$ is the pressure of the wetting phase (typically the liquid phase). pressure of the wetting phase (typically the liquid phase). In the case of a single, unsaturated phase, it is common to use $P_{c} = -P_{w}$, which is the convention employed in PorousFlow. In this case, the capillary pressure is only relevant when $P_{w}\leq 0$, and this results in $S_{\mathrm{eff}}\leq 1$ using the formulae below, otherwise, for $P_{w}>0$, $S_{\mathrm{eff}}=1$. The capillary pressure is given by the Young-Laplace equation [citep!bear1972] \begin{equation} @@ -22,9 +22,15 @@ semi-impirical formulations for capillary pressure have been proposed that relat to effective saturation. Several capillary pressure formulations are available in the Porous Flow module suitable for either porepressure formulations (where effective saturation is calculated using capillary pressure), or porepressure formulations (where effective saturation and then saturation is calculated using capillary pressure), or porepressure-saturation formulations (where capillary pressure is calculated using the saturation). In the following, the effective saturation is \begin{equation} S_{\mathrm{eff}} = \frac{S - S_{\mathrm{l,res}}}{1 - S_{\mathrm{l,res}}} \ . \end{equation} This is the wetting-phase (liquid) effective saturation, and $S$ is the wetting phase saturation. The quantity $S_{\mathrm{l,res}}$ is the wetting-phase residual saturation, and is termed sat_lr in MOOSE input files. The porepressure formulations compute $S_{\mathrm{eff}}$ as a function of capillary pressure, and hence $S$ which then appears in the fluid mass, the relative permeability, etc. ## Constant [PorousFlowCapillaryPressureConst](/PorousFlowCapillaryPressureConst.md) @@ -165,15 +171,17 @@ Only effective saturation as a function of capillary pressure is available in ## Logarithmic extension at low liquid saturations Several of the capillary pressure formulations have capillary pressure and its derivative approach infinity while the liquid saturation approaches zero. While this is desirable for calculation of infinity while the liquid effective saturation approaches zero. While this is desirable for calculation of effective saturation as a function of capillary pressure, it is undesirable when calculating the capillary pressure numerically using saturation, often leading to numerical convergence issues. By default, the numerical implementations of the capillary pressure curves implement a hard maximum when the effective saturation decreases below 0 in order to avoid unphysical values of capillary pressure and its derivatives. While this approach does avoid infinite values, it can lead to numerical difficulties for saturations close to residual due to the discontinuous derivative of capillary pressure with respect to saturation. By default, the numerical implementations of the capillary pressure curves implement a hard maximum when the effective saturation decreases below 0 in order to avoid unphysical values of capillary pressure and its derivatives. While this approach does avoid infinite values, it can lead to numerical difficulties for saturations close to residual (effective saturation close to zero) due to the discontinuous derivative of capillary pressure with respect to saturation. To overcome this, the logarithmic extension detailed by [cite!webb2000] is implemented for low saturations in formulations where capillary pressure approaches infinity for small liquid @@ -184,7 +192,7 @@ P_c = P_{c,max} 10^{m(S - S^*)} is used for saturations less than a value $S^*$. The value of $s^*$ is calculated so that the capillary pressure curve is continuous and smooth up to the maximum capillary pressure $P_{c,max}$, see [pc_vg_logext] for an example for the van Genuchten capillary pressure, and [pc_bc_logext] for the Brooks-Corey capillary pressure. the Brooks-Corey capillary pressure. For these figures, $S_{\mathrm{l,res}}=0.1$, and $S^{*}\approx 0.11$ (VG) or $S^{*}\approx 0.101$ (BC). !media media/porous_flow/pc_vg_logext.png id=pc_vg_logext
 @@ -2,6 +2,8 @@ !syntax description /Materials/PorousFlow1PhaseP Given the porepressure, this Material computes the saturation for 1-phase fluid simulations. See [capillary pressure](capillary_pressure.md) for further details. !syntax parameters /Materials/PorousFlow1PhaseP !syntax inputs /Materials/PorousFlow1PhaseP
 @@ -2,6 +2,8 @@ !syntax description /Materials/PorousFlow2PhasePP Given the liquid and gas porepressures, this Material computes the liquid and gas saturations for 2-phase fluid simulations. See [capillary pressure](capillary_pressure.md) for further details. !syntax parameters /Materials/PorousFlow2PhasePP !syntax inputs /Materials/PorousFlow2PhasePP
 @@ -100,6 +100,33 @@ class PorousFlowCapillaryPressure : public DiscreteElementUserObject */ virtual Real d2EffectiveSaturation(Real pc, unsigned qp = 0) const = 0; /** * Saturation as a function of capillary pressure * @param pc capillary pressure (Pa) * @param qp quadpoint to use (when saturation depends on coupled variables, not just * pc) * @return saturation */ Real saturation(Real pc, unsigned qp = 0) const; /** * Derivative of saturation wrt capillary pressure * @param pc capillary pressure (Pa) * @param qp quadpoint to use (when saturation depends on coupled variables, not just * pc) * @return derivative of saturation wrt capillary pressure */ Real dSaturation(Real pc, unsigned qp = 0) const; /** * Second derivative of saturation wrt capillary pressure * @param pc capillary pressure * @param qp quadpoint to use (when saturation depends on coupled variables, not just * pc) * @return second derivative of saturation wrt capillary pressure */ Real d2Saturation(Real pc, unsigned qp = 0) const; protected: /** * Effective saturation of liquid phase given liquid saturation and residual
 @@ -93,6 +93,24 @@ PorousFlowCapillaryPressure::effectiveSaturationFromSaturation(Real saturation) return (saturation - _sat_lr) / (1.0 - _sat_lr); } Real PorousFlowCapillaryPressure::saturation(Real pc, unsigned qp) const { return effectiveSaturation(pc, qp) * (1.0 - _sat_lr) + _sat_lr; } Real PorousFlowCapillaryPressure::dSaturation(Real pc, unsigned qp) const { return dEffectiveSaturation(pc, qp) * (1.0 - _sat_lr); } Real PorousFlowCapillaryPressure::d2Saturation(Real pc, unsigned qp) const { return d2EffectiveSaturation(pc, qp) * (1.0 - _sat_lr); } Real PorousFlowCapillaryPressure::capillaryPressureLogExt(Real saturation) const {
 @@ -163,11 +163,15 @@ type = PorousFlowRelativePermeabilityCorey n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.11 [../] [./relperm1] type = PorousFlowRelativePermeabilityCorey n = 3 phase = 1 s_res = 0.01 sum_s_res = 0.11 [../] [./relperm0_nodal] type = PorousFlowRelativePermeabilityCorey
 @@ -135,11 +135,15 @@ type = PorousFlowRelativePermeabilityCorey n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.11 [../] [./relperm1] type = PorousFlowRelativePermeabilityCorey n = 3 phase = 1 s_res = 0.01 sum_s_res = 0.11 [../] [./porosity] type = PorousFlowPorosityConst
 @@ -91,6 +91,8 @@ type = PorousFlowRelativePermeabilityCorey n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.1 [../] [./darcy_velocity_qp] type = PorousFlowDarcyVelocityMaterial
 @@ -92,6 +92,8 @@ type = PorousFlowRelativePermeabilityCorey n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.1 [../] [./darcy_velocity_qp] type = PorousFlowDarcyVelocityMaterial
 @@ -100,6 +100,8 @@ type = PorousFlowRelativePermeabilityCorey n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.1 [../] [./darcy_velocity_qp] type = PorousFlowDarcyVelocityMaterial
 @@ -129,11 +129,15 @@ type = PorousFlowRelativePermeabilityCorey n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.1 [../] [./relperm1_qp] type = PorousFlowRelativePermeabilityCorey n = 3 phase = 1 s_res = 0.0 sum_s_res = 0.1 [../] [./darcy_velocity_qp] type = PorousFlowDarcyVelocityMaterial
 @@ -80,7 +80,7 @@ m = 0.5 alpha = 1 pc_max = 10 sat_lr = 0.1 sat_lr = 0.01 [../] []
 @@ -85,7 +85,7 @@ m = 0.5 alpha = 1 pc_max = 10 sat_lr = 0.1 sat_lr = 0.01 [../] []
 @@ -166,12 +166,16 @@ at_nodes = true n = 2 phase = 0 s_res = 0.1 sum_s_res = 0.1 [../] [./relperm1] type = PorousFlowRelativePermeabilityCorey at_nodes = true n = 3 phase = 1 s_res = 0.0 sum_s_res = 0.1 [../] []