00001 #include "fbucleyleverettgravitymob.h"
00002 #include "exception.h"
00003 #include "numericmethods.h"
00004
00005
00006
00007 FBucleyLeverettGravityMob::FBucleyLeverettGravityMob(double vW,double vO,double srw, double sro)
00008 {
00009
00010 _vw = vW;
00011 _vo = vO;
00012 _MaxSw=1.-sro;
00013 _Srw=srw;
00014 _c1=_MaxSw*_MaxSw*_vo;
00015 _c2=(1.0-_Srw)*(1.0-_Srw)*_vw;
00016
00017
00018
00019
00020
00021
00022
00023
00024 m_scanInf = new ProbeFunction1D(*this,0,0,1,10000);
00025
00026 }
00027
00028
00029 FBucleyLeverettGravityMob::FBucleyLeverettGravityMob(FBucleyLeverettGravityMob& f)
00030 {
00031 *this=f;
00032 m_scanInf = new ProbeFunction1D(*this,0,0,1,10000);
00033 }
00034
00035
00036 double FBucleyLeverettGravityMob::operator()(double x,unsigned cmp) const
00037 {
00038 if (x >= _MaxSw)
00039 x=_MaxSw;
00040 else if (x < _Srw)
00041 x=_Srw;
00042
00043 register double kw = x-_Srw;
00044 register double ko = x-_MaxSw;
00045 register double kw2=kw*kw;
00046 register double ko2=ko*ko;
00047 return kw2*ko2/(_c1*kw2 + _c2*ko2);
00048 }
00049
00050
00051
00052 FBucleyLeverettGravityMob::~FBucleyLeverettGravityMob()
00053 {
00054 delete m_scanInf;
00055 }
00056
00057 void FBucleyLeverettGravityMob::getMinMaxValues(double a, double b,double &min,double &max) const
00058 {
00059 assert(a<=b);
00060 NumericMethods::adjustBounds(a,0,1);
00061 NumericMethods::adjustBounds(b,0,1);
00062 m_scanInf->getMinMaxValues(a,b,min,max);
00063 }
00064
00065