00001 /* 00002 * fchaventmobility.cpp 00003 * 00004 * Created on: Sep 15, 2008 00005 * Author: marcosm 00006 */ 00007 00008 #include "fchaventmobility.h" 00009 FChaventMobility::FChaventMobility(double vw,double vo,double Srw,double Sro) 00010 :Function1D(1) 00011 { 00012 m_M=vw/vo; 00013 00014 MaxSo=1-Srw; 00015 MaxSw=1-Sro; 00016 MinSw=Srw; 00017 MinSo=Sro; 00018 00019 00020 //1_Srw2=1_Srw*1_Srw; 00021 //1_Sro=1-Sro; 00022 00023 _c = m_M*MaxSo*MaxSo/(MaxSw*MaxSw); 00024 00025 00026 00027 00028 } 00029 00030 FChaventMobility::~FChaventMobility() 00031 { 00032 } 00033 00034 00035 double FChaventMobility::operator()(double x,unsigned cmp) const 00036 { 00037 assert(cmp==0); 00038 if (x >= MaxSw) 00039 return 1.0; 00040 else if (x <= MinSw) 00041 return 0.0; 00042 double d1=MaxSw - x; 00043 double d2=x-MinSw; 00044 x=d1/d2; 00045 x*=x; 00046 return 1.0/(_c*x+1.0); 00047 } 00048 00049 00050 00051 00052 00053 void FChaventMobility::getMinMaxValues(double a, double b,double &min,double &max) const 00054 { 00055 assert(a>=0.0); 00056 assert(b<=1.0); 00057 assert(a<=b); 00058 min=(*this)(a); 00059 max=(*this)(b); 00060 00061 } 00062 00063 00064 00065 00071 void FChaventMobility::setParameters(const VecDouble &v) 00072 { 00073 assert(v.size() ==2); 00074 m_M=v(0)/v(1); 00075 } 00076 00077 00078 00079 00080