Line data Source code
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 : #include "PorousFlowCapillaryPressureRSC.h" 11 : #include "PorousFlowRogersStallybrassClements.h" 12 : 13 : registerMooseObject("PorousFlowApp", PorousFlowCapillaryPressureRSC); 14 : 15 : InputParameters 16 60 : PorousFlowCapillaryPressureRSC::validParams() 17 : { 18 60 : InputParameters params = PorousFlowCapillaryPressure::validParams(); 19 120 : params.addParam<Real>("oil_viscosity", 20 : "Viscosity of oil (gas) phase. It is assumed this is " 21 : "double the water-phase viscosity. (Note that this " 22 : "effective saturation is mostly useful for 2-phase, not " 23 : "single-phase.)"); 24 120 : params.addParam<Real>("scale_ratio", 25 : "This is porosity / permeability / beta^2, where beta may " 26 : "be chosen by the user. It has dimensions [time]"); 27 120 : params.addParam<Real>("shift", "effective saturation is a function of (Pc - shift)"); 28 60 : params.addClassDescription("Rogers-Stallybrass-Clements version of effective saturation for the " 29 : "water phase, valid for residual saturations = 0, and viscosityOil = " 30 : "2 * viscosityWater. seff_water = 1 / sqrt(1 + exp((Pc - shift) / " 31 : "scale)), where scale = 0.25 * scale_ratio * oil_viscosity."); 32 60 : return params; 33 0 : } 34 : 35 33 : PorousFlowCapillaryPressureRSC::PorousFlowCapillaryPressureRSC(const InputParameters & parameters) 36 : : PorousFlowCapillaryPressure(parameters), 37 33 : _oil_viscosity(getParam<Real>("oil_viscosity")), 38 66 : _scale_ratio(getParam<Real>("scale_ratio")), 39 66 : _shift(getParam<Real>("shift")), 40 33 : _scale(0.25 * _scale_ratio * _oil_viscosity) 41 : { 42 : // Set _log_ext to false as no capillary pressure curves are implmented in this class 43 33 : _log_ext = false; 44 33 : } 45 : 46 : Real 47 0 : PorousFlowCapillaryPressureRSC::capillaryPressureCurve(Real /*saturation*/, unsigned /*qp*/) const 48 : { 49 0 : mooseError("PorousFlowCapillaryPressureRSC::capillaryPressure not implemented"); 50 : return 0.0; 51 : } 52 : 53 : Real 54 0 : PorousFlowCapillaryPressureRSC::dCapillaryPressureCurve(Real /*saturation*/, unsigned /*qp*/) const 55 : { 56 0 : mooseError("PorousFlowCapillaryPressureRSC::dCapillaryPressure not implemented"); 57 : return 0.0; 58 : } 59 : 60 : Real 61 0 : PorousFlowCapillaryPressureRSC::d2CapillaryPressureCurve(Real /*saturation*/, unsigned /*qp*/) const 62 : { 63 0 : mooseError("PorousFlowCapillaryPressureRSC::d2CapillaryPressure not implemented"); 64 : return 0.0; 65 : } 66 : 67 : Real 68 3436654 : PorousFlowCapillaryPressureRSC::effectiveSaturation(Real pc, unsigned /*qp*/) const 69 : { 70 3436654 : return PorousFlowRogersStallybrassClements::effectiveSaturation(-pc, _shift, _scale); 71 : } 72 : 73 : Real 74 3403054 : PorousFlowCapillaryPressureRSC::dEffectiveSaturation(Real pc, unsigned /*qp*/) const 75 : { 76 3403054 : return -PorousFlowRogersStallybrassClements::dEffectiveSaturation(-pc, _shift, _scale); 77 : } 78 : 79 : Real 80 1700258 : PorousFlowCapillaryPressureRSC::d2EffectiveSaturation(Real pc, unsigned /*qp*/) const 81 : { 82 1700258 : return PorousFlowRogersStallybrassClements::d2EffectiveSaturation(-pc, _shift, _scale); 83 : }