#include <henrylawobiblunt.h>
Public Member Functions | |
HenryLawObiBlunt (OrthoMesh &mesh, double Kh, double vn, double R, double T, double mc, double mv) | |
virtual | ~HenryLawObiBlunt () |
virtual void | execute () |
virtual void | updateDynamicModuleData () |
virtual void | printOutput () |
Private Attributes | |
double | m_Kh |
double | m_c |
double | m_mc |
double | m_mw |
The flash class that implement the HenryLaw
Definition at line 10 of file henrylawobiblunt.h.
HenryLawObiBlunt::HenryLawObiBlunt | ( | OrthoMesh & | mesh, | |
double | Kh, | |||
double | vn, | |||
double | R, | |||
double | T, | |||
double | mc, | |||
double | mv | |||
) |
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 density of the CO2 | |
mw | Molar density of the water |
Definition at line 15 of file henrylawobiblunt.cpp.
HenryLawObiBlunt::~HenryLawObiBlunt | ( | ) | [virtual] |
Definition at line 85 of file henrylawobiblunt.cpp.
void HenryLawObiBlunt::execute | ( | ) | [virtual] |
Implements FlashBase.
Definition at line 27 of file henrylawobiblunt.cpp.
00028 { 00029 TransportBase &trans=getTransportModule(); 00030 //Get the necessary fields from the transport and dynamic module 00031 ArrayOfVecDouble &sol = trans.getSolutionAtCells(); 00032 const VecDouble &vP = getDynamicModule().getPressureAtCells(); 00033 00034 assert(sol.size() == vP.size()); 00035 00036 00037 //for each cell i in the mesh 00038 for (unsigned i=0;i<vP.size();i++) 00039 { 00040 double Cd = sol(i,FluxForCO2Inj::_Sd); //volume of dissolved CO2 per pore volume 00041 double Sc = sol(i,FluxForCO2Inj::_Sc); //Saturation of CO2 00042 double P = vP(i); //pression in the cell 00043 00044 double Xd = (P/m_Kh)*exp(m_c*P); //Maximum molar fraction of dissolved co2 00045 if (Xd > 1.0) 00046 { 00047 printf("Houston we have a problem Xd == %g\n",Xd); 00048 throw new Exception("Finishing"); 00049 } 00050 if (Sc >= 1.0) 00051 continue; 00052 00053 00054 //with Xd, we calculate the max amount of CO2 that can dissolve in water per pore volume 00055 double NDco2 = m_mw*(1.0-Sc - Cd)*Xd/(1.0-Xd); 00056 00057 00058 double NTco2 = (Cd+Sc)*m_mc; //total moles of CO2 in the mixture 00059 double CdN,ScN; 00060 00061 //Now compute the dissolution 00062 if (NTco2 >= NDco2) 00063 { 00064 //Ok, we have enough CO2 to dissolve into the water 00065 //dissolve it all. 00066 ScN = Sc + Cd - NDco2/m_mc; 00067 CdN = NDco2/m_mc; 00068 } 00069 else 00070 { 00071 ScN = 0.0; 00072 CdN = (Cd +Sc); 00073 } 00074 sol(i,FluxForCO2Inj::_Sd)=CdN; //volume of dissolved CO2 per pore volume 00075 sol(i,FluxForCO2Inj::_Sc)=ScN; //Saturation of CO2 00076 } 00077 }
virtual void HenryLawObiBlunt::printOutput | ( | ) | [inline, virtual] |
void HenryLawObiBlunt::updateDynamicModuleData | ( | ) | [virtual] |
Definition at line 79 of file henrylawobiblunt.cpp.
double HenryLawObiBlunt::m_c [private] |
Definition at line 13 of file henrylawobiblunt.h.
double HenryLawObiBlunt::m_Kh [private] |
Definition at line 13 of file henrylawobiblunt.h.
double HenryLawObiBlunt::m_mc [private] |
Definition at line 13 of file henrylawobiblunt.h.
double HenryLawObiBlunt::m_mw [private] |
Definition at line 13 of file henrylawobiblunt.h.