00001 #ifndef FLASH_H 00002 #define FLASH_H 00003 00004 // C++ includes 00005 #include <iostream> 00006 00007 // FlashCCS includes 00008 #include "flashessential.h" 00009 00010 namespace Flash 00011 { 00012 //==================================================+ 00013 //--------------------------------------------------+ 00014 // Flash Equilibrium Data Structures 00015 //--------------------------------------------------+ 00016 //==================================================+ 00017 // the data structure to store the state of a Brine-CO2 system 00018 struct BrineCO2Data 00019 { 00020 // the molar compositions in the aqueous phase 00021 double xH2O, xCO2, xNaCl; 00022 // the molar compositions in the CO2-rich phase 00023 double yH2O, yCO2; 00024 // the phase molar fraction of the solid, aqueous and CO-rich phase respectively 00025 double betaS, betaA, betaC; 00026 // the physical state of CO2 00027 PhysicalState stateCO2; 00028 00029 00030 }; 00031 00032 // the data structure to store the state of a Brine-CO2-H2S system 00033 struct BrineCO2H2SData 00034 { 00035 // molar composition in the aqueous phase 00036 double xH2O, xCO2, xH2S, xNaCl; 00037 // molar composition in the CO2-rich phase 00038 double yH2O, yCO2, yH2S; 00039 // phase molar fraction of the solid phase, aqueous phase, CO2-rich phase and H2S-rich phase respectively 00040 double betaS, betaA, betaC, betaH; 00041 // the physical state of CO2 00042 PhysicalState stateCO2; 00043 // the physical state of H2S 00044 PhysicalState stateH2S; 00045 }; 00046 00047 //==================================================+ 00048 //--------------------------------------------------+ 00049 // Flash Equilibrium Methods 00050 //--------------------------------------------------+ 00051 //==================================================+ 00052 // it computes the flash equilibrium problem for a Brine-CO2 system with the progressive approach 00053 void ProgressiveFlashBrineCO2(BrineCO2Data& data, double T, double P, double zNaCl, double zH2O, double zCO2, unsigned int numCorrections = 2); 00054 00055 // it computes the flash equilibrium problem for a Brine-CO2 system with the geometric approach 00056 void GeometricFlashBrineCO2(BrineCO2Data& data, double T, double P, double zNaCl, double zH2O, double zCO2); 00057 00058 // it computes the flash equilibrium problem for a Brine-CO2-H2S system with the progressive approach 00059 void ProgressiveFlashBrineCO2H2S(BrineCO2H2SData& data, double T, double P, double zNaCl, double zH2O, double zCO2, double zH2S, unsigned int numCorrections = 2); 00060 00061 // it computes the flash equilibrium problem for a Brine-CO2-H2S system with the geometric approach 00062 void GeometricFlashBrineCO2H2S(BrineCO2H2SData& data, double T, double P, double zNaCl, double zH2O, double zCO2, double zH2S); 00063 00064 //==================================================+ 00065 //--------------------------------------------------+ 00066 // Stream Operators 00067 //--------------------------------------------------+ 00068 //==================================================+ 00069 // it prints the the data structure that store the state of a Brine-CO2 system 00070 std::ostream& operator<<(std::ostream& out, BrineCO2Data& data); 00071 00072 // it prints the the data structure that store the state of a Brine-CO2-H2S system 00073 std::ostream& operator<<(std::ostream& out, BrineCO2H2SData& data); 00074 } // namespace Flash 00075 00076 #endif /* FLASH_H */ 00077