#include <flashhenrylaw.h>
Public Types | |
enum | Phases { AQUEOUS, CO2_RICH, SOLID } |
enum | Components { WATER, CO2 } |
Public Member Functions | |
FlashHenryLaw (OrthoMesh &mesh, double Kh, double vn, double R, double T, double mc, double mw, double vc, double vw) | |
~FlashHenryLaw () | |
virtual void | getPhasesVolume (double P, const FlashData &data, VecDouble &phasesVol) |
virtual void | flash (double P, const VecDouble &compTotalMoles, FlashData &data) |
virtual const VecDouble & | getComponentsMolarMass () const |
virtual void | getPhasesViscosities (double P, const FlashData &data, VecDouble &visc) |
virtual void | printOutput () |
Private Attributes | |
double | m_invKh |
double | m_c |
double | m_mc |
double | m_mw |
double | m_vc |
double | m_vw |
double | m_co2MV |
double | m_H2OMV |
VecDouble | m_components_molar_mass |
OrthoMesh & | m_mesh |
This class implements a simple flash for CO2 dissolution in pure water assuming the Henry Law. This Flash has just two components Water and CO2. Such Flash was used in the Obi Blunt model. For now the temperature is constant and set to 80 C. We have ideal mixing and supercritic co2 incompressibility.
Definition at line 15 of file flashhenrylaw.h.
Definition at line 25 of file flashhenrylaw.h.
FlashHenryLaw::FlashHenryLaw | ( | OrthoMesh & | mesh, | |
double | Kh, | |||
double | vn, | |||
double | R, | |||
double | T, | |||
double | mc, | |||
double | mw, | |||
double | vc, | |||
double | vw | |||
) |
Construct the flass module with the constants used in the Henry Law
Kh | Henry Law Coefficien | |
vn | Apparent volume of CO2 at infinite dissolution | |
R | Universal constant of gas | |
T | Temperature (Kelvin) | |
mc | Molar volume of the supercriticCO2 | |
mw | Molar volume of the water |
Definition at line 13 of file flashhenrylaw.cpp.
00014 :FlashCompositional(2,2), 00015 m_invKh(1.0/Kh), 00016 m_c(-vn/(R*T)), 00017 m_vc(vc), 00018 m_vw(vw), 00019 m_co2MV(mc), 00020 m_H2OMV(mw), 00021 m_mesh(mesh) 00022 { 00023 m_components_molar_mass.reinit(2); 00024 m_components_molar_mass(WATER)=18.01528e-3; 00025 m_components_molar_mass(CO2)=44.01e-3; 00026 00027 //set the molar volumes 00028 //m_co2MV=6.1957868649318467E-5; //m3/moles 00029 //m_H2OMV=1.7157409523809526E-5; 00030 }
FlashHenryLaw::~FlashHenryLaw | ( | ) |
Definition at line 97 of file flashhenrylaw.cpp.
void FlashHenryLaw::flash | ( | double | P, | |
const VecDouble & | compTotalMoles, | |||
FlashData & | data | |||
) | [virtual] |
Reimplemented from FlashCompositional.
Definition at line 60 of file flashhenrylaw.cpp.
00061 { 00062 //Calculate the maximum allowed mole fraction of dissolved co2 00063 double XD = P*m_invKh*exp(m_c*P); 00064 00065 //Calculate the maximum co2 moles that can dissolve. 00066 double mdCO2=XD*compTotalMoles(WATER)/(1-XD); 00067 00068 //Get the total moles of co2; 00069 double totalCO2=compTotalMoles(CO2); 00070 00071 if (totalCO2>mdCO2) 00072 { 00073 //water always in the aqueous phase 00074 data.setMoles(AQUEOUS,WATER,compTotalMoles(WATER)); 00075 data.setMoles(CO2_RICH,WATER,0); 00076 00077 //Maximum dissolved co2 goes to water 00078 data.setMoles(AQUEOUS,CO2,mdCO2); 00079 //the remaining co2 stays in co2 rich phase 00080 data.setMoles(CO2_RICH,CO2,totalCO2-mdCO2); 00081 00082 } 00083 else 00084 { 00085 //water always in the aqueous phase 00086 data.setMoles(AQUEOUS,WATER,compTotalMoles(WATER)); 00087 data.setMoles(CO2_RICH,WATER,0); 00088 00089 //All the CO2 goes into water 00090 data.setMoles(AQUEOUS,CO2,totalCO2); 00091 //nothing to be in the co2 rich phase 00092 data.setMoles(CO2_RICH,CO2,0); 00093 } 00094 }
const VecDouble & FlashHenryLaw::getComponentsMolarMass | ( | ) | const [virtual] |
Get the molar mass for each component
Reimplemented from FlashCompositional.
Definition at line 41 of file flashhenrylaw.cpp.
00042 { 00043 return m_components_molar_mass; 00044 }
void FlashHenryLaw::getPhasesViscosities | ( | double | P, | |
const FlashData & | data, | |||
VecDouble & | visc | |||
) | [virtual] |
Reimplemented from FlashCompositional.
Definition at line 34 of file flashhenrylaw.cpp.
void FlashHenryLaw::getPhasesVolume | ( | double | P, | |
const FlashData & | data, | |||
VecDouble & | phasesVol | |||
) | [virtual] |
Get phases volumes
Reimplemented from FlashCompositional.
Definition at line 47 of file flashhenrylaw.cpp.
void FlashHenryLaw::printOutput | ( | ) | [virtual] |
Reimplemented from FlashCompositional.
Definition at line 103 of file flashhenrylaw.cpp.
00104 { 00105 HDF5OrthoWriter &hdf5 = HDF5OrthoWriter::getHDF5OrthoWriter(); 00106 unsigned nCells = m_mesh.numCells(); 00107 VecDouble vc(nCells); 00108 VecDouble vcSatC(nCells); 00109 FlashData data(numPhases(),numComponents(),NULL); 00110 VecDouble vv(m_mesh.numVertices()); 00111 VecDouble phasesVol(2); 00112 for (unsigned i=0;i<nCells;i++) 00113 { 00114 FlashCompositional::flash(i,data); 00115 getPhasesVolume(getDynamicModule().getPressureAtCells()(i),data,phasesVol); 00116 vcSatC(i)=phasesVol(CO2_RICH)/(phasesVol(AQUEOUS)+phasesVol(CO2_RICH)); 00117 } 00118 m_mesh.projectCentralValuesAtVertices(vcSatC,vv); 00119 hdf5.writeScalarField(vv,"SatC"); 00120 00121 }
double FlashHenryLaw::m_c [private] |
Definition at line 18 of file flashhenrylaw.h.
double FlashHenryLaw::m_co2MV [private] |
Definition at line 19 of file flashhenrylaw.h.
Definition at line 20 of file flashhenrylaw.h.
double FlashHenryLaw::m_H2OMV [private] |
Definition at line 19 of file flashhenrylaw.h.
double FlashHenryLaw::m_invKh [private] |
Definition at line 18 of file flashhenrylaw.h.
double FlashHenryLaw::m_mc [private] |
Definition at line 18 of file flashhenrylaw.h.
OrthoMesh& FlashHenryLaw::m_mesh [private] |
Definition at line 21 of file flashhenrylaw.h.
double FlashHenryLaw::m_mw [private] |
Definition at line 18 of file flashhenrylaw.h.
double FlashHenryLaw::m_vc [private] |
Definition at line 18 of file flashhenrylaw.h.
double FlashHenryLaw::m_vw [private] |
Definition at line 18 of file flashhenrylaw.h.