FluxForCO2Inj Class Reference

#include <fluxforco2inj.h>

Inheritance diagram for FluxForCO2Inj:
Inheritance graph
[legend]
Collaboration diagram for FluxForCO2Inj:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Fields { _Sc, _Sd }

Public Member Functions

 FluxForCO2Inj (OrthoMesh &mesh, const VecDouble &cK, double v1, double v2, double sr1, double sr2, double pc, double pw, double g)
virtual ~FluxForCO2Inj ()
const VecDoublegetPermeability ()
virtual void fluxAtFace (VecDouble &vFlux, const FaceInfo &face, const VecDouble &Q1, const VecDouble &Q2)
virtual void updateDynamicData (DynamicBase &dynMod)
virtual void maxGlobalCharVelocity (double vel[3])
virtual double maxLocalCharVelocity (const FaceInfo &face, const VecDouble &Q1, const VecDouble &Q2)
double maxLocalCharVelocityII (OrthoMesh::Face_It &faceIt, int face, int cell1, int cell2, VecDouble &Q1, VecDouble &Q2, unsigned cmp)

Static Public Member Functions

static double getVolFractionOfCO2InWater (double Sc, double Cd)
static double getAquousDensity (double pc, double pw, VecDouble &vQ)

Private Attributes

OrthoMeshm_mesh
FChaventMobility m_fMob
FBucleyLeverettGravityMob m_fMobGrav
DFChaventMobility m_DfMob
DFBucleyLeverettGravityMob m_DfMobGrav
double m_maxK
VecDouble m_Vn
const VecDoublem_cK
double m_pc
double m_pw
double m_g
double m_G

Detailed Description

This class implements the flux for the case of CO2 injection in water assuming ideal mixing, incompressibility of the phases, and no evaporation of water into the supercritic CO2 phase, just dissolution. This is the flux in the article of Obi and Martin Blunt, published in WATER RESOURCES RESEARCH vol 42. It implements the following function

F1(Sc,Cd) = m_fMob(Sc)*Vdt + K (1-C)(pw-pc) m_fMobGrav(Sc) g Grad(Z) F2(Sc,Cd) = C*m_fMob(Sc)*Vdt - K C*(1-C)(pw-pc) m_fMobGrav(Sc) g Grad(Z)

Where C = Cd/(1-Sc); K = Permeability; pw = water specific mass; pc = co2 specific mass; Cd = Is the fraction volume of the porous media occupied by the dissolved CO2 Sc = Is the saturation of supercritic CO2

Definition at line 25 of file fluxforco2inj.h.


Member Enumeration Documentation

Enumerator:
_Sc 
_Sd 

Definition at line 46 of file fluxforco2inj.h.

00046 {_Sc,_Sd};


Constructor & Destructor Documentation

FluxForCO2Inj::FluxForCO2Inj ( OrthoMesh mesh,
const VecDouble cK,
double  v1,
double  v2,
double  sr1,
double  sr2,
double  pc,
double  pw,
double  g 
)

Constructor of the class

Definition at line 20 of file fluxforco2inj.cpp.

00021    :FaceFluxFunction(2),
00022     m_mesh(mesh),
00023     m_fMob(v1,v2,sr1,sr2),
00024     m_fMobGrav(v1,v2,sr1,sr2),
00025     m_DfMob(v1,v2,sr1,sr2),
00026     m_DfMobGrav(v1,v2,sr1,sr2),
00027     m_Vn(mesh.numFaces()),
00028     m_cK(cK)
00029  {
00030   m_maxK = m_cK.linfty_norm();
00031   m_pc=pc;
00032   m_pw=pw;
00033   m_g = g;
00034   m_G = (m_pc-m_pw)*m_g;
00035 
00036  }

FluxForCO2Inj::~FluxForCO2Inj (  )  [virtual]

Definition at line 38 of file fluxforco2inj.cpp.

00039 {
00040 }


Member Function Documentation

void FluxForCO2Inj::fluxAtFace ( VecDouble vFlux,
const FaceInfo face,
const VecDouble Q1,
const VecDouble Q2 
) [virtual]

This method compute the flux at a face using the values of u1 and u2 located in the two cells that share the face.

Parameters:
faceIt The face iteratator of the OrthoMesh.
face Index of the face
cell1 Index of the cell that contains the face
cell2 Index of the second cell that contains the face
Q1 Value of the numeric solution for cell1
Q2 Value of the numeric solution for cell2
component Component to calculate the flux
Returns:
The flux at face

Reimplemented from FaceFluxFunction.

Definition at line 53 of file fluxforco2inj.cpp.

00054 {
00055   assert( (unsigned) face.index < m_Vn.size());
00056   assert( (unsigned) face.cell1 < m_cK.size());
00057   assert( (unsigned) face.cell2 < m_cK.size());
00058   assert(Q1.size() == 2);
00059   assert(Q2.size() == 2);
00060 
00061   double Sc1 = Q1(_Sc);
00062   double Sc2 = Q2(_Sc);
00063   
00064   double vel = m_Vn(face.index);
00065   double C1 = getVolFractionOfCO2InWater(Sc1,Q1(_Sd));
00066   double C2 = getVolFractionOfCO2InWater(Sc2,Q2(_Sd));
00067 
00068   vFlux(_Sc) = (m_fMob(Sc1)+m_fMob(Sc2))/2.0*vel;
00069   vFlux(_Sd) = ( (1.0-m_fMob(Sc1))*C1 + (1.0-m_fMob(Sc2))*C2 )/2.0*vel;
00070 
00071 
00072   //If the face has normal in the Z direction, then add the gravity term.
00073   if (face.normal == Z && face.at_boundary )
00074   {
00075     const VecDouble &cK = getPermeability();
00076     double K1 = cK(face.cell1);
00077     double K2 = cK(face.cell2);
00078     vFlux(_Sd) += ( C1*m_fMobGrav(Sc1)*(1-C1) + C2*m_fMobGrav(Sc2)*(1-C2) ) * K1*K2/(K1+K2) * m_G; 
00079       
00080     vFlux(_Sc) -= ( m_fMobGrav(Sc1)*(1-C1) + m_fMobGrav(Sc2)*(1-C2) ) * K1*K2/(K1+K2) * m_G; 
00081   }
00082 
00083 
00084 
00085 }

