00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00027 #ifndef OPM_REGULARIZED_VAN_GENUCHTEN_PARAMS_HPP
00028 #define OPM_REGULARIZED_VAN_GENUCHTEN_PARAMS_HPP
00029
00030 #include "VanGenuchten.hpp"
00031 #include "VanGenuchtenParams.hpp"
00032
00033 #include <opm/material/common/Spline.hpp>
00034
00035 #include <cassert>
00036
00037 namespace Opm {
00045 template<class TraitsT>
00046 class RegularizedVanGenuchtenParams : public VanGenuchtenParams<TraitsT>
00047 {
00048 typedef typename TraitsT::Scalar Scalar;
00049 typedef VanGenuchtenParams<TraitsT> Parent;
00050 typedef Opm::VanGenuchten<TraitsT> VanGenuchten;
00051
00052 public:
00053 using Parent :: finalize;
00054
00055 typedef TraitsT Traits;
00056
00057 RegularizedVanGenuchtenParams()
00058 : pcnwLowSw_(0.01)
00059 , pcnwHighSw_(0.99)
00060 {}
00061
00062 RegularizedVanGenuchtenParams(Scalar vgAlpha, Scalar vgN)
00063 : Parent(vgAlpha, vgN)
00064 , pcnwLowSw_(0.01)
00065 , pcnwHighSw_(0.99)
00066 {
00067 finalize();
00068 }
00069
00074 void finalize()
00075 {
00076 Parent::finalize();
00077
00078 pcnwLow_ = VanGenuchten::twoPhaseSatPcnw(*this, pcnwLowSw_);
00079 pcnwSlopeLow_ = dPcnw_dSw_(pcnwLowSw_);
00080 pcnwHigh_ = VanGenuchten::twoPhaseSatPcnw(*this, pcnwHighSw_);
00081 pcnwSlopeHigh_ = 2*(0.0 - pcnwHigh_)/(1.0 - pcnwHighSw_);
00082
00083 Scalar mThreshold = dPcnw_dSw_(pcnwHighSw_);
00084
00085 pcnwHighSpline_.set(pcnwHighSw_, 1.0,
00086 pcnwHigh_, 0,
00087 mThreshold, pcnwSlopeHigh_);
00088 }
00089
00094 Scalar pcnwLowSw() const
00095 { EnsureFinalized::check(); return pcnwLowSw_; }
00096
00101 Scalar pcnwLow() const
00102 { EnsureFinalized::check(); return pcnwLow_; }
00103
00110 Scalar pcnwSlopeLow() const
00111 { EnsureFinalized::check(); return pcnwSlopeLow_; }
00112
00117 void setPCLowSw(Scalar value)
00118 { pcnwLowSw_ = value; }
00119
00124 Scalar pcnwHighSw() const
00125 { EnsureFinalized::check(); return pcnwHighSw_; }
00126
00131 Scalar pcnwHigh() const
00132 { EnsureFinalized::check(); return pcnwHigh_; }
00133
00138 const Spline<Scalar>& pcnwHighSpline() const
00139 { EnsureFinalized::check(); return pcnwHighSpline_; }
00140
00147 Scalar pcnwSlopeHigh() const
00148 { EnsureFinalized::check(); return pcnwSlopeHigh_; }
00149
00154 void setPCHighSw(Scalar value)
00155 { pcnwHighSw_ = value; }
00156
00157 private:
00158 Scalar dPcnw_dSw_(Scalar Sw) const
00159 {
00160
00161
00162 const Scalar eps = 1e-7;
00163 Scalar pc1 = VanGenuchten::twoPhaseSatPcnw(*this, Sw - eps);
00164 Scalar pc2 = VanGenuchten::twoPhaseSatPcnw(*this, Sw + eps);
00165 return (pc2 - pc1)/(2*eps);
00166 }
00167
00168 Scalar pcnwLowSw_;
00169 Scalar pcnwHighSw_;
00170
00171 Scalar pcnwLow_;
00172 Scalar pcnwHigh_;
00173
00174 Scalar pcnwSlopeLow_;
00175 Scalar pcnwSlopeHigh_;
00176
00177 Spline<Scalar> pcnwHighSpline_;
00178 };
00179 }
00180
00181 #endif