-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Spycher-Pruess solubility tables #2820
Implement Spycher-Pruess solubility tables #2820
Conversation
…com/GEOS-DEV/GEOS into feature/dkachuma/co2-spycher-pruess
…chuma/spycher-pruess-solubility-tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition to GEOS capability.
Thank you @dkachuma ! Just few comments on class hierarchy
string const solubilityModel = 10 < inputParams.size() ? inputParams[10] : "DuanSun"; | ||
FunctionManager & functionManager = FunctionManager::getInstance(); | ||
|
||
if( solubilityModel == "SpycherPruess" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would go for enum
compare rather than string, but as long as it works :)
see ENUM_STRINGS
IIRC
} | ||
else if( solubilityModel == "DuanSun" ) | ||
{ | ||
m_CO2SolubilityTable = makeSolubilityTable( inputParams, m_modelName, functionManager ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to have CO2Solubility
to be pure virtual and each model in a class, hence CO2SolubilitySpycherPruess
and CO2SolubilityDuanSun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered adding another solubility class. However, CO2Solubility is used as a template parameter in CO2BrineFluid. Adding a different class likely means adding a new instantiation of the template and probably a new catalog entry. This is probably OK but I didn't want to add to the proliferation of catalog types especially considering that the change in functionality is quite minimal.
In any case I think I should refactor CO2Solubility and clearly separate the Duan&Sun part from the Spycher part.
else | ||
{ | ||
GEOS_THROW( GEOS_FMT( "The CO2Solubility model {} is not known." | ||
" This should be either 'DuanSun' or 'SpycherPruess'.", solubilityModel ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would go as @MelReyCG did to list enum values if possible
src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp
Show resolved
Hide resolved
} | ||
} | ||
|
||
// Truncate negative solubility and warn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, for instance, could go in abstract base class
…dkachuma/spycher-pruess-solubility-tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great refactoring/extension !!
Thank you @dkachuma
src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp
Show resolved
Hide resolved
src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp
Show resolved
Hide resolved
src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp
Outdated
Show resolved
Hide resolved
…tions/CO2Solubility.cpp Co-authored-by: Jacques Franc <[email protected]>
Does this require rebaselines? |
No it shouldn't. |
Populates CO2 solubility and water vapourisation tables using the formulation from Spycher et al. (2003)
to include salinity.