FlashCO2H2O Class Reference

#include <flashco2h2o.h>

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

List of all members.

Public Member Functions

 FlashCO2H2O (OrthoMesh &mesh, const VecDouble &por, double referenceT)
 ~FlashCO2H2O ()
virtual void updateDynamicModuleData ()
virtual void execute ()

Private Attributes

const VecDoublem_por
double m_T
double m_volCell
double m_volMolarCO2
double m_volMolarH2O

Static Private Attributes

static bool bFirstTime = true

Detailed Description

Definition at line 11 of file flashco2h2o.h.


Constructor & Destructor Documentation

FlashCO2H2O::FlashCO2H2O ( OrthoMesh mesh,
const VecDouble por,
double  referenceT 
)

Definition at line 9 of file flashco2h2o.cpp.

00009                                                                                :FlashCompositional(2,2),m_por(por),m_T(referenceT)  
00010 {
00011   m_volCell = mesh.cellVolume();
00012   m_volMolarH2O= 18.16E-6; // m³/mol
00013 }

FlashCO2H2O::~FlashCO2H2O (  )  [inline]

Definition at line 23 of file flashco2h2o.h.

00023 {}


Member Function Documentation

void FlashCO2H2O::execute (  )  [virtual]

Reimplemented from FlashCompositional.

Definition at line 24 of file flashco2h2o.cpp.

00025 {
00026   TransportBase &trans=getTransportModule();
00027   const VecDouble& vP = getDynamicModule().getPressureAtCells(); 
00028   if (bFirstTime){
00029     double referencePressure=vP.mean_value()*1e-5;
00030     m_volMolarCO2= 1.0E-6 * ComputeVolumeCO2(m_T, referencePressure, Flash::SUPERCRITICAL); 
00031     printf("AllanFlash Using Co2 vol Molar %g, Pressure: %g \n",m_volMolarCO2,referencePressure);
00032     bFirstTime=0;
00033     //    m_volMolarCO2=61.9578e-6;
00034   }
00035 
00036   //Get the necessary fields from the transport and dynamic module
00037   
00038   ArrayOfVecDouble &sol=trans.getSolutionAtCells();
00039 
00040   assert(sol.size() == vP.size());
00041 
00042   //for each cell i in the mesh
00043   for (unsigned i=0;i<vP.size();i++)
00044   {
00045     double Sd = sol(i,FluxForCO2Inj::_Sd); //volume of dissolved CO2 per pore volume
00046     double Sc = sol(i,FluxForCO2Inj::_Sc); //Saturation of CO2
00047     double P =  vP(i)*1E-5; //pression in the cell
00048     double por = m_por(i);
00049     assert(P > 75);
00050 
00051     double Vco2 = Sc*por*m_volCell;
00052     double Vd   = Sd*por*m_volCell;
00053     double Vw   = (1-Sc-Sd)*por*m_volCell;
00054  
00055     double nH2O  = Vw/m_volMolarH2O;
00056     double nCO2  = Vco2/m_volMolarCO2;
00057     double nCO2d = Vd/m_volMolarCO2;
00058 
00059     double nT = nH2O + nCO2 + nCO2d;
00060 
00061     double zH2O = nH2O/nT;
00062     double zCO2 = 1.0 - zH2O;
00063     double zNaCl = 0.0; // assuming no salt in the system.
00064 
00065     // Compute the flash equilibrium.
00066     Flash::BrineCO2Data brineco2Data;
00067 
00068     Flash::ProgressiveFlashBrineCO2(brineco2Data, m_T, P, zNaCl, zH2O, zCO2);
00069 
00070     // Computing the new saturations in the cell.
00071     sol(i,FluxForCO2Inj::_Sc) = brineco2Data.yCO2 * brineco2Data.betaC * m_volMolarCO2 * nT / (m_volCell * por); // (yCO2 * betaC * vCO2 * nT)/(Vcell * porosity)
00072     sol(i,FluxForCO2Inj::_Sd) = brineco2Data.xCO2 * brineco2Data.betaA * m_volMolarCO2 * nT / (m_volCell * por); // (xCO2 * betaA * vCO2 * nT)/(Vcell * porosity)   
00073   }
00074 }

void FlashCO2H2O::updateDynamicModuleData (  )  [virtual]

Definition at line 19 of file flashco2h2o.cpp.

00020 {
00021 }


Member Data Documentation

bool FlashCO2H2O::bFirstTime = true [static, private]

Definition at line 18 of file flashco2h2o.h.

const VecDouble& FlashCO2H2O::m_por [private]

Definition at line 14 of file flashco2h2o.h.

double FlashCO2H2O::m_T [private]

Definition at line 15 of file flashco2h2o.h.

double FlashCO2H2O::m_volCell [private]

Definition at line 16 of file flashco2h2o.h.

double FlashCO2H2O::m_volMolarCO2 [private]

Definition at line 17 of file flashco2h2o.h.

double FlashCO2H2O::m_volMolarH2O [private]

Definition at line 17 of file flashco2h2o.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:07 2012 for CO2INJECTION by  doxygen 1.6.3