double FluxForCO2Inj::getAquousDensity ( double  pc,
double  pw,
VecDouble vQ 
) [static]

Definition at line 109 of file fluxforco2inj.cpp.

00110 {
00111   double Sa = (1.0-vQ(_Sc));
00112   if (fabs(Sa) < 1.0E-10)
00113     return pw;
00114 
00115   double C = vQ(_Sd)/Sa;
00116   return C*pc + (1-C)*pw;
00117 
00118 }

const VecDouble& FluxForCO2Inj::getPermeability (  )  [inline]

Definition at line 52 of file fluxforco2inj.h.

00052 {return m_cK;}

double FluxForCO2Inj::getVolFractionOfCO2InWater ( double  Sc,
double  Cd 
) [static]

Definition at line 121 of file fluxforco2inj.cpp.

00122 {
00123   if (Sc < 1.0)
00124     return Cd/(1.0-Sc);
00125   else
00126     return 0.;
00127 }

void FluxForCO2Inj::maxGlobalCharVelocity ( double  vel[3]  )  [virtual]

Reimplemented from FaceFluxFunction.

Definition at line 135 of file fluxforco2inj.cpp.

00136 {
00137   VecDouble maxAbsVel(3);
00138   
00139   m_mesh.getMaxAbsVelocitiesInFacesByComponents(maxAbsVel,m_Vn);
00140 
00141   vel[X]= maxAbsVel(X)*m_DfMob.getMaxNorm(0,1);
00142   vel[Y]= maxAbsVel(Y)*m_DfMob.getMaxNorm(0,1);
00143   vel[Z]= maxAbsVel(Z)*m_DfMob.getMaxNorm(0,1) + m_maxK*fabs(m_DfMobGrav.getMaxNorm(0,1)*m_G);
00144 
00145 }

double FluxForCO2Inj::maxLocalCharVelocity ( const FaceInfo face,
const VecDouble Q1,
const VecDouble Q2 
) [virtual]

Reimplemented from FaceFluxFunction.

Definition at line 89 of file fluxforco2inj.cpp.

00090 {
00091   double grav = std::max(m_cK(face.cell1),m_cK(face.cell2))*m_G;
00092   double Sc1 = Q1(_Sc);
00093   double Sc2 = Q2(_Sc);
00094   if (Sc2 < Sc1)
00095     std::swap(Sc1,Sc2);
00096   double mobMaxNormGrad=m_DfMob.getMaxNorm(Sc1,Sc2);
00097   if (mobMaxNormGrad==0)
00098     mobMaxNormGrad=1;
00099   if (face.normal == OrthoMesh::NORMAL_Z)
00100     return fabs(m_Vn(face.index)*mobMaxNormGrad) + fabs(m_DfMobGrav.getMaxNorm(Sc1,Sc2)*grav);
00101   else
00102     return fabs(m_Vn(face.index)*mobMaxNormGrad);
00103 }

double FluxForCO2Inj::maxLocalCharVelocityII ( OrthoMesh::Face_It faceIt,
int  face,
int  cell1,
int  cell2,
VecDouble Q1,
VecDouble Q2,
unsigned  cmp 
)
void FluxForCO2Inj::updateDynamicData ( DynamicBase dynMod  )  [virtual]

Reimplemented from FaceFluxFunction.

Definition at line 130 of file fluxforco2inj.cpp.

00131 {
00132   dynMod.getNormalVelocityAtFaces(m_Vn);
00133 }


Member Data Documentation

const VecDouble& FluxForCO2Inj::m_cK [private]

Vector of permeability

Definition at line 36 of file fluxforco2inj.h.

Definition at line 31 of file fluxforco2inj.h.

Definition at line 32 of file fluxforco2inj.h.

Definition at line 29 of file fluxforco2inj.h.

Definition at line 30 of file fluxforco2inj.h.

double FluxForCO2Inj::m_G [private]

Definition at line 40 of file fluxforco2inj.h.

double FluxForCO2Inj::m_g [private]

gravity

Definition at line 39 of file fluxforco2inj.h.

double FluxForCO2Inj::m_maxK [private]

Max value of the permeability

Definition at line 34 of file fluxforco2inj.h.

Definition at line 28 of file fluxforco2inj.h.

double FluxForCO2Inj::m_pc [private]

CO2 supercritic density

Definition at line 37 of file fluxforco2inj.h.

double FluxForCO2Inj::m_pw [private]

Water density

Definition at line 38 of file fluxforco2inj.h.

The normal velocity field at the faces

Definition at line 35 of file fluxforco2inj.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Sun Apr 8 23:13:09 2012 for CO2INJECTION by  doxygen 1.6.3