From 18b4100ffedb029df2fb891ba4eb3acdfce28b13 Mon Sep 17 00:00:00 2001 From: dkachuma Date: Thu, 14 Aug 2025 23:45:04 -0500 Subject: [PATCH 1/5] Use xml input --- .../constitutive/CMakeLists.txt | 2 + .../multifluid/CO2Brine/CO2BrineFluid.cpp | 299 +++--------------- .../multifluid/CO2Brine/CO2BrineFluid.hpp | 13 +- .../fluid/multifluid/CO2Brine/PhaseModel.hpp | 9 +- .../CO2Brine/functions/BrineEnthalpy.cpp | 42 +-- .../CO2Brine/functions/BrineEnthalpy.hpp | 2 +- .../functions/BrineFluidParameters.cpp | 298 +++++++++++++++++ .../functions/BrineFluidParameters.hpp | 136 ++++++++ .../CO2Brine/functions/CO2Enthalpy.cpp | 22 +- .../CO2Brine/functions/CO2Enthalpy.hpp | 2 +- .../CO2Brine/functions/CO2Solubility.cpp | 52 +-- .../CO2Brine/functions/CO2Solubility.hpp | 16 +- .../functions/EzrokhiBrineDensity.cpp | 29 +- .../functions/EzrokhiBrineDensity.hpp | 4 +- .../functions/EzrokhiBrineViscosity.cpp | 24 +- .../functions/EzrokhiBrineViscosity.hpp | 4 +- .../functions/FenghourCO2Viscosity.cpp | 21 +- .../functions/FenghourCO2Viscosity.hpp | 2 +- .../CO2Brine/functions/NoOpPVTFunction.hpp | 4 +- .../CO2Brine/functions/PVTFunctionBase.hpp | 1 + .../functions/PhillipsBrineDensity.cpp | 22 +- .../functions/PhillipsBrineDensity.hpp | 2 +- .../functions/PhillipsBrineViscosity.cpp | 21 +- .../functions/PhillipsBrineViscosity.hpp | 4 +- .../functions/SpanWagnerCO2Density.cpp | 21 +- .../functions/SpanWagnerCO2Density.hpp | 2 +- .../CO2Brine/functions/WaterDensity.cpp | 4 +- .../CO2Brine/functions/WaterDensity.hpp | 2 +- .../reactive/ReactiveBrineFluid.cpp | 95 +----- .../reactive/ReactiveBrineFluid.hpp | 10 +- 30 files changed, 596 insertions(+), 569 deletions(-) create mode 100644 src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp create mode 100644 src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index 0332ff69955..a59e7468143 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -68,6 +68,7 @@ set( constitutive_headers fluid/multifluid/CO2Brine/CO2BrineFluid.hpp fluid/multifluid/CO2Brine/PhaseModel.hpp fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp + fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp fluid/multifluid/CO2Brine/functions/CO2EOSSolver.hpp fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp @@ -247,6 +248,7 @@ set( constitutive_sources fluid/multifluid/blackOil/DeadOilFluid.cpp fluid/multifluid/blackOil/PVTOData.cpp fluid/multifluid/CO2Brine/CO2BrineFluid.cpp + fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp index 6c50bfe65ad..4cad0a97907 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp @@ -40,34 +40,34 @@ template< typename PHASE1, typename PHASE2, typename FLASH > class TwoPhaseCatalogNames {}; template<> class - TwoPhaseCatalogNames< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::NoOpPVTFunction >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >, - PVTProps::CO2Solubility > + TwoPhaseCatalogNames< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, NoOpPVTFunction >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >, + CO2Solubility > { public: static string name() { return "CO2BrinePhillipsFluid"; } }; template<> class - TwoPhaseCatalogNames< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::BrineEnthalpy >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >, - PVTProps::CO2Solubility > + TwoPhaseCatalogNames< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, BrineEnthalpy >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >, + CO2Solubility > { public: static string name() { return "CO2BrinePhillipsThermalFluid"; } }; template<> class - TwoPhaseCatalogNames< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::NoOpPVTFunction >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >, - PVTProps::CO2Solubility > + TwoPhaseCatalogNames< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, NoOpPVTFunction >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >, + CO2Solubility > { public: static string name() { return "CO2BrineEzrokhiFluid"; } }; template<> class - TwoPhaseCatalogNames< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::BrineEnthalpy >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >, - PVTProps::CO2Solubility > + TwoPhaseCatalogNames< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, BrineEnthalpy >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >, + CO2Solubility > { public: static string name() { return "CO2BrineEzrokhiThermalFluid"; } @@ -87,35 +87,25 @@ CO2BrineFluid< PHASE1, PHASE2, FLASH >:: CO2BrineFluid( string const & name, Group * const parent ): MultiFluidBase( name, parent ) { - registerWrapper( viewKeyStruct::phasePVTParaFilesString(), &m_phasePVTParaFiles ). - setInputFlag( InputFlags::REQUIRED ). - setRestartFlags( RestartFlags::NO_WRITE ). - setDescription( "Names of the files defining the parameters of the viscosity and density models" ); - - registerWrapper( viewKeyStruct::flashModelParaFileString(), &m_flashModelParaFile ). - setInputFlag( InputFlags::OPTIONAL ). - setRestartFlags( RestartFlags::NO_WRITE ). - setDescription( "Name of the file defining the parameters of the flash model" ); - - registerWrapper( viewKeyStruct::solubilityTablesString(), &m_solubilityTables ). - setInputFlag( InputFlags::OPTIONAL ). - setRestartFlags( RestartFlags::NO_WRITE ). - setDescription( "Names of solubility tables for each phase" ); - - this->registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ). + registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ). setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "When set to 1, write PVT tables into a CSV file" ). setDefaultValue( 0 ); - this->registerWrapper( viewKeyStruct::checkPhasePresenceString(), &m_checkPhasePresence ). + registerWrapper( viewKeyStruct::checkPhasePresenceString(), &m_checkPhasePresence ). setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "Check phase presence when computing density and viscosity" ). setDefaultValue( 0 ); + // Attach the fluid properties + bool constexpr EZROKHI_DENSITY = std::is_same_v< typename PHASE1::Density, EzrokhiBrineDensity >; + bool constexpr EZROKHI_VISCOSITY = std::is_same_v< typename PHASE1::Viscosity, EzrokhiBrineViscosity >; + m_brineFluidParameters.registerOnFluid< true, EZROKHI_DENSITY, EZROKHI_VISCOSITY >( this ); + // if this is a thermal model, we need to make sure that the arrays will be properly displayed and saved to restart - if( isThermal() ) + if constexpr ( isThermalType() ) { getField< fields::multifluid::phaseEnthalpy >(). setPlotLevel( PlotLevel::LEVEL_0 ). @@ -166,37 +156,19 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const m_phase1->density.checkTablesParameters( pressure, temperatureInCelsius ); m_phase1->viscosity.checkTablesParameters( pressure, temperatureInCelsius ); m_phase1->enthalpy.checkTablesParameters( pressure, temperatureInCelsius ); - } catch( SimulationError const & ex ) - { - string const errorMsg = GEOS_FMT( "Table input error for {} phase (in table from \"{}\").\n", - m_phaseNames[m_p1Index], m_phasePVTParaFiles[m_p1Index] ); - throw SimulationError( ex, errorMsg ); - } - try - { m_phase2->density.checkTablesParameters( pressure, temperatureInCelsius ); m_phase2->viscosity.checkTablesParameters( pressure, temperatureInCelsius ); m_phase2->enthalpy.checkTablesParameters( pressure, temperatureInCelsius ); - } catch( SimulationError const & ex ) - { - string const errorMsg = GEOS_FMT( "Table input error for {} phase (in table from \"{}\").\n", - m_phaseNames[m_p2Index], m_phasePVTParaFiles[m_p2Index] ); - throw SimulationError( ex, errorMsg ); - } - try - { m_flash->checkTablesParameters( pressure, temperatureInCelsius ); - } catch( SimulationError const & ex ) + } + catch( SimulationError const & ex ) { - string const errorMsg = GEOS_FMT( "Table input error for flash phase (in table from \"{}\").\n", - m_flashModelParaFile ); - throw SimulationError( ex, errorMsg ); + throw ex; } } - template< typename PHASE1, typename PHASE2, typename FLASH > void CO2BrineFluid< PHASE1, PHASE2, FLASH >::initializePreSubGroups() { @@ -220,18 +192,6 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::postInputInitialization() GEOS_THROW_IF_NE_MSG( numFluidComponents(), 2, GEOS_FMT( "{}: invalid number of components", getFullName() ), InputError ); - GEOS_THROW_IF_NE_MSG( m_phasePVTParaFiles.size(), 2, - GEOS_FMT( "{}: invalid number of values in attribute '{}'", getFullName() ), - InputError ); - - // Make sure one (and only one) of m_flashModelParaFile or m_solubilityTables is provided - bool const hasParamFile = !m_flashModelParaFile.empty(); - bool const hasTables = !m_solubilityTables.empty(); - GEOS_THROW_IF( hasParamFile == hasTables, - GEOS_FMT( "{}: One and only one of {} or {} should be specified", getFullName(), - viewKeyStruct::flashModelParaFileString(), - viewKeyStruct::solubilityTablesString() ), - InputError ); // NOTE: for now, the names of the phases are still hardcoded here // Later, we could read them from the XML file and we would then have a general class here @@ -241,100 +201,18 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::postInputInitialization() string const expectedGasPhaseNames[] = { "CO2", "co2", "gas", "Gas" }; m_p2Index = PVTFunctionHelpers::findName( m_phaseNames, expectedGasPhaseNames, viewKeyStruct::phaseNamesString() ); + + // Validate the brine fluid properties + bool constexpr EZROKHI_DENSITY = std::is_same_v< typename PHASE1::Density, EzrokhiBrineDensity >; + bool constexpr EZROKHI_VISCOSITY = std::is_same_v< typename PHASE1::Viscosity, EzrokhiBrineViscosity >; + m_brineFluidParameters.postInputInitialization< true, EZROKHI_DENSITY, EZROKHI_VISCOSITY >( this ); + createPVTModels(); } template< typename PHASE1, typename PHASE2, typename FLASH > void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels() { - // TODO: get rid of these external files and move into XML, this is too error prone - // For now, to support the legacy input, we read all the input parameters at once in the arrays below, and then we create the models - stdVector< string_array > phase1InputParams; - phase1InputParams.resize( 3 ); - stdVector< string_array > phase2InputParams; - phase2InputParams.resize( 3 ); - - // 1) Create the viscosity, density, enthalpy models - for( string const & filename : m_phasePVTParaFiles ) - { - std::ifstream is( filename ); - string str; - while( std::getline( is, str ) ) - { - string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str ); - - if( !strs.empty() ) - { - GEOS_THROW_IF( strs.size() < 2, - GEOS_FMT( "{}: missing PVT model in line '{}'", getFullName(), str ), - InputError ); - - if( strs[0] == "DensityFun" ) - { - if( strs[1] == PHASE1::Density::catalogName() ) - { - phase1InputParams[PHASE1::InputParamOrder::DENSITY] = strs; - } - else if( strs[1] == PHASE2::Density::catalogName() ) - { - phase2InputParams[PHASE2::InputParamOrder::DENSITY] = strs; - } - } - else if( strs[0] == "ViscosityFun" ) - { - if( strs[1] == PHASE1::Viscosity::catalogName() ) - { - phase1InputParams[PHASE1::InputParamOrder::VISCOSITY] = strs; - } - else if( strs[1] == PHASE2::Viscosity::catalogName() ) - { - phase2InputParams[PHASE2::InputParamOrder::VISCOSITY] = strs; - } - } - else if( strs[0] == "EnthalpyFun" ) - { - if( strs[1] == PHASE1::Enthalpy::catalogName() ) - { - phase1InputParams[PHASE1::InputParamOrder::ENTHALPY] = strs; - } - else if( strs[1] == PHASE2::Enthalpy::catalogName() ) - { - phase2InputParams[PHASE2::InputParamOrder::ENTHALPY] = strs; - } - } - else - { - GEOS_THROW( GEOS_FMT( "{}: invalid PVT function type '{}'", getFullName(), strs[0] ), InputError ); - } - } - } - is.close(); - } - - // at this point, we have read the file and we check the consistency of non-thermal models - GEOS_THROW_IF( phase1InputParams[PHASE1::InputParamOrder::DENSITY].empty(), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE1::Density::catalogName() ), - InputError ); - GEOS_THROW_IF( phase2InputParams[PHASE2::InputParamOrder::DENSITY].empty(), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE2::Density::catalogName() ), - InputError ); - GEOS_THROW_IF( phase1InputParams[PHASE1::InputParamOrder::VISCOSITY].empty(), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE1::Viscosity::catalogName() ), - InputError ); - GEOS_THROW_IF( phase2InputParams[PHASE2::InputParamOrder::VISCOSITY].empty(), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE2::Viscosity::catalogName() ), - InputError ); - - // we also detect any inconsistency arising in the enthalpy models - GEOS_THROW_IF( phase1InputParams[PHASE1::InputParamOrder::ENTHALPY].empty() && - ( PHASE1::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() ), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE1::Enthalpy::catalogName() ), - InputError ); - GEOS_THROW_IF( phase2InputParams[PHASE2::InputParamOrder::ENTHALPY].empty() && - ( PHASE2::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() ), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE2::Enthalpy::catalogName() ), - InputError ); - // then, we are ready to instantiate the phase models bool const isClone = this->isClone(); TableFunction::OutputOptions const pvtOutputOpts = { @@ -342,100 +220,25 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels() !isClone && isLogLevelActive< logInfo::PVT >( this->getLogLevel()), // writeInLog }; - + // 1) Create phase models m_phase1 = std::make_unique< PHASE1 >( getName() + "_phaseModel1", - phase1InputParams, + m_brineFluidParameters, m_componentNames, m_componentMolarWeight, pvtOutputOpts ); m_phase2 = std::make_unique< PHASE2 >( getName() + "_phaseModel2", - phase2InputParams, + m_brineFluidParameters, m_componentNames, m_componentMolarWeight, pvtOutputOpts ); - // 2) Create the flash model - if( !m_flashModelParaFile.empty()) - { - std::ifstream is( m_flashModelParaFile ); - string str; - while( std::getline( is, str ) ) - { - string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str ); - - if( !strs.empty() ) - { - GEOS_THROW_IF( strs.size() < 2, - GEOS_FMT( "{}: missing flash model in line '{}'", getFullName(), str ), - InputError ); - - if( strs[0] == "FlashModel" ) - { - if( strs[1] == FLASH::catalogName() ) - { - TableFunction::OutputOptions const flashOutputOpts = { - !isClone && m_writeCSV,// writeCSV - !isClone && isLogLevelActive< logInfo::PVT >( this->getLogLevel()), // writeInLog - }; - m_flash = std::make_unique< FLASH >( getName() + '_' + FLASH::catalogName(), - strs, - m_phaseNames, - m_componentNames, - m_componentMolarWeight, - flashOutputOpts ); - } - } - else - { - GEOS_THROW( GEOS_FMT( "{}: invalid flash model type '{}'", getFullName(), strs[0] ), InputError ); - } - } - } - is.close(); - } - else - { - // The user must provide 1 or 2 tables. - GEOS_THROW_IF( m_solubilityTables.size() != 1 && m_solubilityTables.size() != 2, - GEOS_FMT( "{}: The number of table names in {} must be 1 or 2", getFullName(), viewKeyStruct::solubilityTablesString() ), - InputError ); - - // If 1 table is provided, it is the CO2 solubility table and water vapourisation is zero - // If 2 tables are provided, they are the CO2 solubility and water vapourisation tables depending - // on how phaseNames is arranged - string const solubilityModel = EnumStrings< CO2Solubility::SolubilityModel >::toString( CO2Solubility::SolubilityModel::Tables ); - string_array strs; - strs.emplace_back( "FlashModel" ); - strs.emplace_back( solubilityModel ); // Marker to indicate that tables are provided - strs.emplace_back( "" ); // 2 empty strings for the 2 phase tables gas first, then water - strs.emplace_back( "" ); - if( m_solubilityTables.size() == 2 ) - { - strs[2] = m_solubilityTables[m_p2Index]; - strs[3] = m_solubilityTables[m_p1Index]; - } - else - { - strs[2] = m_solubilityTables[0]; - } - - TableFunction::OutputOptions const flashOutputOpts = { - !isClone && m_writeCSV,// writeCSV - !isClone && isLogLevelActive< logInfo::PVT >( this->getLogLevel() ), // writeInLog - }; - - m_flash = std::make_unique< FLASH >( getName() + '_' + FLASH::catalogName(), - strs, - m_phaseNames, - m_componentNames, - m_componentMolarWeight, - flashOutputOpts ); - } - - GEOS_THROW_IF( m_flash == nullptr, - GEOS_FMT( "{}: flash model {} not found in input files", getFullName(), FLASH::catalogName() ), - InputError ); + m_flash = std::make_unique< FLASH >( getName() + '_' + FLASH::catalogName(), + m_brineFluidParameters, + m_phaseNames, + m_componentNames, + m_componentMolarWeight, + pvtOutputOpts ); } template< typename PHASE1, typename PHASE2, typename FLASH > @@ -500,19 +303,19 @@ CO2BrineFluid< PHASE1, PHASE2, FLASH >::KernelWrapper:: {} // explicit instantiation of the model template; unfortunately we can't use the aliases for this -template class CO2BrineFluid< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::NoOpPVTFunction >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >, - PVTProps::CO2Solubility >; -template class CO2BrineFluid< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::BrineEnthalpy >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >, - PVTProps::CO2Solubility >; - -template class CO2BrineFluid< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::NoOpPVTFunction >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >, - PVTProps::CO2Solubility >; -template class CO2BrineFluid< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::BrineEnthalpy >, - PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >, - PVTProps::CO2Solubility >; +template class CO2BrineFluid< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, NoOpPVTFunction >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >, + CO2Solubility >; +template class CO2BrineFluid< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, BrineEnthalpy >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >, + CO2Solubility >; + +template class CO2BrineFluid< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, NoOpPVTFunction >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >, + CO2Solubility >; +template class CO2BrineFluid< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, BrineEnthalpy >, + PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >, + CO2Solubility >; REGISTER_CATALOG_ENTRY( ConstitutiveBase, CO2BrinePhillipsFluid, string const &, Group * const ) REGISTER_CATALOG_ENTRY( ConstitutiveBase, CO2BrinePhillipsThermalFluid, string const &, Group * const ) diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp index 1b89321acd7..16e48d533de 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp @@ -172,9 +172,6 @@ class CO2BrineFluid : public MultiFluidBase struct viewKeyStruct : MultiFluidBase::viewKeyStruct { - static constexpr char const * flashModelParaFileString() { return "flashModelParaFile"; } - static constexpr char const * solubilityTablesString() { return "solubilityTableNames"; } - static constexpr char const * phasePVTParaFilesString() { return "phasePVTParaFiles"; } static constexpr char const * writeCSVFlagString() { return "writeCSV"; } static constexpr char const * checkPhasePresenceString() { return "checkPhasePresence"; } }; @@ -192,14 +189,8 @@ class CO2BrineFluid : public MultiFluidBase */ void createPVTModels(); - /// Names of the files defining the viscosity and density models - path_array m_phasePVTParaFiles; - - /// Name of the file defining the flash model - Path m_flashModelParaFile; - - /// Names of solubility tables for each phase - string_array m_solubilityTables; + /// All brine model properties + PVTProps::BrineFluidParameters m_brineFluidParameters{}; /// Index of the liquid phase integer m_p1Index; diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp index fe5b481e72c..ad8d4731fc7 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp @@ -21,6 +21,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_PHASEMODEL_HPP_ #include "functions/TableFunction.hpp" +#include "constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp" namespace geos { @@ -59,22 +60,22 @@ struct PhaseModel * @param[in] pvtOutputOpts A structure containing generated table output options */ PhaseModel( string const & phaseModelName, - stdVector< string_array > const & inputParams, + PVTProps::BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ) : density( phaseModelName + "_" + Density::catalogName(), - inputParams[InputParamOrder::DENSITY], + brineFluidParameters, componentNames, componentMolarWeight, pvtOutputOpts ), viscosity( phaseModelName + "_" + Viscosity::catalogName(), - inputParams[InputParamOrder::VISCOSITY], + brineFluidParameters, componentNames, componentMolarWeight, pvtOutputOpts ), enthalpy( phaseModelName + "_" + Enthalpy::catalogName(), - inputParams[InputParamOrder::ENTHALPY], + brineFluidParameters, componentNames, componentMolarWeight, pvtOutputOpts ) diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp index 41008529fe3..297c89e6e61 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp @@ -86,7 +86,7 @@ void calculateBrineEnthalpy( PTTableCoordinates const & tableCoords, } } -TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams, +TableFunction const * makeCO2EnthalpyTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters, string const & functionName, FunctionManager & functionManager ) { @@ -104,21 +104,9 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams, { // initialize the (p,T) coordinates PTTableCoordinates tableCoords; - PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); - real64 tolerance = 1e-10; - - try - { - if( inputParams.size() >= 10 ) - { - tolerance = stod( inputParams[9] ); - } - } - catch( const std::invalid_argument & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const tolerance = brineFluidParameters.m_tolerance; array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() ); array1d< real64 > enthalpies( tableCoords.nPressures() * tableCoords.nTemperatures() ); @@ -135,7 +123,7 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams, } } -TableFunction const * makeBrineEnthalpyTable( string_array const & inputParams, +TableFunction const * makeBrineEnthalpyTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters, string const & functionName, FunctionManager & functionManager ) { @@ -153,22 +141,10 @@ TableFunction const * makeBrineEnthalpyTable( string_array const & inputParams, { // initialize the (p,T) coordinates PTTableCoordinates tableCoords; - PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); // initialize salinity - GEOS_THROW_IF_LT_MSG( inputParams.size(), 9, - GEOS_FMT( "{}: insufficient number of model parameters", functionName ), - InputError ); - real64 salinity; - - try - { - salinity = stod( inputParams[8] ); - } - catch( std::invalid_argument const & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const salinity = brineFluidParameters.m_salinity; array1d< real64 > enthalpies( tableCoords.nTemperatures() ); array1d< array1d< real64 > > temperatures; @@ -189,7 +165,7 @@ TableFunction const * makeBrineEnthalpyTable( string_array const & inputParams, } // namespace BrineEnthalpy::BrineEnthalpy( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -203,8 +179,8 @@ BrineEnthalpy::BrineEnthalpy( string const & name, string const expectedWaterComponentNames[] = { "Water", "water" }; m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" ); - m_CO2EnthalpyTable = makeCO2EnthalpyTable( inputParams, m_functionName, FunctionManager::getInstance() ); - m_brineEnthalpyTable = makeBrineEnthalpyTable( inputParams, m_functionName, FunctionManager::getInstance() ); + m_CO2EnthalpyTable = makeCO2EnthalpyTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() ); + m_brineEnthalpyTable = makeBrineEnthalpyTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() ); m_CO2EnthalpyTable->outputTableData( pvtOutputOpts ); m_brineEnthalpyTable->outputTableData( pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp index 788a7f3ef0d..a71874d2561 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp @@ -89,7 +89,7 @@ class BrineEnthalpy : public PVTFunctionBase public: BrineEnthalpy( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp new file mode 100644 index 00000000000..50241883ad4 --- /dev/null +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp @@ -0,0 +1,298 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file BrineFluidParameters.cpp + */ + +#include "BrineFluidParameters.hpp" +#include "constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp" +#include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" +#include "constitutive/fluid/multifluid/MultiFluidBase.hpp" + +#include "dataRepository/InputFlags.hpp" +#include "dataRepository/RestartFlags.hpp" +#include "common/logger/Logger.hpp" + +namespace geos +{ + +using namespace dataRepository; + +namespace constitutive +{ +namespace PVTProps +{ + +template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY > +void BrineFluidParameters::registerOnFluid( MultiFluidBase * fluid ) +{ + if constexpr (FLASH) + { + fluid->registerWrapper( viewKeyStruct::solubilityModelString(), &m_solubilityModel ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "The solubility model for calculating phase equilibrium. " + "Available options are: " + EnumStrings< SolubilityModel >::concat( "\n* " ) ). + setDefaultValue( m_solubilityModel ); + + fluid->registerWrapper( viewKeyStruct::solubilityTablesString(), &m_solubilityTables ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "Names of solubility tables for each phase" ); + } + + fluid->registerWrapper( viewKeyStruct::pressureCoordinatesString(), &m_pressureCoordinates ). + setInputFlag( InputFlags::REQUIRED ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "List of pressure values for interpolation of function values." ); + + fluid->registerWrapper( viewKeyStruct::pressureIntervalString(), &m_pressureInterval ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( GEOS_FMT( "Step size used to evenly discretize the range pressure range given by " + "{0} into a set of evenly spaced values. If a positive is givem, it defines the " + "spacing between generated points across the full range from the first to the " + "last input value. If zero or a negative number is given then the points in {0} " + " are left as is.", viewKeyStruct::pressureIntervalString() )). + setDefaultValue( m_pressureInterval ); + + fluid->registerWrapper( viewKeyStruct::temperatureCoordinatesString(), &m_temperatureCoordinates ). + setInputFlag( InputFlags::REQUIRED ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "List of temperature values for interpolation of function values." ); + + fluid->registerWrapper( viewKeyStruct::temperatureIntervalString(), &m_temperatureInterval ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( GEOS_FMT( "Step size used to evenly discretize the range temperature range given by " + "{0} into a set of evenly spaced values. If a positive is givem, it defines the " + "spacing between generated points across the full range from the first to the " + "last input value. If zero or a negative number is given then the points in {0} " + " are left as is.", viewKeyStruct::temperatureIntervalString() )). + setDefaultValue( m_temperatureInterval ); + + fluid->registerWrapper( viewKeyStruct::waterCompressibilityString(), &m_waterCompressibility ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "The compressibility of pure water" ). + setDefaultValue( m_waterCompressibility ); + + fluid->registerWrapper( viewKeyStruct::salinityString(), &m_salinity ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "The salinity of brine" ). + setDefaultValue( m_salinity ); + + fluid->registerWrapper( viewKeyStruct::toleranceString(), &m_tolerance ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "Tolerance to used for fluid property calculation" ). + setDefaultValue( m_tolerance ); + + // Check if we have the Ezrokhi model + if constexpr ( EZROKHI_DENSITY ) + { + fluid->registerWrapper( viewKeyStruct::ezrokhiDensityCoefficientsString(), &m_ezrokhiDensityCoefficients ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "Ezrokhi correlation coefficients for brine density." ); + } + + if constexpr ( EZROKHI_VISCOSITY ) + { + fluid->registerWrapper( viewKeyStruct::ezrokhiViscosityCoefficientsString(), &m_ezrokhiViscosityCoefficients ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "Ezrokhi correlation coefficients for brine viscosity." ); + } +} + +template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY > +void BrineFluidParameters::postInputInitialization( MultiFluidBase * fluid ) +{ + string const fullName = fluid->getFullName(); + + if constexpr (FLASH) + { + // Check if we need solubility tables + bool const hasNoTables = m_solubilityTables.empty(); + bool const needsTables = m_solubilityModel == SolubilityModel::Tables; + GEOS_THROW_IF( needsTables && hasNoTables, + GEOS_FMT( "{}: If the solubility model is set to {} then the {} field should be provided.", + fullName, + m_solubilityModel, + viewKeyStruct::solubilityTablesString() ), + InputError ); + + if( needsTables ) + { + // The user must provide 1 or 2 tables. + GEOS_THROW_IF( m_solubilityTables.size() != 1 && m_solubilityTables.size() != 2, + GEOS_FMT( "{}: The number of table names in {} must be 1 or 2", fullName, viewKeyStruct::solubilityTablesString() ), + InputError ); + } + } + + // Water compressibility must be positive + GEOS_THROW_IF_LT_MSG( m_waterCompressibility, MultiFluidConstants::epsilon, + GEOS_FMT( "{}: invalid water compressibility {}. " + "Value must be positive", fullName, viewKeyStruct::waterCompressibilityString() ), + InputError ); + + // Salinity must not be negative + GEOS_THROW_IF_LT_MSG( m_salinity, 0.0, + GEOS_FMT( "{}: invalid salinity {}. " + "Value must not be negative", fullName, viewKeyStruct::waterCompressibilityString() ), + InputError ); + + // Flash tolerance must be positive + GEOS_THROW_IF_LT_MSG( m_tolerance, MultiFluidConstants::epsilon, + GEOS_FMT( "{}: invalid flash tolerance {}. " + "Value must be positive", fullName, viewKeyStruct::toleranceString() ), + InputError ); + + // Coordinates values must be at least 2 + GEOS_THROW_IF_LT_MSG( m_pressureCoordinates.size(), 2, + GEOS_FMT( "{}: invalid number of pressure coordinates provided in {}. " + "At least 2 values must be provided", fullName, viewKeyStruct::pressureCoordinatesString() ), + InputError ); + + // Values must be strictly increasing + GEOS_THROW_IF( !isStrictlyIncreasing( m_pressureCoordinates.toSliceConst()), + GEOS_FMT( "{}: invalid values of pressure coordinates provided in {}. " + "Values must be strictly increasing.", fullName, viewKeyStruct::pressureCoordinatesString() ), + InputError ); + + // Coordinates values must be at least 2 + GEOS_THROW_IF_LT_MSG( m_temperatureCoordinates.size(), 2, + GEOS_FMT( "{}: invalid number of temperature coordinates provided in {}. " + "At least 2 values must be provided", fullName, viewKeyStruct::temperatureCoordinatesString() ), + InputError ); + + // Values must be strictly increasing + GEOS_THROW_IF( !isStrictlyIncreasing( m_temperatureCoordinates.toSliceConst()), + GEOS_FMT( "{}: invalid values of temperature coordinates provided in {}. " + "Values must be strictly increasing.", fullName, viewKeyStruct::temperatureCoordinatesString() ), + InputError ); + + if constexpr ( EZROKHI_DENSITY ) + { + if( m_ezrokhiDensityCoefficients.empty()) + { + for( integer ic = 0; ic < 3; ic++ ) + { + m_ezrokhiDensityCoefficients.emplace_back( 0.0 ); + } + } + if( m_ezrokhiDensityCoefficients.empty()) + { + for( integer ic = 0; ic < 3; ic++ ) + { + m_ezrokhiViscosityCoefficients.emplace_back( 0.0 ); + } + } + GEOS_THROW_IF_NE_MSG( m_ezrokhiViscosityCoefficients.size(), 3, + GEOS_FMT( "{}: invalid number of Ezrokhi density coefficients provided in {}. " + "Exactly 3 values must be provided.", fullName, viewKeyStruct::ezrokhiDensityCoefficientsString() ), + InputError ); + } + + if constexpr ( EZROKHI_VISCOSITY ) + { + if( m_ezrokhiDensityCoefficients.empty()) + { + for( integer ic = 0; ic < 3; ic++ ) + { + m_ezrokhiViscosityCoefficients.emplace_back( 0.0 ); + } + } + GEOS_THROW_IF_NE_MSG( m_ezrokhiViscosityCoefficients.size(), 3, + GEOS_FMT( "{}: invalid number of Ezrokhi viscosity coefficients provided in {}. " + "Exactly 3 values must be provided.", fullName, viewKeyStruct::ezrokhiViscosityCoefficientsString() ), + InputError ); + } +} + +void BrineFluidParameters::initializePropertyTable( BrineFluidParameters const & fluidParameters, + PTTableCoordinates & tableCoords ) +{ + real64 const dP = fluidParameters.m_pressureInterval; + if( MultiFluidConstants::epsilon < dP ) + { + integer const n = fluidParameters.m_pressureCoordinates.size(); + real64 const startPressure = fluidParameters.m_pressureCoordinates[0]; + real64 const endPressure = fluidParameters.m_pressureCoordinates[n-1]; + for( real64 pressure = startPressure; pressure <= endPressure; pressure += dP ) + { + tableCoords.appendPressure( pressure ); + } + } + else + { + for( real64 const pressure : fluidParameters.m_pressureCoordinates ) + { + tableCoords.appendPressure( pressure ); + } + } + + real64 const dT = fluidParameters.m_temperatureInterval; + if( MultiFluidConstants::epsilon < dT ) + { + integer const n = fluidParameters.m_temperatureCoordinates.size(); + real64 const startTemperature = fluidParameters.m_temperatureCoordinates[0]; + real64 const endTemperature = fluidParameters.m_temperatureCoordinates[n-1]; + for( real64 temperature = startTemperature; temperature <= endTemperature; temperature += dT ) + { + tableCoords.appendPressure( temperature ); + } + } + else + { + for( real64 const temperature : fluidParameters.m_temperatureCoordinates ) + { + tableCoords.appendTemperature( temperature ); + } + } +} + +bool BrineFluidParameters::isStrictlyIncreasing( arraySlice1d< real64 const > const & array ) +{ + localIndex const size = array.size(); + GEOS_ASSERT( 1 < size ); + real64 constexpr epsilon = MultiFluidConstants::epsilon; + for( localIndex i = 1; i < size; ++i ) + { + if( array[i] - array[i-1] < epsilon ) + { + return false; + } + } + return true; +} + +// Explicitly instantiate +template void BrineFluidParameters::registerOnFluid< false, false, false >( MultiFluidBase * ); +template void BrineFluidParameters::registerOnFluid< true, false, false >( MultiFluidBase * ); +template void BrineFluidParameters::registerOnFluid< true, true, true >( MultiFluidBase * ); +template void BrineFluidParameters::postInputInitialization< false, false, false >( MultiFluidBase * ); +template void BrineFluidParameters::postInputInitialization< true, false, false >( MultiFluidBase * ); +template void BrineFluidParameters::postInputInitialization< true, true, true >( MultiFluidBase * ); + +} // end namespace PVTProps + +} // end namespace constitutive + +} // end namespace geos diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp new file mode 100644 index 00000000000..0c1338e7efd --- /dev/null +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp @@ -0,0 +1,136 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file BrineFluidParameters.hpp + */ + +#ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_BRINEFLUIDPARAMETERS_HPP_ +#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_BRINEFLUIDPARAMETERS_HPP_ + +#include "common/DataTypes.hpp" +#include "common/format/EnumStrings.hpp" + +namespace geos +{ +namespace constitutive +{ +class MultiFluidBase; + +namespace PVTProps +{ + +class PTTableCoordinates; + +/// A structure to contain the properties required to create a brine fluid model +struct BrineFluidParameters +{ + enum class SolubilityModel : integer + { + DuanSun, + SpycherPruess, + Tables + }; + + /// Solubility model + SolubilityModel m_solubilityModel{SolubilityModel::DuanSun}; + + /// Pressure discretisation points + array1d< real64 > m_pressureCoordinates; + + /// Interval for pressure discretisation + real64 m_pressureInterval{0.0}; + + /// Temperature discretisation points + array1d< real64 > m_temperatureCoordinates; + + /// Interval for temperature discretisation + real64 m_temperatureInterval{0.0}; + + /// Names of solubility tables for each phase + string_array m_solubilityTables; + + /// Water compressibility + real64 m_waterCompressibility{4.5e-10}; + + /// Flash tolerance used to solve any EOS states + real64 m_tolerance{1.0e-9}; + + /// Salinity + real64 m_salinity{0.0}; + + /// The Ezrokhi density Coefficients if required + array1d< real64 > m_ezrokhiDensityCoefficients; + + /// The Ezrokhi viscosity Coefficients if required + array1d< real64 > m_ezrokhiViscosityCoefficients; + + struct viewKeyStruct + { + static constexpr char const * solubilityModelString() { return "solubilityModel"; } + static constexpr char const * pressureCoordinatesString() { return "pressureCoordinates"; } + static constexpr char const * pressureIntervalString() { return "pressureInterval"; } + static constexpr char const * temperatureCoordinatesString() { return "temperatureCoordinates"; } + static constexpr char const * temperatureIntervalString() { return "temperatureInterval"; } + static constexpr char const * salinityString() { return "salinity"; } + static constexpr char const * waterCompressibilityString() { return "waterCompressibility"; } + static constexpr char const * solubilityTablesString() { return "solubilityTableNames"; } + static constexpr char const * toleranceString() { return "tolerance"; } + static constexpr char const * ezrokhiDensityCoefficientsString() { return "ezrokhiDensityCoefficients"; } + static constexpr char const * ezrokhiViscosityCoefficientsString() { return "ezrokhiViscosityCoefficients"; } + }; + + /** + * @brief Attaches the fluid properties to a fluid Group + * @param[in/out] fluid The fluid object + */ + template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY > + void registerOnFluid( MultiFluidBase * fluid ); + + /** + * @brief Validates the user input for the fluid properties + * @param[in] fluid The fluid object + */ + template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY > + void postInputInitialization( MultiFluidBase * fluid ); + + /** + * @brief Populate the coordinate table with pressure and temperature + * @param[in] fluidProperties the user provided properties + * @param[out] tableCoords the (p,T) coordinates of the table + */ + static void initializePropertyTable( BrineFluidParameters const & fluidParameters, + PTTableCoordinates & tableCoords ); + + /** + * @brief Check if an array has strictly increasing values + * @param[in] array The array to be checked + * @return @c true if the array has values that are strictly increasing + */ + static bool isStrictlyIncreasing( arraySlice1d< real64 const > const & array ); +}; + +ENUM_STRINGS( BrineFluidParameters::SolubilityModel, + "DuanSun", + "SpycherPruess", + "Tables" ); + +} // end namespace PVTProps + +} // end namespace constitutive + +} // end namespace geos + +#endif //GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_BRINEFLUIDPARAMETERS_HPP_ diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp index dfd94c81d8b..e609578e852 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp @@ -200,7 +200,7 @@ real64 helmholtzCO2Enthalpy( real64 const & T, -TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams, +TableFunction const * makeCO2EnthalpyTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters, string const & functionName, FunctionManager & functionManager ) { @@ -218,21 +218,9 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams, { // initialize the (p,T) coordinates PTTableCoordinates tableCoords; - PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); - real64 tolerance = 1e-10; - - try - { - if( inputParams.size() >= 10 ) - { - tolerance = stod( inputParams[9] ); - } - } - catch( const std::invalid_argument & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const tolerance = brineFluidParameters.m_tolerance; array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() ); array1d< real64 > enthalpies( tableCoords.nPressures() * tableCoords.nTemperatures() ); @@ -254,7 +242,7 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams, } // namespace CO2Enthalpy::CO2Enthalpy( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -265,7 +253,7 @@ CO2Enthalpy::CO2Enthalpy( string const & name, string const expectedCO2ComponentNames[] = { "CO2", "co2" }; m_CO2Index = PVTFunctionHelpers::findName( componentNames, expectedCO2ComponentNames, "componentNames" ); - m_CO2EnthalpyTable = makeCO2EnthalpyTable( inputParams, m_functionName, FunctionManager::getInstance() ); + m_CO2EnthalpyTable = makeCO2EnthalpyTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() ); m_CO2EnthalpyTable->outputTableData( pvtOutputOpts ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp index e9071dc6428..453d1e26571 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp @@ -77,7 +77,7 @@ class CO2Enthalpy : public PVTFunctionBase public: CO2Enthalpy( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp index 8df746180f5..d2cc5d802a0 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp @@ -57,13 +57,15 @@ TableFunction const * makeTable( string const & tableName, std::pair< TableFunction const *, TableFunction const * > makeSolubilityTables( string const & functionName, - string_array const & inputParams, - constitutive::PVTProps::CO2Solubility::SolubilityModel const & solubilityModel ) + constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters ) { FunctionManager & functionManager = FunctionManager::getInstance(); constitutive::PVTProps::PTTableCoordinates tableCoords; + + auto const & solubilityModel = brineFluidParameters.m_solubilityModel; + // Check solubility model for explicit table input - if( solubilityModel == constitutive::PVTProps::CO2Solubility::SolubilityModel::Tables ) + if( solubilityModel == constitutive::PVTProps::BrineFluidParameters::SolubilityModel::Tables ) { // The default table is a table with all zeros unless the name is explicitly provided // The pressure and temperature values below will be used only to create the zero table so they @@ -72,12 +74,13 @@ makeSolubilityTables( string const & functionName, .appendTemperature( 0.0 ).appendTemperature( 800.0 ); TableFunction const * tables[2] = { nullptr, nullptr }; + auto const & solubilityTables = brineFluidParameters.m_solubilityTables; for( integer tableIndex : { 0, 1 } ) { array1d< real64 > values( 4 ); values.zero(); - string inputTableName = inputParams[2 + tableIndex]; + string inputTableName = tableIndex < static_cast< integer >(solubilityTables.size()) ? solubilityTables[tableIndex] : ""; if( inputTableName.empty() ) { inputTableName = GEOS_FMT( "{}_zeroDissolution_table", constitutive::PVTProps::CO2Solubility::catalogName() ); @@ -106,27 +109,10 @@ makeSolubilityTables( string const & functionName, } // Initialize the (p,T) coordinates - constitutive::PVTProps::PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); - // Initialize salinity and tolerance - GEOS_THROW_IF_LT_MSG( inputParams.size(), 9, - GEOS_FMT( "{}: insufficient number of model parameters", functionName ), - InputError ); - - real64 tolerance = 1e-9; - real64 salinity = 0.0; - try - { - salinity = stod( inputParams[8] ); - if( inputParams.size() >= 10 ) - { - tolerance = stod( inputParams[9] ); - } - } - catch( const std::invalid_argument & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const tolerance = brineFluidParameters.m_tolerance; + real64 const salinity = brineFluidParameters.m_salinity; integer const nPressures = tableCoords.nPressures(); integer const nTemperatures = tableCoords.nTemperatures(); @@ -134,7 +120,7 @@ makeSolubilityTables( string const & functionName, array1d< real64 > co2Solubility( nPressures * nTemperatures ); array1d< real64 > h2oSolubility( nPressures * nTemperatures ); - if( solubilityModel == constitutive::PVTProps::CO2Solubility::SolubilityModel::DuanSun ) + if( solubilityModel == constitutive::PVTProps::BrineFluidParameters::SolubilityModel::DuanSun ) { constitutive::PVTProps::CO2SolubilityDuanSun::populateSolubilityTables( functionName, @@ -144,7 +130,7 @@ makeSolubilityTables( string const & functionName, co2Solubility, h2oSolubility ); } - else if( solubilityModel == constitutive::PVTProps::CO2Solubility::SolubilityModel::SpycherPruess ) + else if( solubilityModel == constitutive::PVTProps::BrineFluidParameters::SolubilityModel::SpycherPruess ) { constitutive::PVTProps::CO2SolubilitySpycherPruess::populateSolubilityTables( functionName, @@ -223,7 +209,7 @@ namespace PVTProps { CO2Solubility::CO2Solubility( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & phaseNames, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, @@ -251,17 +237,7 @@ CO2Solubility::CO2Solubility( string const & name, string const expectedWaterPhaseNames[] = { "Water", "water", "Liquid", "liquid" }; m_phaseLiquidIndex = PVTFunctionHelpers::findName( phaseNames, expectedWaterPhaseNames, "phaseNames" ); - SolubilityModel solubilityModel = SolubilityModel::DuanSun; // Default solubility model - if( inputParams[1] == EnumStrings< SolubilityModel >::toString( SolubilityModel::Tables ) ) - { - solubilityModel = SolubilityModel::Tables; - } - else if( 11 <= inputParams.size() ) - { - solubilityModel = EnumStrings< SolubilityModel >::fromString( inputParams[10] ); - } - - std::tie( m_CO2SolubilityTable, m_WaterVapourisationTable ) = makeSolubilityTables( m_modelName, inputParams, solubilityModel ); + std::tie( m_CO2SolubilityTable, m_WaterVapourisationTable ) = makeSolubilityTables( m_modelName, brineFluidParameters ); m_CO2SolubilityTable->outputTableData( pvtOutputOpts ); m_WaterVapourisationTable->outputTableData( pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp index 89a99f691f1..b79a994841e 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp @@ -22,6 +22,7 @@ #include "FlashModelBase.hpp" #include "constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp" +#include "constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp" #include "constitutive/fluid/multifluid/Layouts.hpp" #include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" #include "fileIO/Outputs/OutputBase.hpp" @@ -103,17 +104,9 @@ class CO2SolubilityUpdate final : public FlashModelBaseUpdate class CO2Solubility : public FlashModelBase { -public: - enum class SolubilityModel : integer - { - DuanSun, - SpycherPruess, - Tables - }; - public: CO2Solubility( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & phaseNames, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, @@ -339,11 +332,6 @@ CO2SolubilityUpdate::compute( real64 const & pressure, } } -ENUM_STRINGS( CO2Solubility::SolubilityModel, - "DuanSun", - "SpycherPruess", - "Tables" ); - } // end namespace PVTProps } // end namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp index 6f2b3caf5b8..c7067552fff 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp @@ -35,13 +35,14 @@ namespace PVTProps { EzrokhiBrineDensity::EzrokhiBrineDensity( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): PVTFunctionBase( name, componentNames, - componentMolarWeight ) + componentMolarWeight ), + m_waterCompressibility( brineFluidParameters.m_waterCompressibility ) { string const expectedCO2ComponentNames[] = { "CO2", "co2" }; m_CO2Index = PVTFunctionHelpers::findName( componentNames, expectedCO2ComponentNames, "componentNames" ); @@ -49,7 +50,7 @@ EzrokhiBrineDensity::EzrokhiBrineDensity( string const & name, string const expectedWaterComponentNames[] = { "Water", "water" }; m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" ); - makeCoefficients( inputPara ); + makeCoefficients( brineFluidParameters.m_ezrokhiDensityCoefficients ); m_waterSatDensityTable = PureWaterProperties::makeSaturationDensityTable( m_functionName, FunctionManager::getInstance() ); m_waterSatPressureTable = PureWaterProperties::makeSaturationPressureTable( m_functionName, FunctionManager::getInstance() ); @@ -57,27 +58,13 @@ EzrokhiBrineDensity::EzrokhiBrineDensity( string const & name, m_waterSatDensityTable->outputTableData( pvtOutputOpts ); } -void EzrokhiBrineDensity::makeCoefficients( string_array const & inputPara ) +void EzrokhiBrineDensity::makeCoefficients( arrayView1d< real64 const > const & coefficients ) { // compute brine density following Ezrokhi`s method // Reference : Zaytsev, I.D. and Aseyev, G.G. Properties of Aqueous Solutions of Electrolytes, Boca Raton, Florida, USA CRC Press (1993). - - m_waterCompressibility = 4.5e-10; // Pa-1 - GEOS_THROW_IF_LT_MSG( inputPara.size(), 5, - GEOS_FMT( "{}: insufficient number of model parameters", m_functionName ), - InputError ); - - try - { - // assume CO2 is the only non-water component in the brine - m_coef0 = stod( inputPara[2] ); - m_coef1 = stod( inputPara[3] ); - m_coef2 = stod( inputPara[4] ); - } - catch( std::invalid_argument const & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value '{}'", m_functionName, e.what() ), InputError ); - } + m_coef0 = coefficients[0]; + m_coef1 = coefficients[1]; + m_coef2 = coefficients[2]; } void EzrokhiBrineDensity::checkTablesParameters( real64 const GEOS_UNUSED_PARAM( pressure ), diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp index 1c76f535cf6..3432590eaff 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp @@ -106,7 +106,7 @@ class EzrokhiBrineDensity : public PVTFunctionBase public: EzrokhiBrineDensity( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); @@ -138,7 +138,7 @@ class EzrokhiBrineDensity : public PVTFunctionBase private: - void makeCoefficients( string_array const & inputPara ); + void makeCoefficients( arrayView1d< real64 const > const & coefficients ); /// Table with water saturated density tabulated as a function (T) TableFunction const * m_waterSatDensityTable = nullptr; diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp index 605ede35515..8ae469f0055 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp @@ -35,7 +35,7 @@ namespace PVTProps { EzrokhiBrineViscosity::EzrokhiBrineViscosity( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -49,31 +49,19 @@ EzrokhiBrineViscosity::EzrokhiBrineViscosity( string const & name, string const expectedWaterComponentNames[] = { "Water", "water" }; m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" ); - makeCoefficients( inputPara ); + makeCoefficients( brineFluidParameters.m_ezrokhiViscosityCoefficients ); m_waterViscosityTable = PureWaterProperties::makeSaturationViscosityTable( m_functionName, FunctionManager::getInstance() ); m_waterViscosityTable->outputTableData( pvtOutputOpts ); } -void EzrokhiBrineViscosity::makeCoefficients( string_array const & inputPara ) +void EzrokhiBrineViscosity::makeCoefficients( arrayView1d< real64 const > const & coefficients ) { // compute brine viscosity following Ezrokhi`s method // Reference : Zaytsev, I.D. and Aseyev, G.G. Properties of Aqueous Solutions of Electrolytes, Boca Raton, Florida, USA CRC Press (1993). - GEOS_THROW_IF_LT_MSG( inputPara.size(), 5, - GEOS_FMT( "{}: insufficient number of model parameters", m_functionName ), - InputError ); - - try - { - // assume CO2 is the only non-water component in the brine - m_coef0 = stod( inputPara[2] ); - m_coef1 = stod( inputPara[3] ); - m_coef2 = stod( inputPara[4] ); - } - catch( std::invalid_argument const & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value '{}'", m_functionName, e.what() ), InputError ); - } + m_coef0 = coefficients[0]; + m_coef1 = coefficients[1]; + m_coef2 = coefficients[2]; } void EzrokhiBrineViscosity::checkTablesParameters( real64 const GEOS_UNUSED_PARAM( pressure ), diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp index 07fac03c1ee..7174853595c 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp @@ -95,7 +95,7 @@ class EzrokhiBrineViscosity : public PVTFunctionBase public: EzrokhiBrineViscosity( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); @@ -127,7 +127,7 @@ class EzrokhiBrineViscosity : public PVTFunctionBase private: - void makeCoefficients( string_array const & inputPara ); + void makeCoefficients( arrayView1d< real64 const > const & coefficients ); /// Table with water viscosity tabulated as a function (T) TableFunction const * m_waterViscosityTable = nullptr; diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp index da161b99874..516a09fa47e 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp @@ -88,7 +88,7 @@ void calculateCO2Viscosity( PTTableCoordinates const & tableCoords, } } -TableFunction const * makeViscosityTable( string_array const & inputParams, +TableFunction const * makeViscosityTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters, string const & functionName, FunctionManager & functionManager ) { @@ -105,20 +105,9 @@ TableFunction const * makeViscosityTable( string_array const & inputParams, else { PTTableCoordinates tableCoords; - PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); - real64 tolerance = 1e-10; - try - { - if( inputParams.size() >= 9 ) - { - tolerance = stod( inputParams[8] ); - } - } - catch( const std::invalid_argument & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const tolerance = brineFluidParameters.m_tolerance; localIndex const nP = tableCoords.nPressures(); localIndex const nT = tableCoords.nTemperatures(); @@ -139,7 +128,7 @@ TableFunction const * makeViscosityTable( string_array const & inputParams, } // namespace FenghourCO2Viscosity::FenghourCO2Viscosity( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ) @@ -147,7 +136,7 @@ FenghourCO2Viscosity::FenghourCO2Viscosity( string const & name, componentNames, componentMolarWeight ) { - m_CO2ViscosityTable = makeViscosityTable( inputParams, m_functionName, FunctionManager::getInstance() ); + m_CO2ViscosityTable = makeViscosityTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() ); m_CO2ViscosityTable->outputTableData( pvtOutputOpts ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp index 3212b51a268..3048793c630 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp @@ -73,7 +73,7 @@ class FenghourCO2Viscosity : public PVTFunctionBase public: FenghourCO2Viscosity( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp index 4be877cc7d7..c0df4b87075 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp @@ -68,7 +68,7 @@ class NoOpPVTFunction : public PVTFunctionBase public: NoOpPVTFunction( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ) @@ -76,7 +76,7 @@ class NoOpPVTFunction : public PVTFunctionBase componentNames, componentMolarWeight ) { - GEOS_UNUSED_VAR( inputPara, pvtOutputOpts ); + GEOS_UNUSED_VAR( brineFluidParameters, pvtOutputOpts ); } virtual ~NoOpPVTFunction() override = default; diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp index f1ce6247bd4..60554073e65 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp @@ -21,6 +21,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_PVTFUNCTIONBASE_HPP_ #include "dataRepository/ObjectCatalog.hpp" +#include "constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp" namespace geos { diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp index 02b7f42dd0a..da8b4c868e9 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp @@ -110,7 +110,7 @@ void calculatePureWaterDensity( PTTableCoordinates const & tableCoords, } } -TableFunction const * makeDensityTable( string_array const & inputParams, +TableFunction const * makeDensityTable( BrineFluidParameters const & brineFluidParameters, string const & functionName, FunctionManager & functionManager ) { @@ -126,24 +126,12 @@ TableFunction const * makeDensityTable( string_array const & inputParams, } else { - GEOS_THROW_IF_LT_MSG( inputParams.size(), 9, - GEOS_FMT( "{}: insufficient number of model parameters", functionName ), - InputError ); - // initialize the (p,T) coordinates PTTableCoordinates tableCoords; - PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); // initialize salinity - real64 salinity; - try - { - salinity = stod( inputParams[8] ); - } - catch( std::invalid_argument const & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const salinity = brineFluidParameters.m_salinity; array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() ); if( !isZero( salinity ) ) @@ -174,7 +162,7 @@ TableFunction const * makeDensityTable( string_array const & inputParams, } // namespace PhillipsBrineDensity::PhillipsBrineDensity( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -188,7 +176,7 @@ PhillipsBrineDensity::PhillipsBrineDensity( string const & name, string const expectedWaterComponentNames[] = { "Water", "water" }; m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" ); - m_brineDensityTable = makeDensityTable( inputParams, m_functionName, FunctionManager::getInstance() ); + m_brineDensityTable = makeDensityTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() ); m_brineDensityTable->outputTableData( pvtOutputOpts ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp index 67b740e3381..d94e60a30d0 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp @@ -83,7 +83,7 @@ class PhillipsBrineDensity : public PVTFunctionBase public: PhillipsBrineDensity( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp index 6ab93100f47..28c13ab8270 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp @@ -34,7 +34,7 @@ namespace PVTProps { PhillipsBrineViscosity::PhillipsBrineViscosity( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -43,27 +43,13 @@ PhillipsBrineViscosity::PhillipsBrineViscosity( string const & name, componentMolarWeight ) { m_waterViscosityTable = PureWaterProperties::makeSaturationViscosityTable( m_functionName, FunctionManager::getInstance() ); - makeCoefficients( inputPara ); + makeCoefficients( brineFluidParameters.m_salinity ); m_waterViscosityTable->outputTableData( pvtOutputOpts ); } -void PhillipsBrineViscosity::makeCoefficients( string_array const & inputPara ) +void PhillipsBrineViscosity::makeCoefficients( real64 const salinity ) { - GEOS_THROW_IF_LT_MSG( inputPara.size(), 3, - GEOS_FMT( "{}: insufficient number of model parameters", m_functionName ), - InputError ); - - real64 m; - try - { - m = stod( inputPara[2] ); - } - catch( std::invalid_argument const & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value '{}'", m_functionName, e.what() ), InputError ); - } - // these coefficients come from Phillips et al. (1981), equation (1), pages 5-6 constexpr real64 a = 0.0816; constexpr real64 b = 0.0122; @@ -73,6 +59,7 @@ void PhillipsBrineViscosity::makeCoefficients( string_array const & inputPara ) // precompute the model coefficients // (excluding water viscosity, which will multiply them in the compute function) + real64 const & m = salinity; m_coef0 = (1.0 + a * m + b * m * m + c * m * m * m); m_coef1 = d * (1.0 - exp( k * m )); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp index 5569ecc8507..53680b12356 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp @@ -81,7 +81,7 @@ class PhillipsBrineViscosity : public PVTFunctionBase public: PhillipsBrineViscosity( string const & name, - string_array const & inputPara, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); @@ -113,7 +113,7 @@ class PhillipsBrineViscosity : public PVTFunctionBase private: - void makeCoefficients( string_array const & inputPara ); + void makeCoefficients( real64 const salinity ); /// Table with water viscosity tabulated as a function (T) TableFunction const * m_waterViscosityTable = nullptr; diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp index 554118fe552..92b928f9286 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp @@ -208,7 +208,7 @@ real64 spanWagnerCO2DensityFunction( string const & name, } -TableFunction const * makeDensityTable( string_array const & inputParams, +TableFunction const * makeDensityTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters, string const & functionName, FunctionManager & functionManager ) { @@ -225,20 +225,9 @@ TableFunction const * makeDensityTable( string_array const & inputParams, else { PTTableCoordinates tableCoords; - PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords ); + constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords ); - real64 tolerance = 1e-10; - try - { - if( inputParams.size() >= 9 ) - { - tolerance = stod( inputParams[8] ); - } - } - catch( const std::invalid_argument & e ) - { - GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError ); - } + real64 const tolerance = brineFluidParameters.m_tolerance; array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() ); SpanWagnerCO2Density::calculateCO2Density( functionName, tolerance, tableCoords, densities ); @@ -276,7 +265,7 @@ void SpanWagnerCO2Density::calculateCO2Density( string const & functionName, } SpanWagnerCO2Density::SpanWagnerCO2Density( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -287,7 +276,7 @@ SpanWagnerCO2Density::SpanWagnerCO2Density( string const & name, string const expectedCO2ComponentNames[] = { "CO2", "co2" }; m_CO2Index = PVTFunctionHelpers::findName( componentNames, expectedCO2ComponentNames, "componentNames" ); - m_CO2DensityTable = makeDensityTable( inputParams, m_functionName, FunctionManager::getInstance() ); + m_CO2DensityTable = makeDensityTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() ); m_CO2DensityTable->outputTableData( pvtOutputOpts ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp index 002c1384aa0..8209048183b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp @@ -78,7 +78,7 @@ class SpanWagnerCO2Density : public PVTFunctionBase public: SpanWagnerCO2Density( string const &, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp index 5d8827423db..d27c64337ed 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp @@ -34,7 +34,7 @@ namespace PVTProps WaterDensity::WaterDensity( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ): @@ -42,7 +42,7 @@ WaterDensity::WaterDensity( string const & name, componentNames, componentMolarWeight ) { - GEOS_UNUSED_VAR( inputParams ); + GEOS_UNUSED_VAR( brineFluidParameters ); m_waterDensityTable = PureWaterProperties::makeSaturationDensityTable( m_functionName, FunctionManager::getInstance() ); m_waterDensityTable->outputTableData( pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp index 3e65cad07d0..1e21d029cc1 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp @@ -73,7 +73,7 @@ class WaterDensity : public PVTFunctionBase public: WaterDensity( string const & name, - string_array const & inputParams, + BrineFluidParameters const & brineFluidParameters, string_array const & componentNames, array1d< real64 > const & componentMolarWeight, TableFunction::OutputOptions const pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp index cbcd30ab204..c74f458d79f 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp @@ -66,17 +66,15 @@ ReactiveBrineFluid< PHASE > :: ReactiveBrineFluid( string const & name, Group * const parent ): ReactiveMultiFluid( name, parent ) { - registerWrapper( viewKeyStruct::phasePVTParaFilesString(), &m_phasePVTParaFiles ). - setInputFlag( InputFlags::REQUIRED ). - setRestartFlags( RestartFlags::NO_WRITE ). - setDescription( "Names of the files defining the parameters of the viscosity and density models" ); - - this->registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ). + registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ). setApplyDefaultValue( 0 ). setInputFlag( InputFlags::OPTIONAL ). setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "When set to 1, write PVT tables into a CSV file" ); + // Attach the fluid properties + m_brineFluidParameters.registerOnFluid< false, false, false >( this ); + // if this is a thermal model, we need to make sure that the arrays will be properly displayed and saved to restart if( isThermal() ) { @@ -93,12 +91,11 @@ ReactiveBrineFluid( string const & name, Group * const parent ): } template< typename PHASE > -bool ReactiveBrineFluid< PHASE > ::isThermal() const +bool ReactiveBrineFluid< PHASE >::isThermal() const { - return ( PHASE::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() ); + return isThermalType(); } - template< typename PHASE > std::unique_ptr< ConstitutiveBase > ReactiveBrineFluid< PHASE > :: @@ -130,79 +127,16 @@ void ReactiveBrineFluid< PHASE > ::postInputInitialization() GEOS_THROW_IF_NE_MSG( numFluidPhases(), 1, GEOS_FMT( "{}: invalid number of phases", getFullName() ), InputError ); - GEOS_THROW_IF_NE_MSG( m_phasePVTParaFiles.size(), 1, - GEOS_FMT( "{}: invalid number of values in attribute '{}'", getFullName() ), - InputError ); + + // Validate the brine fluid properties + m_brineFluidParameters.postInputInitialization< false, false, false >( this ); createPVTModels(); } template< typename PHASE > -void ReactiveBrineFluid< PHASE > ::createPVTModels() +void ReactiveBrineFluid< PHASE >::createPVTModels() { - // TODO: get rid of these external files and move into XML, this is too error prone - // For now, to support the legacy input, we read all the input parameters at once in the arrays below, and then we create the models - stdVector< string_array > phase1InputParams; - phase1InputParams.resize( 3 ); - - // 1) Create the viscosity, density, enthalpy models - for( string const & filename : m_phasePVTParaFiles ) - { - std::ifstream is( filename ); - string str; - while( std::getline( is, str ) ) - { - string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str ); - - if( !strs.empty() ) - { - GEOS_THROW_IF( strs.size() < 2, - GEOS_FMT( "{}: missing PVT model in line '{}'", getFullName(), str ), - InputError ); - - if( strs[0] == "DensityFun" ) - { - if( strs[1] == PHASE::Density::catalogName() ) - { - phase1InputParams[PHASE::InputParamOrder::DENSITY] = strs; - } - } - else if( strs[0] == "ViscosityFun" ) - { - if( strs[1] == PHASE::Viscosity::catalogName() ) - { - phase1InputParams[PHASE::InputParamOrder::VISCOSITY] = strs; - } - } - else if( strs[0] == "EnthalpyFun" ) - { - if( strs[1] == PHASE::Enthalpy::catalogName() ) - { - phase1InputParams[PHASE::InputParamOrder::ENTHALPY] = strs; - } - } - else - { - GEOS_THROW( GEOS_FMT( "{}: invalid PVT function type '{}'", getFullName(), strs[0] ), InputError ); - } - } - } - is.close(); - } - - // at this point, we have read the file and we check the consistency of non-thermal models - GEOS_THROW_IF( phase1InputParams[PHASE::InputParamOrder::DENSITY].empty(), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE::Density::catalogName() ), - InputError ); - GEOS_THROW_IF( phase1InputParams[PHASE::InputParamOrder::VISCOSITY].empty(), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE::Viscosity::catalogName() ), - InputError ); - // we also detect any inconsistency arising in the enthalpy models - GEOS_THROW_IF( phase1InputParams[PHASE::InputParamOrder::ENTHALPY].empty() && - ( PHASE::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() ), - GEOS_FMT( "{}: PVT model {} not found in input files", getFullName(), PHASE::Enthalpy::catalogName() ), - InputError ); - bool const isClone = this->isClone(); TableFunction::OutputOptions const pvtOutputOpts = { !isClone && m_writeCSV,// writeCSV @@ -210,7 +144,10 @@ void ReactiveBrineFluid< PHASE > ::createPVTModels() }; // then, we are ready to instantiate the phase models - m_phase = std::make_unique< PHASE >( getName() + "_phaseModel1", phase1InputParams, m_componentNames, m_componentMolarWeight, + m_phase = std::make_unique< PHASE >( getName() + "_phaseModel1", + m_brineFluidParameters, + m_componentNames, + m_componentMolarWeight, pvtOutputOpts ); } @@ -231,9 +168,7 @@ void ReactiveBrineFluid< PHASE >::checkTablesParameters( real64 const pressure, m_phase->enthalpy.checkTablesParameters( pressure, temperatureInCelsius ); } catch( SimulationError const & ex ) { - string const errorMsg = GEOS_FMT( "Table input error (in table from {}).\n", - stringutilities::join( m_phasePVTParaFiles ) ); - throw SimulationError( ex, errorMsg ); + throw ex; } } diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp index f1d88712b00..4233273244c 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp @@ -57,6 +57,11 @@ class ReactiveBrineFluid : public ReactiveMultiFluid static string catalogName(); + static constexpr bool isThermalType() + { + return !( std::is_same_v< typename PHASE::Enthalpy, PVTProps::NoOpPVTFunction > ); + } + virtual string getCatalogName() const override { return catalogName(); } virtual bool isThermal() const override final; @@ -151,7 +156,6 @@ class ReactiveBrineFluid : public ReactiveMultiFluid struct viewKeyStruct : ReactiveMultiFluid::viewKeyStruct { - static constexpr char const * phasePVTParaFilesString() { return "phasePVTParaFiles"; } static constexpr char const * writeCSVFlagString() { return "writeCSV"; } }; @@ -166,8 +170,8 @@ class ReactiveBrineFluid : public ReactiveMultiFluid */ void createPVTModels(); - /// Names of the files defining the viscosity and density models - path_array m_phasePVTParaFiles; + /// All brine model properties + PVTProps::BrineFluidParameters m_brineFluidParameters{}; /// Output csv file containing informations about PVT integer m_writeCSV; From ab066eaff44429936411d422f453045307a693b3 Mon Sep 17 00:00:00 2001 From: dkachuma Date: Fri, 15 Aug 2025 10:26:01 -0500 Subject: [PATCH 2/5] Edit integrated tests --- .../benchmarks/SPE11/b/spe11b_vti_source_base.xml | 6 ++++-- .../benchmarks/SPE11/b/tables/co2flash_thermal.txt | 1 - .../SPE11/b/tables/co2flash_thermal_Spycher.txt | 1 - .../benchmarks/SPE11/b/tables/pvtdriver.xml | 6 ++++-- .../benchmarks/SPE11/b/tables/pvtgas_thermal.txt | 3 --- .../benchmarks/SPE11/b/tables/pvtliquid_thermal.txt | 3 --- .../benchmarks/thermalLeakyWell/co2flash.txt | 1 - .../benchmarks/thermalLeakyWell/pvtgas.txt | 2 -- .../benchmarks/thermalLeakyWell/pvtliquid.txt | 2 -- .../thermalLeakyWell/thermalLeakyWell_base_direct.xml | 7 +++++-- .../thermalLeakyWell/thermalLeakyWell_base_iterative.xml | 7 +++++-- inputFiles/compositionalMultiphaseFlow/co2_flux_3d.xml | 6 ++++-- .../compositionalMultiphaseFlow/co2_flux_dirichlet.xml | 6 ++++-- inputFiles/compositionalMultiphaseFlow/co2_hybrid_1d.xml | 6 ++++-- inputFiles/compositionalMultiphaseFlow/co2flash.txt | 1 - .../co2_2d_plume/co2_2d_plume_Z.xml | 6 ++++-- .../co2_2d_plume/co2flash.txt | 1 - .../co2_2d_plume/pvtgas.txt | 2 -- .../co2_2d_plume/pvtliquid.txt | 2 -- .../gravitySegregation/co2flash.txt | 1 - .../gravitySegregation/grav_seg_base.xml | 6 ++++-- .../gravitySegregation/pvtgas.txt | 2 -- .../gravitySegregation/pvtliquid.txt | 2 -- inputFiles/compositionalMultiphaseFlow/pvtgas.txt | 2 -- inputFiles/compositionalMultiphaseFlow/pvtliquid.txt | 2 -- .../Class09Pb3/class09_pb3_drainageOnly_direct_base.xml | 9 +++++++-- .../class09_pb3_drainageOnly_iterative_base.xml | 9 +++++++-- .../Class09Pb3/class09_pb3_hystRelperm_direct_base.xml | 9 +++++++-- .../class09_pb3_hystRelperm_iterative_base.xml | 9 +++++++-- .../benchmarks/Class09Pb3/tables/co2flash.txt | 1 - .../benchmarks/Class09Pb3/tables/pvtgas.txt | 2 -- .../benchmarks/Class09Pb3/tables/pvtliquid_ez.txt | 2 -- inputFiles/compositionalMultiphaseWell/co2flash.txt | 1 - .../isothm_mass_inj_table.xml | 6 ++++-- .../compositionalMultiphaseWell/isothm_vol_inj_table.xml | 6 ++++-- inputFiles/compositionalMultiphaseWell/pvtgas.txt | 2 -- inputFiles/compositionalMultiphaseWell/pvtliquid.txt | 2 -- .../simpleCo2InjTutorial_base.xml | 6 ++++-- .../staircase_co2_wells_3d.xml | 6 ++++-- .../staircase_co2_wells_hybrid_3d.xml | 6 ++++-- .../PoroElastic_hybridHexPrism_co2_base.xml | 7 +++++-- .../poromechanics/PoroElastic_staircase_co2_3d_base.xml | 7 +++++-- .../PoroElastic_staircase_co2_3d_base_stab.xml | 7 +++++-- inputFiles/poromechanics/pvt_tables/co2flash.txt | 1 - inputFiles/poromechanics/pvt_tables/pvtgas.txt | 2 -- inputFiles/poromechanics/pvt_tables/pvtliquid.txt | 2 -- inputFiles/poromechanicsFractures/co2flash.txt | 1 - .../multiphasePoromechanics_FaultModel_base.xml | 6 ++++-- inputFiles/poromechanicsFractures/pvtgas.txt | 2 -- inputFiles/poromechanicsFractures/pvtliquid.txt | 2 -- inputFiles/thermalMultiphaseFlow/co2_thermal_2d.xml | 6 ++++-- inputFiles/thermalMultiphaseFlow/co2flash.txt | 1 - inputFiles/thermalMultiphaseFlow/pvtgas.txt | 3 --- inputFiles/thermalMultiphaseFlow/pvtliquid.txt | 3 --- .../ThermoPoroElastic_staircase_co2_smoke.xml | 7 +++++-- inputFiles/thermoPoromechanics/pvt_tables/co2flash.txt | 1 - inputFiles/thermoPoromechanics/pvt_tables/pvtgas.txt | 3 --- inputFiles/thermoPoromechanics/pvt_tables/pvtliquid.txt | 3 --- .../compositionalMultiphaseFlow/ECP_Wellbore_probdef.xml | 6 ++++-- .../wellboreECP/compositionalMultiphaseFlow/co2flash.txt | 1 - .../wellboreECP/compositionalMultiphaseFlow/pvtgas.txt | 2 -- .../compositionalMultiphaseFlow/pvtliquid.txt | 2 -- 62 files changed, 118 insertions(+), 117 deletions(-) delete mode 100755 inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/co2flash_thermal.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/co2flash_thermal_Spycher.txt delete mode 100755 inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/co2flash.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/overallCompositionFormulation/co2_2d_plume/co2flash.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/overallCompositionFormulation/co2_2d_plume/pvtgas.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/overallCompositionFormulation/co2_2d_plume/pvtliquid.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/overallCompositionFormulation/gravitySegregation/co2flash.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/overallCompositionFormulation/gravitySegregation/pvtgas.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/overallCompositionFormulation/gravitySegregation/pvtliquid.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/pvtgas.txt delete mode 100644 inputFiles/compositionalMultiphaseFlow/pvtliquid.txt delete mode 100755 inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/tables/co2flash.txt delete mode 100755 inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/tables/pvtgas.txt delete mode 100755 inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/tables/pvtliquid_ez.txt delete mode 100644 inputFiles/compositionalMultiphaseWell/co2flash.txt delete mode 100644 inputFiles/compositionalMultiphaseWell/pvtgas.txt delete mode 100644 inputFiles/compositionalMultiphaseWell/pvtliquid.txt delete mode 100644 inputFiles/poromechanics/pvt_tables/co2flash.txt delete mode 100644 inputFiles/poromechanics/pvt_tables/pvtgas.txt delete mode 100644 inputFiles/poromechanics/pvt_tables/pvtliquid.txt delete mode 100644 inputFiles/poromechanicsFractures/co2flash.txt delete mode 100644 inputFiles/poromechanicsFractures/pvtgas.txt delete mode 100644 inputFiles/poromechanicsFractures/pvtliquid.txt delete mode 100644 inputFiles/thermalMultiphaseFlow/co2flash.txt delete mode 100644 inputFiles/thermalMultiphaseFlow/pvtgas.txt delete mode 100644 inputFiles/thermalMultiphaseFlow/pvtliquid.txt delete mode 100644 inputFiles/thermoPoromechanics/pvt_tables/co2flash.txt delete mode 100644 inputFiles/thermoPoromechanics/pvt_tables/pvtgas.txt delete mode 100644 inputFiles/thermoPoromechanics/pvt_tables/pvtliquid.txt delete mode 100644 inputFiles/wellboreECP/compositionalMultiphaseFlow/co2flash.txt delete mode 100644 inputFiles/wellboreECP/compositionalMultiphaseFlow/pvtgas.txt delete mode 100644 inputFiles/wellboreECP/compositionalMultiphaseFlow/pvtliquid.txt diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml index c57445ffb61..b04ec9f95e1 100644 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml +++ b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml @@ -81,8 +81,10 @@ logLevel="0" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ tables/pvtgas_thermal.txt, tables/pvtliquid_thermal.txt }" - flashModelParaFile="tables/co2flash_thermal.txt" /> + pressureCoordinates="{1e5, 5.e7}" + pressureInterval="1e6" + temperatureCoordinates="{283.15, 353.5}" + temperatureInterval="2.5" /> + pressureCoordinates="{1e5, 5.e7}" + pressureInterval="1e6" + temperatureCoordinates="{283.15, 353.5}" + temperatureInterval="2.5" /> diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt deleted file mode 100755 index 3383d920865..00000000000 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt +++ /dev/null @@ -1,3 +0,0 @@ -DensityFun SpanWagnerCO2Density 1e5 5.e7 1e6 283.15 353.5 2.5 -ViscosityFun FenghourCO2Viscosity 1e5 5.e7 1e6 283.15 353.5 2.5 -EnthalpyFun CO2Enthalpy 1.e5 5.e7 1e6 283.15 353.5 2.5 diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt deleted file mode 100644 index b912980f9db..00000000000 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt +++ /dev/null @@ -1,3 +0,0 @@ -DensityFun PhillipsBrineDensity 1e5 5.e7 1e6 283.15 353.15 2.5 0 -ViscosityFun PhillipsBrineViscosity 0 -EnthalpyFun BrineEnthalpy 1e5 5.e7 1e6 283.15 353.15 2.5 0 diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt deleted file mode 100644 index d02e891352d..00000000000 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt +++ /dev/null @@ -1 +0,0 @@ -FlashModel CO2Solubility 6.6e6 4e7 1e6 302.0 312.0 5 1.901285269 diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt deleted file mode 100644 index 57977514453..00000000000 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt +++ /dev/null @@ -1,2 +0,0 @@ -DensityFun SpanWagnerCO2Density 6.6e6 4e7 1e6 302.0 312.0 5 -ViscosityFun FenghourCO2Viscosity 6.6e6 4e7 1e6 302.0 312.0 5 diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt deleted file mode 100644 index 6f6cea73c28..00000000000 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt +++ /dev/null @@ -1,2 +0,0 @@ -DensityFun PhillipsBrineDensity 6.6e6 4e7 1e6 302.0 312.0 5 1.901285269 -ViscosityFun PhillipsBrineViscosity 1.901285269 diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base_direct.xml b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base_direct.xml index 961d7c6d00d..df406481ced 100644 --- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base_direct.xml +++ b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base_direct.xml @@ -109,8 +109,11 @@ phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" - flashModelParaFile="co2flash.txt"/> + pressureCoordinates="{6.6e6, 4e7}" + pressureInterval="1e6" + temperatureCoordinates="{302.0, 312.0}" + temperatureInterval="5" + salinity="1.901285269" /> + pressureCoordinates="{6.6e6, 4e7}" + pressureInterval="1e6" + temperatureCoordinates="{302.0, 312.0}" + temperatureInterval="5" + salinity="1.901285269" /> + pressureCoordinates="{1e6, 1.5e7}" + pressureInterval="5e4" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> + pressureCoordinates="{1e6, 1.5e7}" + pressureInterval="5e4" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> + pressureCoordinates="{1e6, 1.5e7}" + pressureInterval="5e4" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> + pressureCoordinates="{5e5, 1.5e7}" + pressureInterval="5e4" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> + pressureCoordinates="{5e5, 1.5e7}" + pressureInterval="5e4" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> + pressureCoordinates="{1.0e5, 6e7}" + pressureInterval="1e5" + temperatureCoordinates="{283.15, 393.5}" + temperatureInterval="5" + salinity="1.901285269" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0, 0, 0}" /> + pressureCoordinates="{1.0e5, 6e7}" + pressureInterval="1e5" + temperatureCoordinates="{283.15, 393.5}" + temperatureInterval="5" + salinity="1.901285269" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0, 0, 0}" /> diff --git a/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml b/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml index 97f77545736..2161c9d628e 100644 --- a/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml +++ b/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml @@ -72,8 +72,13 @@ phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ tables/pvtgas.txt, tables/pvtliquid_ez.txt }" - flashModelParaFile="tables/co2flash.txt"/> + pressureCoordinates="{1.0e5, 6e7}" + pressureInterval="1e5" + temperatureCoordinates="{283.15, 393.5}" + temperatureInterval="5" + salinity="1.901285269" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0, 0, 0}" /> + pressureCoordinates="{1.0e5, 6e7}" + pressureInterval="1e5" + temperatureCoordinates="{283.15, 393.5}" + temperatureInterval="5" + salinity="1.901285269" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0, 0, 0}" /> + pressureCoordinates="{1.0e5, 7.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{285.15, 395.15}" + temperatureInterval="5" /> + pressureCoordinates="{1.0e5, 7.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{285.15, 395.15}" + temperatureInterval="5" /> + pressureCoordinates="{1.0e5, 7.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{285.15, 395.15}" + temperatureInterval="5" /> + pressureCoordinates="{1.0e5, 7.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{285.15, 395.15}" + temperatureInterval="5" /> + pressureCoordinates="{1.0e5, 7.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{285.15, 395.15}" + temperatureInterval="5" /> + pressureCoordinates="{1e5, 5e7}" + pressureInterval="5e5" + temperatureCoordinates="{288, 368}" + temperatureInterval="10" + salinity="2.5" /> + pressureCoordinates="{1e5, 5e7}" + pressureInterval="5e5" + temperatureCoordinates="{288, 368}" + temperatureInterval="10" + salinity="2.5" /> + pressureCoordinates="{1e5, 5e7}" + pressureInterval="5e5" + temperatureCoordinates="{288, 368}" + temperatureInterval="10" + salinity="2.5" /> + pressureCoordinates="{1e6, 10e7}" + pressureInterval="5e4" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> + pressureCoordinates="{1.0e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{299.15, 369.15}" + temperatureInterval="10.0" /> + pressureCoordinates="{1e5, 5e7}" + pressureInterval="5e5" + temperatureCoordinates="{288, 368}" + temperatureInterval="10" + salinity="2.5" /> + pressureCoordinates="{1e6, 5e7}" + pressureInterval="5e5" + temperatureCoordinates="{367.15, 369.15}" + temperatureInterval="1" /> Date: Fri, 15 Aug 2025 12:17:38 -0500 Subject: [PATCH 3/5] Unit tests --- .../functions/BrineFluidParameters.cpp | 21 +- .../functions/BrineFluidParameters.hpp | 6 + .../unitTests/FluidModelTest_impl.hpp | 2 +- .../unitTests/testCO2BrinePVTModels.cpp | 380 ++++++------------ .../unitTests/testCO2SpycherPruessModels.cpp | 26 +- .../unitTests/testMultiFluidCO2Brine.cpp | 210 +++++----- 6 files changed, 260 insertions(+), 385 deletions(-) diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp index 50241883ad4..1f1cb87ee76 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp @@ -188,6 +188,23 @@ void BrineFluidParameters::postInputInitialization( MultiFluidBase * fluid ) "Values must be strictly increasing.", fullName, viewKeyStruct::temperatureCoordinatesString() ), InputError ); + real64 const minTemp = m_temperatureCoordinates[0]; + real64 const maxTemp = m_temperatureCoordinates[m_temperatureCoordinates.size()-1]; + real64 const minTempInK = units::convertCToK( minimumTemperature ); + real64 const maxTempInK = units::convertCToK( maximumTemperature ); + GEOS_THROW_IF_LT_MSG( minTemp, minTempInK, + GEOS_FMT( "{}: Minimum temperature must be at least {}K ({} in C). " + "The lowest value provided in {} is {}K", fullName, + minTempInK, minimumTemperature, + viewKeyStruct::temperatureCoordinatesString(), minTemp ), + InputError ); + GEOS_THROW_IF_GT_MSG( maxTemp, maxTempInK, + GEOS_FMT( "{}: Maximum temperature must be at most {}K ({} in C). " + "The highest value provided in {} is {}K", fullName, + maxTempInK, minimumTemperature, + viewKeyStruct::temperatureCoordinatesString(), maxTemp ), + InputError ); + if constexpr ( EZROKHI_DENSITY ) { if( m_ezrokhiDensityCoefficients.empty()) @@ -256,14 +273,14 @@ void BrineFluidParameters::initializePropertyTable( BrineFluidParameters const & real64 const endTemperature = fluidParameters.m_temperatureCoordinates[n-1]; for( real64 temperature = startTemperature; temperature <= endTemperature; temperature += dT ) { - tableCoords.appendPressure( temperature ); + tableCoords.appendTemperature( units::convertKToC( temperature ) ); } } else { for( real64 const temperature : fluidParameters.m_temperatureCoordinates ) { - tableCoords.appendTemperature( temperature ); + tableCoords.appendTemperature( units::convertKToC( temperature ) ); } } } diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp index 0c1338e7efd..4b6084b65a7 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp @@ -37,6 +37,11 @@ class PTTableCoordinates; /// A structure to contain the properties required to create a brine fluid model struct BrineFluidParameters { + // Temperature limits for the correlation used (in C) + static real64 constexpr minimumTemperature = 10.0; + static real64 constexpr maximumTemperature = 200.0; + + // Solubility models enum class SolubilityModel : integer { DuanSun, @@ -110,6 +115,7 @@ struct BrineFluidParameters * @brief Populate the coordinate table with pressure and temperature * @param[in] fluidProperties the user provided properties * @param[out] tableCoords the (p,T) coordinates of the table + * @note This will output temperatures in C */ static void initializePropertyTable( BrineFluidParameters const & fluidParameters, PTTableCoordinates & tableCoords ); diff --git a/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp b/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp index 72cfec6501c..99d94e50565 100644 --- a/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp +++ b/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp @@ -115,7 +115,7 @@ testValuesAgainstPreviousImplementation( FluidModel * fluid, "\n{} failed.\n" "Pressure: {}, Temperature: {} Composition: {}.\n" "Calculated: {}.\n" - "Expacted: {}\n" + "Expected: {}\n" "Difference: {}", name, pressure, temperature, toString( compositionView[0].toSliceConst() ), diff --git a/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp b/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp index d9cdfbf1704..0cbe8e7708b 100644 --- a/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp +++ b/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp @@ -31,25 +31,60 @@ using namespace geos::stringutilities; using namespace geos::constitutive::PVTProps; using namespace geos::constitutive::multifluid; -/// Input tables written into temporary files during testing - -static const char * pvtLiquidPhillipsTableContent = "DensityFun PhillipsBrineDensity 1e6 1.5e7 5e4 367.15 369.15 1 0.2\n" - "ViscosityFun PhillipsBrineViscosity 0.1"; - -// Used also for gas phase -static const char * pvtLiquidEnthalpyTableContent = "EnthalpyFun BrineEnthalpy 1e6 1.5e7 5e4 367.15 369.15 1 0.2"; +template< typename MODEL > +struct Parameters +{ + static void populate( BrineFluidParameters & parameters ) + { + parameters.m_pressureCoordinates.emplace_back( 1.0e6 ); + parameters.m_pressureCoordinates.emplace_back( 1.5e7 ); + parameters.m_pressureInterval = 5.0e4; + parameters.m_temperatureCoordinates.emplace_back( 367.15 ); + parameters.m_temperatureCoordinates.emplace_back( 369.15 ); + parameters.m_temperatureInterval = 1.0; + parameters.m_salinity = 0.2; + parameters.m_ezrokhiDensityCoefficients.emplace_back( 2.01e-6 ); + parameters.m_ezrokhiDensityCoefficients.emplace_back( -6.34e-7 ); + parameters.m_ezrokhiDensityCoefficients.emplace_back( 1e-4 ); + parameters.m_ezrokhiViscosityCoefficients.emplace_back( 2.42e-7 ); + parameters.m_ezrokhiViscosityCoefficients.emplace_back( 0.0 ); + parameters.m_ezrokhiViscosityCoefficients.emplace_back( 1e-4 ); + } +}; -// the last are set relatively high (1e-4) to increase derivative value and check it properly -// This string has some more various whitespace values in it to test if everything goes well anyway. -static const char * pvtLiquidEzrokhiTableContent = "\tDensityFun EzrokhiBrineDensity 2.01e-6 -6.34e-7 1e-4\n\r" - "\tViscosityFun EzrokhiBrineViscosity 2.42e-7 0 1e-4\n\r\n\r"; +template<> +struct Parameters< PhillipsBrineViscosity > +{ + static void populate( BrineFluidParameters & parameters ) + { + Parameters< NoOpPVTFunction >::populate( parameters ); + parameters.m_salinity = 0.1; + } +}; -static const char * pvtGasTableContent = "DensityFun SpanWagnerCO2Density 1e5 7.5e7 5e4 285.15 369.15 4.0\n" // we want to test the full - // (pres, temp) range here - "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1.0"; +template<> +struct Parameters< SpanWagnerCO2Density > +{ + static void populate( BrineFluidParameters & parameters ) + { + Parameters< NoOpPVTFunction >::populate( parameters ); + parameters.m_pressureCoordinates[0] = 1.0e5; + parameters.m_pressureCoordinates[1] = 7.5e7; + parameters.m_temperatureCoordinates[0] = 285.15; + parameters.m_temperatureCoordinates[1] = 369.15; + parameters.m_temperatureInterval = 4.0; + } +}; -static const char * co2FlashTableContent = "FlashModel CO2Solubility 1e5 7.5e7 5e4 285.15 369.15 4.0 0.15"; // we want to test the full - // (pres, temp) range here +template<> +struct Parameters< CO2Solubility > +{ + static void populate( BrineFluidParameters & parameters ) + { + Parameters< SpanWagnerCO2Density >::populate( parameters ); + parameters.m_salinity = 0.15; + } +}; template< typename PVT_WRAPPER > void testValuesAgainstPreviousImplementation( PVT_WRAPPER const & pvtFunctionWrapper, @@ -313,129 +348,100 @@ void testNumericalDerivatives( FLASH_WRAPPER const & flashModelWrapper, } } } - -} - -void writeTableToFile( string const & filename, char const * str ) -{ - std::ofstream os( filename ); - ASSERT_TRUE( os.is_open() ); - os << str; - os.close(); -} - -void removeFile( string const & filename ) -{ - int const ret = std::remove( filename.c_str() ); - ASSERT_TRUE( ret == 0 ); } template< typename MODEL > -std::unique_ptr< MODEL > makePVTFunction( string const & filename, - string const & key ) +std::unique_ptr< MODEL > makePVTFunction() { // define component names and molar weight string_array componentNames; componentNames.resize( 2 ); - componentNames[0] = "co2"; componentNames[1] = "water"; + componentNames[0] = "co2"; + componentNames[1] = "water"; array1d< real64 > componentMolarWeight; componentMolarWeight.resize( 2 ); - componentMolarWeight[0] = 44e-3; componentMolarWeight[1] = 18e-3; - - // read parameters from file - std::ifstream is( filename ); - std::unique_ptr< MODEL > pvtFunction = nullptr; - string str; - while( std::getline( is, str ) ) - { - string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str ); - - TableFunction::OutputOptions const pvtOutputOpts = { - true,// writeCSV - true, // writeInLog - }; - - if( strs.size()>1 && strs[0] == key ) - { - pvtFunction = std::make_unique< MODEL >( strs[1], - strs, - componentNames, - componentMolarWeight, - pvtOutputOpts ); - } - } - GEOS_ERROR_IF( pvtFunction == nullptr, - "Could not find " << key << " in " << filename ); - - return pvtFunction; + componentMolarWeight[0] = 44e-3; + componentMolarWeight[1] = 18e-3; + + TableFunction::OutputOptions const outputOpts = { + true, // writeCSV + true, // writeInLog + }; + + // Create parameters + BrineFluidParameters parameters; + Parameters< MODEL >::populate( parameters ); + + return std::make_unique< MODEL >( MODEL::catalogName(), + parameters, + componentNames, + componentMolarWeight, + outputOpts ); } -template< typename MODEL > -std::unique_ptr< MODEL > makeFlashModel( string const & filename, - string const & key ) +template<> +std::unique_ptr< CO2Solubility > makePVTFunction< CO2Solubility >() { // define phase names string_array phaseNames; phaseNames.resize( 2 ); - phaseNames[0] = "gas"; phaseNames[1] = "liquid"; + phaseNames[0] = "gas"; + phaseNames[1] = "liquid"; // define component names and molar weight string_array componentNames; componentNames.resize( 2 ); - componentNames[0] = "co2"; componentNames[1] = "water"; + componentNames[0] = "co2"; + componentNames[1] = "water"; array1d< real64 > componentMolarWeight; componentMolarWeight.resize( 2 ); - componentMolarWeight[0] = 44e-3; componentMolarWeight[1] = 18e-3; - - // read parameters from file - std::ifstream is( filename ); - std::unique_ptr< MODEL > flashModel; - string str; - while( std::getline( is, str ) ) - { - string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str ); - TableFunction::OutputOptions const flashOutputOpts = { - true, // writeCSV - true, // writeInLog - }; - if( strs.size()>1 && strs[0] == key ) - { - flashModel = std::make_unique< MODEL >( strs[1], - strs, - phaseNames, - componentNames, - componentMolarWeight, - flashOutputOpts ); - } - } - GEOS_ERROR_IF( flashModel == nullptr, - "Could not find " << key << " in " << filename ); - - return flashModel; + componentMolarWeight[0] = 44e-3; + componentMolarWeight[1] = 18e-3; + + TableFunction::OutputOptions const outputOpts = { + true, // writeCSV + true, // writeInLog + }; + + // Create parameters + BrineFluidParameters parameters; + Parameters< CO2Solubility >::populate( parameters ); + + return std::make_unique< CO2Solubility >( CO2Solubility::catalogName(), + parameters, + phaseNames, + componentNames, + componentMolarWeight, + outputOpts ); } -class PhillipsBrineViscosityTest : public ::testing::Test +template< typename MODEL > +class CO2BrineModelTestFixture : public ::testing::Test { public: - PhillipsBrineViscosityTest() + CO2BrineModelTestFixture() { - writeTableToFile( filename, pvtLiquidPhillipsTableContent ); - pvtFunction = makePVTFunction< PhillipsBrineViscosity >( filename, key ); + pvtFunction = makePVTFunction< MODEL >(); } - ~PhillipsBrineViscosityTest() override - { - removeFile( filename ); - } + ~CO2BrineModelTestFixture() override = default; protected: - string const key = "ViscosityFun"; - string const filename = "pvtliquid.txt"; - std::unique_ptr< PhillipsBrineViscosity > pvtFunction; + std::unique_ptr< MODEL > pvtFunction{}; }; +using PhillipsBrineViscosityTest = CO2BrineModelTestFixture< PhillipsBrineViscosity >; +using EzrokhiBrineViscosityTest = CO2BrineModelTestFixture< EzrokhiBrineViscosity >; +using FenghourCO2ViscosityTest = CO2BrineModelTestFixture< FenghourCO2Viscosity >; +using PhillipsBrineDensityTest = CO2BrineModelTestFixture< PhillipsBrineDensity >; +using EzrokhiBrineDensityTest = CO2BrineModelTestFixture< EzrokhiBrineDensity >; +using SpanWagnerCO2DensityTest = CO2BrineModelTestFixture< SpanWagnerCO2Density >; +using CO2SolubilityTest = CO2BrineModelTestFixture< CO2Solubility >; +using BrineEnthalpyTest = CO2BrineModelTestFixture< BrineEnthalpy >; +using CO2EnthalpyTest = CO2BrineModelTestFixture< CO2Enthalpy >; + TEST_F( PhillipsBrineViscosityTest, brineViscosityValuesAndDeriv ) { real64 const P[3] = { 5e6, 7.5e6, 1.2e7 }; @@ -475,26 +481,6 @@ TEST_F( PhillipsBrineViscosityTest, brineViscosityValuesAndDeriv ) } } -class EzrokhiBrineViscosityTest : public ::testing::Test -{ -public: - EzrokhiBrineViscosityTest() - { - writeTableToFile( filename, pvtLiquidEzrokhiTableContent ); - pvtFunction = makePVTFunction< EzrokhiBrineViscosity >( filename, key ); - } - - ~EzrokhiBrineViscosityTest() override - { - removeFile( filename ); - } - -protected: - string const key = "ViscosityFun"; - string const filename = "pvtliquid.txt"; - std::unique_ptr< EzrokhiBrineViscosity > pvtFunction; -}; - TEST_F( EzrokhiBrineViscosityTest, brineViscosityValuesAndDeriv ) { real64 const P[3] = { 5e6, 7.5e6, 1.2e7 }; @@ -522,26 +508,6 @@ TEST_F( EzrokhiBrineViscosityTest, brineViscosityValuesAndDeriv ) } } -class FenghourCO2ViscosityTest : public ::testing::Test -{ -public: - FenghourCO2ViscosityTest() - { - writeTableToFile( filename, pvtGasTableContent ); - pvtFunction = makePVTFunction< FenghourCO2Viscosity >( filename, key ); - } - - ~FenghourCO2ViscosityTest() override - { - removeFile( filename ); - } - -protected: - string const key = "ViscosityFun"; - string const filename = "pvtgas.txt"; - std::unique_ptr< FenghourCO2Viscosity > pvtFunction; -}; - TEST_F( FenghourCO2ViscosityTest, fenghourCO2ViscosityValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! @@ -581,26 +547,6 @@ TEST_F( FenghourCO2ViscosityTest, fenghourCO2ViscosityValuesAndDeriv ) } } -class PhillipsBrineDensityTest : public ::testing::Test -{ -public: - PhillipsBrineDensityTest() - { - writeTableToFile( filename, pvtLiquidPhillipsTableContent ); - pvtFunction = makePVTFunction< PhillipsBrineDensity >( filename, key ); - } - - ~PhillipsBrineDensityTest() override - { - removeFile( filename ); - } - -protected: - string const key = "DensityFun"; - string const filename = "pvtliquid.txt"; - std::unique_ptr< PhillipsBrineDensity > pvtFunction; -}; - TEST_F( PhillipsBrineDensityTest, brineCO2DensityMassValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! @@ -668,26 +614,6 @@ TEST_F( PhillipsBrineDensityTest, brineCO2DensityMolarValuesAndDeriv ) } } -class EzrokhiBrineDensityTest : public ::testing::Test -{ -public: - EzrokhiBrineDensityTest() - { - writeTableToFile( filename, pvtLiquidEzrokhiTableContent ); - pvtFunction = makePVTFunction< EzrokhiBrineDensity >( filename, key ); - } - - ~EzrokhiBrineDensityTest() override - { - removeFile( filename ); - } - -protected: - string const key = "DensityFun"; - string const filename = "pvtliquid.txt"; - std::unique_ptr< EzrokhiBrineDensity > pvtFunction; -}; - TEST_F( EzrokhiBrineDensityTest, brineCO2DensityMassValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! @@ -746,26 +672,6 @@ TEST_F( EzrokhiBrineDensityTest, brineCO2DensityMolarValuesAndDeriv ) } } -class SpanWagnerCO2DensityTest : public ::testing::Test -{ -public: - SpanWagnerCO2DensityTest() - { - writeTableToFile( filename, pvtGasTableContent ); - pvtFunction = makePVTFunction< SpanWagnerCO2Density >( filename, key ); - } - - ~SpanWagnerCO2DensityTest() override - { - removeFile( filename ); - } - -protected: - string const key = "DensityFun"; - string const filename = "pvtgas.txt"; - std::unique_ptr< SpanWagnerCO2Density > pvtFunction; -}; - TEST_F( SpanWagnerCO2DensityTest, spanWagnerCO2DensityMassValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! @@ -845,26 +751,6 @@ TEST_F( SpanWagnerCO2DensityTest, spanWagnerCO2DensityMolarValuesAndDeriv ) } } -class CO2SolubilityTest : public ::testing::Test -{ -public: - CO2SolubilityTest() - { - writeTableToFile( filename, co2FlashTableContent ); - flashModel = makeFlashModel< CO2Solubility >( filename, key ); - } - - ~CO2SolubilityTest() override - { - removeFile( filename ); - } - -protected: - string const key = "FlashModel"; - string const filename = "co2flash.txt"; - std::unique_ptr< CO2Solubility > flashModel; -}; - TEST_F( CO2SolubilityTest, co2SolubilityValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! @@ -890,7 +776,7 @@ TEST_F( CO2SolubilityTest, co2SolubilityValuesAndDeriv ) 0.008322701666, 0.008287995083, 0.008259683449, 0.01143341315, 0.0113929227, 0.01135993384, 0.01597786252, 0.01594169644, 0.015912288 }; - CO2Solubility::KernelWrapper flashModelWrapper = flashModel->createKernelWrapper(); + CO2Solubility::KernelWrapper flashModelWrapper = pvtFunction->createKernelWrapper(); integer counter = 0; for( integer iComp = 0; iComp < 3; ++iComp ) @@ -911,26 +797,6 @@ TEST_F( CO2SolubilityTest, co2SolubilityValuesAndDeriv ) } } -class BrineEnthalpyTest : public ::testing::Test -{ -public: - BrineEnthalpyTest() - { - writeTableToFile( filename, pvtLiquidEnthalpyTableContent ); - pvtFunction = makePVTFunction< BrineEnthalpy >( filename, key ); - } - - ~BrineEnthalpyTest() override - { - removeFile( filename ); - } - -protected: - string const key = "EnthalpyFun"; - string const filename = "pvtliquid.txt"; - std::unique_ptr< BrineEnthalpy > pvtFunction; -}; - TEST_F( BrineEnthalpyTest, BrineEnthalpyMassValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! @@ -1005,28 +871,6 @@ TEST_F( BrineEnthalpyTest, BrineEnthalpyMolarValuesAndDeriv ) } } -class CO2EnthalpyTest : public ::testing::Test -{ -public: - CO2EnthalpyTest() - { - // gas enthalpy model repeats liquid parameters (except m), use them here - writeTableToFile( filename, pvtLiquidEnthalpyTableContent ); - pvtFunction = makePVTFunction< CO2Enthalpy >( filename, key ); - - } - - ~CO2EnthalpyTest() override - { - removeFile( filename ); - } - -protected: - string const key = "EnthalpyFun"; - string const filename = "pvtgas.txt"; - std::unique_ptr< CO2Enthalpy > pvtFunction; -}; - TEST_F( CO2EnthalpyTest, CO2EnthalpyMassValuesAndDeriv ) { // when checking numerical derivatives, do not fall on the coordinate points of the tables!! diff --git a/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp b/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp index 06feb1c6877..81c6cd88dd7 100644 --- a/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp +++ b/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp @@ -50,18 +50,17 @@ class CO2SolubilitySpycherPruessTestFixture : public ::testing::TestWithParam< T static real64 constexpr relTol = 1.0e-5; static real64 constexpr absTol = 1.0e-7; static real64 constexpr pertubation = 1.0e-6; - static constexpr char const * flashContent = "FlashModel CO2Solubility 1.0e5 1.0e7 9.9e5 283.15 383.15 10.0 0.15 1.0e-8 SpycherPruess"; public: CO2SolubilitySpycherPruessTestFixture() = default; ~CO2SolubilitySpycherPruessTestFixture() override = default; protected: - static std::unique_ptr< CO2Solubility > makeFlashModel( string const & fileContent ); + static std::unique_ptr< CO2Solubility > makeFlashModel(); }; std::unique_ptr< CO2Solubility > -CO2SolubilitySpycherPruessTestFixture::makeFlashModel( string const & fileContent ) +CO2SolubilitySpycherPruessTestFixture::makeFlashModel() { // Define phase names string_array phaseNames; @@ -80,16 +79,25 @@ CO2SolubilitySpycherPruessTestFixture::makeFlashModel( string const & fileConten componentMolarWeight[0] = 44.0e-3; componentMolarWeight[1] = 18.0e-3; - // Read file parameters - string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( fileContent ); + // Fluid model parameters + BrineFluidParameters parameters; + parameters.m_solubilityModel = BrineFluidParameters::SolubilityModel::SpycherPruess; + parameters.m_pressureCoordinates.emplace_back( 1.0e5 ); + parameters.m_pressureCoordinates.emplace_back( 1.0e7 ); + parameters.m_pressureInterval = 9.9e5; + parameters.m_temperatureCoordinates.emplace_back( 283.15 ); + parameters.m_temperatureCoordinates.emplace_back( 383.15 ); + parameters.m_temperatureInterval = 10.0; + parameters.m_salinity = 0.15; + parameters.m_tolerance = 1.0e-8; TableFunction::OutputOptions const flashOutputOpts = { false, // writeCSV false, // writeInLog }; - return std::make_unique< CO2Solubility >( strs[1], - strs, + return std::make_unique< CO2Solubility >( "FlashModel", + parameters, phaseNames, componentNames, componentMolarWeight, @@ -98,7 +106,7 @@ CO2SolubilitySpycherPruessTestFixture::makeFlashModel( string const & fileConten TEST_P( CO2SolubilitySpycherPruessTestFixture, testExpectedValues ) { - auto flashModel = makeFlashModel( CO2SolubilitySpycherPruessTestFixture::flashContent ); + auto flashModel = makeFlashModel(); auto [pressure, temperature, z_co2, expected_V, expected_x_co2, expected_y_wat] = GetParam(); @@ -137,7 +145,7 @@ TEST_P( CO2SolubilitySpycherPruessTestFixture, testNumericalDerivatives ) { using Deriv = multifluid::DerivativeOffset; - auto flashModel = makeFlashModel( CO2SolubilitySpycherPruessTestFixture::flashContent ); + auto flashModel = makeFlashModel(); auto [pressure, temperature, z_co2, expected_V, expected_x_co2, expected_y_wat] = GetParam(); GEOS_UNUSED_VAR( expected_V, expected_x_co2, expected_y_wat ); diff --git a/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp b/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp index d908f61445f..283bbd6251b 100644 --- a/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp +++ b/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp @@ -22,6 +22,7 @@ #include "common/initializeEnvironment.hpp" using namespace geos::constitutive; +using namespace geos::constitutive::PVTProps; namespace geos { @@ -34,6 +35,23 @@ enum class FlashType : int {DuanSun, SpycherPruess}; ENUM_STRINGS( BrineModelType, "Phillips", "Ezrokhi" ); ENUM_STRINGS( FlashType, "DuanSun", "SpycherPruess" ); +static void populateFluidParameters( BrineFluidParameters & parameters ) +{ + parameters.m_pressureCoordinates.emplace_back( 1.0e6 ); + parameters.m_pressureCoordinates.emplace_back( 1.5e7 ); + parameters.m_pressureInterval = 5.0e4; + parameters.m_temperatureCoordinates.emplace_back( 367.15 ); + parameters.m_temperatureCoordinates.emplace_back( 369.15 ); + parameters.m_temperatureInterval = 1.0; + parameters.m_salinity = 0.2; + parameters.m_ezrokhiDensityCoefficients.emplace_back( 2.01e-6 ); + parameters.m_ezrokhiDensityCoefficients.emplace_back( -6.34e-7 ); + parameters.m_ezrokhiDensityCoefficients.emplace_back( 1e-4 ); + parameters.m_ezrokhiViscosityCoefficients.emplace_back( 2.42e-7 ); + parameters.m_ezrokhiViscosityCoefficients.emplace_back( 0.0 ); + parameters.m_ezrokhiViscosityCoefficients.emplace_back( 1e-4 ); +} + template< BrineModelType BRINE, bool THERMAL > struct FluidType {}; @@ -41,41 +59,21 @@ template<> struct FluidType< BrineModelType::Phillips, false > { using type = CO2BrinePhillipsFluid; - static constexpr const char * brineContent = "DensityFun PhillipsBrineDensity 1e6 1.5e7 5e4 367.15 369.15 1 0.2\n" - "ViscosityFun PhillipsBrineViscosity 0.1"; - static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n" - "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1"; }; template<> struct FluidType< BrineModelType::Phillips, true > { using type = CO2BrinePhillipsThermalFluid; - static constexpr const char * brineContent = "DensityFun PhillipsBrineDensity 1e6 1.5e7 5e4 367.15 369.15 1 0.2\n" - "ViscosityFun PhillipsBrineViscosity 0.1\n" - "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0"; - static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n" - "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1\n" - "EnthalpyFun CO2Enthalpy 1e6 1.5e7 5e4 367.15 369.15 1"; }; template<> struct FluidType< BrineModelType::Ezrokhi, false > { using type = CO2BrineEzrokhiFluid; - static constexpr const char * brineContent = "DensityFun EzrokhiBrineDensity 2.01e-6 -6.34e-7 1e-4\n" - "ViscosityFun EzrokhiBrineViscosity 2.42e-7 0 1e-4"; - static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n" - "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1"; }; template<> struct FluidType< BrineModelType::Ezrokhi, true > { using type = CO2BrineEzrokhiThermalFluid; - static constexpr const char * brineContent = "DensityFun EzrokhiBrineDensity 2.01e-6 -6.34e-7 1e-4\n" - "ViscosityFun EzrokhiBrineViscosity 2.42e-7 0 1e-4\n" - "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0"; - static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n" - "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1\n" - "EnthalpyFun CO2Enthalpy 1e6 1.5e7 5e4 367.15 369.15 1"; }; template< FlashType FLASH > @@ -84,12 +82,18 @@ struct FlashModel {}; template<> struct FlashModel< FlashType::DuanSun > { - static constexpr const char * flashContent = "FlashModel CO2Solubility 1e6 1.5e7 5e4 367.15 369.15 1 0.15"; + static void populate( BrineFluidParameters & GEOS_UNUSED_PARAM( parameters ) ) + {} }; + template<> struct FlashModel< FlashType::SpycherPruess > { - static constexpr const char * flashContent = "FlashModel CO2Solubility 1e6 1.5e7 5e4 367.15 369.15 1 0.15 1.0e-10 SpycherPruess"; + static void populate( BrineFluidParameters & parameters ) + { + parameters.m_solubilityModel = BrineFluidParameters::SolubilityModel::SpycherPruess; + parameters.m_tolerance = 1.0e-10; + } }; template< BrineModelType BRINE, FlashType FLASH, bool THERMAL > @@ -105,21 +109,12 @@ class MultiFluidCO2BrineTestFixture : public FluidModelTest< typename FluidType< public: MultiFluidCO2BrineTestFixture() { - Base::writeTableToFile( pvtGasFileName, FluidType< BRINE, THERMAL >::gasContent ); - Base::writeTableToFile( pvtLiquidFileName, FluidType< BRINE, THERMAL >::brineContent ); - Base::writeTableToFile( pvtFlashFileName, FlashModel< FLASH >::flashContent ); - Base::createFluid( getFluidName(), []( CO2BrineFluid & fluid ){ fillPhysicalProperties( fluid ); } ); } - ~MultiFluidCO2BrineTestFixture() override - { - Base::removeFile( pvtGasFileName ); - Base::removeFile( pvtLiquidFileName ); - Base::removeFile( pvtFlashFileName ); - } + ~MultiFluidCO2BrineTestFixture() override = default; // Test numerical derivatives at selected data points void testNumericalDerivatives( bool const useMass ) @@ -155,9 +150,6 @@ class MultiFluidCO2BrineTestFixture : public FluidModelTest< typename FluidType< private: static void fillPhysicalProperties( CO2BrineFluid & fluid ); - static constexpr const char * pvtGasFileName = "pvtgas.txt"; - static constexpr const char * pvtLiquidFileName = "pvtliquid.txt"; - static constexpr const char * pvtFlashFileName = "co2flash.txt"; }; template< BrineModelType BRINE, FlashType FLASH, bool THERMAL > @@ -186,12 +178,30 @@ void MultiFluidCO2BrineTestFixture< BRINE, FLASH, THERMAL >::fillPhysicalPropert auto & molarWeight = group.getReference< array1d< real64 > >( MultiFluidBase::viewKeyStruct::componentMolarWeightString() ); Base::fill( molarWeight, Feed< 2 >{44e-3, 18e-3} ); - auto & phasePVTParaFileNames = group.getReference< path_array >( CO2BrineFluid::viewKeyStruct::phasePVTParaFilesString() ); - phasePVTParaFileNames.emplace_back( Path( pvtGasFileName ) ); - phasePVTParaFileNames.emplace_back( Path( pvtLiquidFileName ) ); + BrineFluidParameters parameters; + populateFluidParameters( parameters ); + FlashModel< FLASH >::populate( parameters ); - auto & flashModelParaFileName = group.getReference< Path >( CO2BrineFluid::viewKeyStruct::flashModelParaFileString() ); - flashModelParaFileName = pvtFlashFileName; + using Keys = BrineFluidParameters::viewKeyStruct; + auto setValue = [&]( string const key, auto const value ) + { + using T = typename std::remove_const< decltype(value) >::type; + group.getReference< T >( key ) = value; + }; + setValue( Keys::solubilityModelString(), parameters.m_solubilityModel ); + setValue( Keys::pressureCoordinatesString(), parameters.m_pressureCoordinates ); + setValue( Keys::pressureIntervalString(), parameters.m_pressureInterval ); + setValue( Keys::temperatureCoordinatesString(), parameters.m_temperatureCoordinates ); + setValue( Keys::temperatureIntervalString(), parameters.m_temperatureInterval ); + setValue( Keys::salinityString(), parameters.m_salinity ); + setValue( Keys::toleranceString(), parameters.m_tolerance ); + setValue( Keys::waterCompressibilityString(), parameters.m_waterCompressibility ); + setValue( Keys::solubilityTablesString(), parameters.m_solubilityTables ); + if constexpr (BRINE == BrineModelType::Ezrokhi) + { + setValue( Keys::ezrokhiDensityCoefficientsString(), parameters.m_ezrokhiDensityCoefficients ); + setValue( Keys::ezrokhiViscosityCoefficientsString(), parameters.m_ezrokhiViscosityCoefficients ); + } } using CO2BrinePhillipsTest = MultiFluidCO2BrineTestFixture< BrineModelType::Phillips, @@ -298,97 +308,87 @@ TEST_P( CO2BrinePhillipsSpycherPruessTest, testFluidValues ) /* UNCRUSTIFY-OFF */ -#define D( ... ) CO2BrinePhillipsTest::ParamType{ __VA_ARGS__ } INSTANTIATE_TEST_SUITE_P( FluidValueTest, CO2BrinePhillipsTest, - ::testing::Values( + ::testing::ValuesIn({ //| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density - D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.32967e+04}, {8.25738e+01, 9.70853e+02}, {1.90427e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.88317e+03}), - D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.32812e+04}, {8.24487e+01, 9.70542e+02}, {1.90569e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87456e+03}), - D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.32478e+04}, {8.21833e+01, 9.69875e+02}, {1.90872e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.85630e+03}), - D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.32486e+04}, {1.34361e+02, 9.74235e+02}, {2.00622e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18273e+03}), - D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.32333e+04}, {1.34097e+02, 9.73923e+02}, {2.00722e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.16610e+03}), - D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.32005e+04}, {1.33538e+02, 9.73254e+02}, {2.00938e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.13094e+03}), - D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.32330e+04}, {2.54147e+02, 9.79494e+02}, {2.39022e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57730e+04}), - D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.32179e+04}, {2.53338e+02, 9.79185e+02}, {2.38854e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57318e+04}), - D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.31853e+04}, {2.51643e+02, 9.78520e+02}, {2.38514e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56452e+04}) - ) + {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.33005e+04}, {8.25738e+01, 9.70812e+02}, {1.90427e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.88220e+03}}, + {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.32850e+04}, {8.24487e+01, 9.70502e+02}, {1.90569e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87360e+03}}, + {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.32516e+04}, {8.21833e+01, 9.69835e+02}, {1.90872e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.85534e+03}}, + {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.32538e+04}, {1.34361e+02, 9.74179e+02}, {2.00622e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18078e+03}}, + {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.32386e+04}, {1.34097e+02, 9.73867e+02}, {2.00722e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.16417e+03}}, + {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.32057e+04}, {1.33538e+02, 9.73198e+02}, {2.00938e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.12901e+03}}, + {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.32402e+04}, {2.54147e+02, 9.79416e+02}, {2.39022e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57692e+04}}, + {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.32251e+04}, {2.53338e+02, 9.79107e+02}, {2.38854e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57280e+04}}, + {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.31925e+04}, {2.51643e+02, 9.78443e+02}, {2.38514e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56415e+04}}, + }) ); -#undef D -#define D( ... ) CO2BrineEzrokhiTest::ParamType{ __VA_ARGS__ } INSTANTIATE_TEST_SUITE_P( FluidValueTest, CO2BrineEzrokhiTest, - ::testing::Values( + ::testing::ValuesIn({ //| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density - D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.51674e+04}, {8.25738e+01, 1.00493e+03}, {1.90427e-05, 3.12148e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.89876e+03}), - D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.51663e+04}, {8.24487e+01, 1.00488e+03}, {1.90569e-05, 3.11023e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.89023e+03}), - D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.51642e+04}, {8.21833e+01, 1.00478e+03}, {1.90872e-05, 3.08611e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87213e+03}), - D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.58209e+04}, {1.34361e+02, 1.02130e+03}, {2.00622e-05, 3.16876e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.23469e+03}), - D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.58254e+04}, {1.34097e+02, 1.02135e+03}, {2.00722e-05, 3.15764e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.21829e+03}), - D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.58353e+04}, {1.33538e+02, 1.02146e+03}, {2.00938e-05, 3.13381e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18360e+03}), - D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.67057e+04}, {2.54147e+02, 1.04339e+03}, {2.39022e-05, 3.23075e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59791e+04}), - D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.67188e+04}, {2.53338e+02, 1.04360e+03}, {2.38854e-05, 3.21991e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59385e+04}), - D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.67472e+04}, {2.51643e+02, 1.04405e+03}, {2.38514e-05, 3.19665e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.58533e+04}) - ) + {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.51522e+04}, {8.25738e+01, 1.00454e+03}, {1.90427e-05, 3.12027e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.89763e+03}}, + {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.51511e+04}, {8.24487e+01, 1.00449e+03}, {1.90569e-05, 3.10902e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.88910e+03}}, + {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.51487e+04}, {8.21833e+01, 1.00439e+03}, {1.90872e-05, 3.08490e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87101e+03}}, + {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.57997e+04}, {1.34361e+02, 1.02075e+03}, {2.00622e-05, 3.16706e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.23220e+03}}, + {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.58041e+04}, {1.34097e+02, 1.02080e+03}, {2.00722e-05, 3.15594e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.21580e+03}}, + {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.58136e+04}, {1.33538e+02, 1.02090e+03}, {2.00938e-05, 3.13210e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18112e+03}}, + {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.66765e+04}, {2.54147e+02, 1.04263e+03}, {2.39022e-05, 3.22839e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59731e+04}}, + {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.66893e+04}, {2.53338e+02, 1.04283e+03}, {2.38854e-05, 3.21754e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59325e+04}}, + {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.67171e+04}, {2.51643e+02, 1.04328e+03}, {2.38514e-05, 3.19427e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.58474e+04}}, + }) ); -#undef D -#define D( ... ) CO2BrinePhillipsThermalTest::ParamType{ __VA_ARGS__ } INSTANTIATE_TEST_SUITE_P( FluidValueTest, CO2BrinePhillipsThermalTest, - ::testing::Values( + ::testing::ValuesIn({ //| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density - D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.32967e+04}, {8.25738e+01, 9.70853e+02}, {1.90427e-05, 3.03214e-04}, {1.21447e+07, 2.18796e+07}, {1.20841e+07, 2.18744e+07}, 5.88317e+03}), - D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.32812e+04}, {8.24487e+01, 9.70542e+02}, {1.90569e-05, 3.02064e-04}, {1.21537e+07, 2.19628e+07}, {1.20931e+07, 2.19576e+07}, 5.87456e+03}), - D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.32478e+04}, {8.21833e+01, 9.69875e+02}, {1.90872e-05, 2.99598e-04}, {1.21731e+07, 2.21410e+07}, {1.21123e+07, 2.21359e+07}, 5.85630e+03}), - D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.32486e+04}, {1.34361e+02, 9.74235e+02}, {2.00622e-05, 3.03214e-04}, {1.17163e+07, 2.18445e+07}, {1.16605e+07, 2.18368e+07}, 9.18273e+03}), - D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.32333e+04}, {1.34097e+02, 9.73923e+02}, {2.00722e-05, 3.02064e-04}, {1.17269e+07, 2.19275e+07}, {1.16709e+07, 2.19198e+07}, 9.16610e+03}), - D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.32005e+04}, {1.33538e+02, 9.73254e+02}, {2.00938e-05, 2.99598e-04}, {1.17494e+07, 2.21054e+07}, {1.16932e+07, 2.20977e+07}, 9.13094e+03}), - D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.32330e+04}, {2.54147e+02, 9.79494e+02}, {2.39022e-05, 3.03214e-04}, {1.08306e+07, 2.17898e+07}, {1.07833e+07, 2.17775e+07}, 1.57730e+04}), - D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.32179e+04}, {2.53338e+02, 9.79185e+02}, {2.38854e-05, 3.02064e-04}, {1.08453e+07, 2.18726e+07}, {1.07979e+07, 2.18603e+07}, 1.57318e+04}), - D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.31853e+04}, {2.51643e+02, 9.78520e+02}, {2.38514e-05, 2.99598e-04}, {1.08767e+07, 2.20500e+07}, {1.08290e+07, 2.20378e+07}, 1.56452e+04}) - ) + {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.33005e+04}, {8.25738e+01, 9.70812e+02}, {1.90427e-05, 3.06891e-04}, {1.21447e+07, 2.15290e+07}, {1.20841e+07, 2.15238e+07}, 5.88220e+03}}, + {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.32850e+04}, {8.24487e+01, 9.70502e+02}, {1.90569e-05, 3.05730e-04}, {1.21537e+07, 2.16115e+07}, {1.20931e+07, 2.16064e+07}, 5.87360e+03}}, + {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.32516e+04}, {8.21833e+01, 9.69835e+02}, {1.90872e-05, 3.03243e-04}, {1.21731e+07, 2.17883e+07}, {1.21123e+07, 2.17832e+07}, 5.85534e+03}}, + {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.32538e+04}, {1.34361e+02, 9.74179e+02}, {2.00622e-05, 3.06891e-04}, {1.17163e+07, 2.14953e+07}, {1.16605e+07, 2.14876e+07}, 9.18078e+03}}, + {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.32386e+04}, {1.34097e+02, 9.73867e+02}, {2.00722e-05, 3.05730e-04}, {1.17269e+07, 2.15777e+07}, {1.16709e+07, 2.15700e+07}, 9.16417e+03}}, + {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.32057e+04}, {1.33538e+02, 9.73198e+02}, {2.00938e-05, 3.03243e-04}, {1.17494e+07, 2.17542e+07}, {1.16932e+07, 2.17465e+07}, 9.12901e+03}}, + {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.32402e+04}, {2.54147e+02, 9.79416e+02}, {2.39022e-05, 3.06891e-04}, {1.08306e+07, 2.14426e+07}, {1.07833e+07, 2.14304e+07}, 1.57692e+04}}, + {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.32251e+04}, {2.53338e+02, 9.79107e+02}, {2.38854e-05, 3.05730e-04}, {1.08453e+07, 2.15248e+07}, {1.07979e+07, 2.15125e+07}, 1.57280e+04}}, + {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.31925e+04}, {2.51643e+02, 9.78443e+02}, {2.38514e-05, 3.03243e-04}, {1.08767e+07, 2.17008e+07}, {1.08290e+07, 2.16885e+07}, 1.56415e+04}}, + }) ); -#undef D #if !defined(GEOS_DEVICE_COMPILE) -#define D( ... ) CO2BrineEzrokhiThermalTest::ParamType{ __VA_ARGS__ } INSTANTIATE_TEST_SUITE_P( FluidValueTest, CO2BrineEzrokhiThermalTest, - ::testing::Values( + ::testing::ValuesIn({ //| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density | - D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.51674e+04}, {8.25738e+01, 1.00493e+03}, {1.90427e-05, 3.12148e-04}, {1.21447e+07, 2.18796e+07}, {1.20841e+07, 2.18746e+07}, 5.89876e+03}), - D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.51663e+04}, {8.24487e+01, 1.00488e+03}, {1.90569e-05, 3.11023e-04}, {1.21537e+07, 2.19628e+07}, {1.20931e+07, 2.19578e+07}, 5.89023e+03}), - D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.51642e+04}, {8.21833e+01, 1.00478e+03}, {1.90872e-05, 3.08611e-04}, {1.21731e+07, 2.21410e+07}, {1.21123e+07, 2.21361e+07}, 5.87213e+03}), - D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.58209e+04}, {1.34361e+02, 1.02130e+03}, {2.00622e-05, 3.16876e-04}, {1.17163e+07, 2.18445e+07}, {1.16605e+07, 2.18372e+07}, 9.23469e+03}), - D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.58254e+04}, {1.34097e+02, 1.02135e+03}, {2.00722e-05, 3.15764e-04}, {1.17269e+07, 2.19275e+07}, {1.16709e+07, 2.19202e+07}, 9.21829e+03}), - D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.58353e+04}, {1.33538e+02, 1.02146e+03}, {2.00938e-05, 3.13381e-04}, {1.17494e+07, 2.21054e+07}, {1.16932e+07, 2.20981e+07}, 9.18360e+03}), - D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.67057e+04}, {2.54147e+02, 1.04339e+03}, {2.39022e-05, 3.23075e-04}, {1.08306e+07, 2.17898e+07}, {1.07833e+07, 2.17783e+07}, 1.59791e+04}), - D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.67188e+04}, {2.53338e+02, 1.04360e+03}, {2.38854e-05, 3.21991e-04}, {1.08453e+07, 2.18726e+07}, {1.07979e+07, 2.18611e+07}, 1.59385e+04}), - D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.67472e+04}, {2.51643e+02, 1.04405e+03}, {2.38514e-05, 3.19665e-04}, {1.08767e+07, 2.20500e+07}, {1.08290e+07, 2.20385e+07}, 1.58533e+04}) - ) + {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.51522e+04}, {8.25738e+01, 1.00454e+03}, {1.90427e-05, 3.12027e-04}, {1.21447e+07, 2.15290e+07}, {1.20841e+07, 2.15240e+07}, 5.89763e+03}}, + {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.51511e+04}, {8.24487e+01, 1.00449e+03}, {1.90569e-05, 3.10902e-04}, {1.21537e+07, 2.16115e+07}, {1.20931e+07, 2.16065e+07}, 5.88910e+03}}, + {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.51487e+04}, {8.21833e+01, 1.00439e+03}, {1.90872e-05, 3.08490e-04}, {1.21731e+07, 2.17883e+07}, {1.21123e+07, 2.17834e+07}, 5.87101e+03}}, + {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.57997e+04}, {1.34361e+02, 1.02075e+03}, {2.00622e-05, 3.16706e-04}, {1.17163e+07, 2.14953e+07}, {1.16605e+07, 2.14880e+07}, 9.23220e+03}}, + {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.58041e+04}, {1.34097e+02, 1.02080e+03}, {2.00722e-05, 3.15594e-04}, {1.17269e+07, 2.15777e+07}, {1.16709e+07, 2.15704e+07}, 9.21580e+03}}, + {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.58136e+04}, {1.33538e+02, 1.02090e+03}, {2.00938e-05, 3.13210e-04}, {1.17494e+07, 2.17542e+07}, {1.16932e+07, 2.17468e+07}, 9.18112e+03}}, + {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.66765e+04}, {2.54147e+02, 1.04263e+03}, {2.39022e-05, 3.22839e-04}, {1.08306e+07, 2.14426e+07}, {1.07833e+07, 2.14311e+07}, 1.59731e+04}}, + {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.66893e+04}, {2.53338e+02, 1.04283e+03}, {2.38854e-05, 3.21754e-04}, {1.08453e+07, 2.15248e+07}, {1.07979e+07, 2.15133e+07}, 1.59325e+04}}, + {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.67171e+04}, {2.51643e+02, 1.04328e+03}, {2.38514e-05, 3.19427e-04}, {1.08767e+07, 2.17008e+07}, {1.08290e+07, 2.16893e+07}, 1.58474e+04}}, + }) ); -#undef D #endif -#define D( ... ) CO2BrinePhillipsSpycherPruessTest::ParamType{ __VA_ARGS__ } INSTANTIATE_TEST_SUITE_P( FluidValueTest, CO2BrinePhillipsSpycherPruessTest, - ::testing::Values( + ::testing::ValuesIn({ //| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density | - D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{3.00488e-01, 6.99512e-01}, {1.87668e+03, 5.32842e+04}, {8.25738e+01, 9.70985e+02}, {1.90427e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.77217e+03}), - D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{3.00580e-01, 6.99420e-01}, {1.87383e+03, 5.32686e+04}, {8.24487e+01, 9.70677e+02}, {1.90569e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.76239e+03}), - D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{3.00781e-01, 6.99219e-01}, {1.86780e+03, 5.32348e+04}, {8.21833e+01, 9.70013e+02}, {1.90872e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.74154e+03}), - D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.96731e-01, 7.03269e-01}, {3.05367e+03, 5.32295e+04}, {1.34361e+02, 9.74440e+02}, {2.00622e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.05928e+03}), - D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.96804e-01, 7.03196e-01}, {3.04766e+03, 5.32141e+04}, {1.34097e+02, 9.74130e+02}, {2.00722e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.04143e+03}), - D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.96962e-01, 7.03038e-01}, {3.03496e+03, 5.31808e+04}, {1.33538e+02, 9.73465e+02}, {2.00938e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.00358e+03}), - D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.93050e-01, 7.06950e-01}, {5.77607e+03, 5.32048e+04}, {2.54147e+02, 9.79798e+02}, {2.39022e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56195e+04}), - D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.93105e-01, 7.06895e-01}, {5.75768e+03, 5.31894e+04}, {2.53338e+02, 9.79492e+02}, {2.38854e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.55771e+04}), - D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.93225e-01, 7.06775e-01}, {5.71917e+03, 5.31561e+04}, {2.51643e+02, 9.78834e+02}, {2.38514e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.54878e+04}) - ) + {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{3.00488e-01, 6.99512e-01}, {1.87668e+03, 5.32842e+04}, {8.25738e+01, 9.70985e+02}, {1.90427e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.77217e+03}}, + {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{3.00580e-01, 6.99420e-01}, {1.87383e+03, 5.32686e+04}, {8.24487e+01, 9.70677e+02}, {1.90569e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.76239e+03}}, + {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{3.00781e-01, 6.99219e-01}, {1.86780e+03, 5.32348e+04}, {8.21833e+01, 9.70013e+02}, {1.90872e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.74154e+03}}, + {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.96731e-01, 7.03269e-01}, {3.05367e+03, 5.32295e+04}, {1.34361e+02, 9.74440e+02}, {2.00622e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.05928e+03}}, + {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.96804e-01, 7.03196e-01}, {3.04766e+03, 5.32141e+04}, {1.34097e+02, 9.74130e+02}, {2.00722e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.04143e+03}}, + {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.96962e-01, 7.03038e-01}, {3.03496e+03, 5.31808e+04}, {1.33538e+02, 9.73465e+02}, {2.00938e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.00358e+03}}, + {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.93050e-01, 7.06950e-01}, {5.77607e+03, 5.32048e+04}, {2.54147e+02, 9.79798e+02}, {2.39022e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56195e+04}}, + {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.93105e-01, 7.06895e-01}, {5.75768e+03, 5.31894e+04}, {2.53338e+02, 9.79492e+02}, {2.38854e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.55771e+04}}, + {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.93225e-01, 7.06775e-01}, {5.71917e+03, 5.31561e+04}, {2.51643e+02, 9.78834e+02}, {2.38514e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.54878e+04}}, + }) ); -#undef D /* UNCRUSTIFY-ON */ From c9bb8f018b2cb28f8ca3838ae11b26c375d90847 Mon Sep 17 00:00:00 2001 From: dkachuma Date: Fri, 15 Aug 2025 14:24:35 -0500 Subject: [PATCH 4/5] Unit tests --- .../functions/BrineFluidParameters.cpp | 13 +--- .../reactive/ReactiveBrineFluid.cpp | 19 ++++-- .../reactive/ReactiveBrineFluid.hpp | 5 +- .../unitTests/constitutiveTests/testPVT.xml | 7 +- .../constitutiveTests/testPVT_CO2Brine.xml | 30 ++++++--- .../testPVT_CO2BrineTables.xml | 35 ++++------ ...ineTables_testCo2BrinePhillipsMixtureA.txt | 42 ++++++------ ...ineTables_testCo2BrinePhillipsMixtureB.txt | 6 +- ...T_CO2Brine_testCo2BrineEzrokhiMixtureA.txt | 42 ++++++------ ...T_CO2Brine_testCo2BrineEzrokhiMixtureB.txt | 42 ++++++------ ..._CO2Brine_testCo2BrinePhillipsMixtureA.txt | 42 ++++++------ ..._CO2Brine_testCo2BrinePhillipsMixtureB.txt | 42 ++++++------ ...ne_testCo2BrinePhillipsMixtureThermalA.txt | 4 +- ...ne_testCo2BrinePhillipsMixtureThermalB.txt | 42 ++++++------ ...tCo2SpycherPruessBrinePhillipsMixtureA.txt | 42 ++++++------ ...tCo2SpycherPruessBrinePhillipsMixtureB.txt | 42 ++++++------ .../testPVT_data/brinePVT.txt | 2 - .../testPVT_data/brinePVTEzrokhi.txt | 2 - .../testPVT_data/brinePVT_thermal.txt | 3 - .../testPVT_data/carbonDioxideFlash.txt | 1 - .../testPVT_data/carbonDioxidePVT.txt | 2 - .../testPVT_data/carbonDioxidePVT_thermal.txt | 3 - .../carbonDioxideSpycherPruessFlash.txt | 1 - .../testPVT_data/reactiveBrinePVT.txt | 2 - .../constitutiveTests/testReactiveFluid.xml | 3 +- .../fluidFlowTests/testFlowStatistics.cpp | 67 ++++--------------- .../testThermalCompMultiphaseFlow.cpp | 47 ++----------- .../testTableFunctionsOutput.cpp | 49 ++++---------- ...eservoirCompositionalMultiphaseMSWells.cpp | 32 ++------- ...eservoirCompositionalMultiphaseSSWells.cpp | 32 ++------- ...eservoirCompositionalMultiphaseMSWells.cpp | 33 ++------- ...eservoirCompositionalMultiphaseSSWells.cpp | 34 ++-------- 32 files changed, 282 insertions(+), 486 deletions(-) delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT.txt delete mode 100755 src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt delete mode 100644 src/coreComponents/unitTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp index 1f1cb87ee76..1d16eb42baf 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp @@ -155,7 +155,7 @@ void BrineFluidParameters::postInputInitialization( MultiFluidBase * fluid ) // Salinity must not be negative GEOS_THROW_IF_LT_MSG( m_salinity, 0.0, GEOS_FMT( "{}: invalid salinity {}. " - "Value must not be negative", fullName, viewKeyStruct::waterCompressibilityString() ), + "Value must not be negative", fullName, viewKeyStruct::salinityString() ), InputError ); // Flash tolerance must be positive @@ -214,14 +214,7 @@ void BrineFluidParameters::postInputInitialization( MultiFluidBase * fluid ) m_ezrokhiDensityCoefficients.emplace_back( 0.0 ); } } - if( m_ezrokhiDensityCoefficients.empty()) - { - for( integer ic = 0; ic < 3; ic++ ) - { - m_ezrokhiViscosityCoefficients.emplace_back( 0.0 ); - } - } - GEOS_THROW_IF_NE_MSG( m_ezrokhiViscosityCoefficients.size(), 3, + GEOS_THROW_IF_NE_MSG( m_ezrokhiDensityCoefficients.size(), 3, GEOS_FMT( "{}: invalid number of Ezrokhi density coefficients provided in {}. " "Exactly 3 values must be provided.", fullName, viewKeyStruct::ezrokhiDensityCoefficientsString() ), InputError ); @@ -229,7 +222,7 @@ void BrineFluidParameters::postInputInitialization( MultiFluidBase * fluid ) if constexpr ( EZROKHI_VISCOSITY ) { - if( m_ezrokhiDensityCoefficients.empty()) + if( m_ezrokhiViscosityCoefficients.empty()) { for( integer ic = 0; ic < 3; ic++ ) { diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp index c74f458d79f..066c99829be 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp @@ -72,8 +72,11 @@ ReactiveBrineFluid( string const & name, Group * const parent ): setRestartFlags( RestartFlags::NO_WRITE ). setDescription( "When set to 1, write PVT tables into a CSV file" ); - // Attach the fluid properties - m_brineFluidParameters.registerOnFluid< false, false, false >( this ); + registerWrapper( viewKeyStruct::salinityString(), &m_salinity ). + setInputFlag( InputFlags::OPTIONAL ). + setRestartFlags( RestartFlags::NO_WRITE ). + setDescription( "The salinity of brine" ). + setDefaultValue( m_salinity ); // if this is a thermal model, we need to make sure that the arrays will be properly displayed and saved to restart if( isThermal() ) @@ -128,8 +131,11 @@ void ReactiveBrineFluid< PHASE > ::postInputInitialization() GEOS_FMT( "{}: invalid number of phases", getFullName() ), InputError ); - // Validate the brine fluid properties - m_brineFluidParameters.postInputInitialization< false, false, false >( this ); + // Salinity must not be negative + GEOS_THROW_IF_LT_MSG( m_salinity, 0.0, + GEOS_FMT( "{}: invalid salinity {}. " + "Value must not be negative", getFullName(), viewKeyStruct::salinityString() ), + InputError ); createPVTModels(); } @@ -143,9 +149,12 @@ void ReactiveBrineFluid< PHASE >::createPVTModels() !isClone && isLogLevelActive< logInfo::PVT >( this->getLogLevel() ), // writeInLog }; + BrineFluidParameters parameters; + parameters.m_salinity = m_salinity; + // then, we are ready to instantiate the phase models m_phase = std::make_unique< PHASE >( getName() + "_phaseModel1", - m_brineFluidParameters, + parameters, m_componentNames, m_componentMolarWeight, pvtOutputOpts ); diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp index 4233273244c..7457d032641 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp @@ -157,6 +157,7 @@ class ReactiveBrineFluid : public ReactiveMultiFluid struct viewKeyStruct : ReactiveMultiFluid::viewKeyStruct { static constexpr char const * writeCSVFlagString() { return "writeCSV"; } + static constexpr char const * salinityString() { return "salinity"; } }; protected: @@ -170,8 +171,8 @@ class ReactiveBrineFluid : public ReactiveMultiFluid */ void createPVTModels(); - /// All brine model properties - PVTProps::BrineFluidParameters m_brineFluidParameters{}; + /// Salinity + real64 m_salinity{0.0}; /// Output csv file containing informations about PVT integer m_writeCSV; diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT.xml b/src/coreComponents/unitTests/constitutiveTests/testPVT.xml index cb59ac5f35c..d09f1ffd08e 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT.xml +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT.xml @@ -68,8 +68,11 @@ phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ testPVT_data/carbonDioxidePVT.txt, testPVT_data/brinePVT.txt }" - flashModelParaFile="testPVT_data/carbonDioxideFlash.txt"/> + pressureCoordinates="{1e6, 5e7}" + pressureInterval="1e6" + temperatureCoordinates="{340, 460}" + temperatureInterval="10" + salinity="1.0" /> + pressureCoordinates="{1e6, 5e7}" + pressureInterval="1e6" + temperatureCoordinates="{340, 460}" + temperatureInterval="10" + salinity="1.0" /> + pressureCoordinates="{1e6, 5e7}" + pressureInterval="1e6" + temperatureCoordinates="{340, 460}" + temperatureInterval="10" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0.0, 0.0, 0.0}" /> + solubilityModel="SpycherPruess" + pressureCoordinates="{1e6, 5e7}" + pressureInterval="1e6" + temperatureCoordinates="{340, 460}" + temperatureInterval="10" + salinity="1.0" /> + pressureCoordinates="{1e6, 5e7}" + pressureInterval="1e6" + temperatureCoordinates="{340, 460}" + temperatureInterval="10" + salinity="1.0" /> diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables.xml b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables.xml index 985f69263a1..75cf3ab644e 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables.xml +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables.xml @@ -43,14 +43,24 @@ phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ testPVT_data/carbonDioxidePVT.txt, testPVT_data/brinePVT.txt }" + pressureCoordinates="{1e6, 5e7}" + pressureInterval="1e6" + temperatureCoordinates="{340, 460}" + temperatureInterval="10" + salinity="1.0" + solubilityModel="Tables" solubilityTableNames="{ co2Solubility }" /> @@ -79,25 +89,4 @@ coordinateFiles="{ testPVT_data/pres.txt, testPVT_data/temp.txt }" voxelFile="testPVT_data/h20Vapourisation.txt" /> - - - - - - - - - diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt index e57399a5e16..54addb5aef2 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] -0.0000e+00 1.0000e+06 3.5000e+02 2.2384e+01 -4.0985e-12 6.9134e-01 3.0866e-01 1.5581e+01 1.0149e+03 1.7476e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5190e-02 9.7481e-01 -5.0000e-02 6.4444e+06 3.5000e+02 1.6893e+02 1.9043e-07 6.9135e-01 3.0865e-01 1.2309e+02 1.0182e+03 1.8998e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5170e-02 9.7483e-01 -1.0000e-01 1.1889e+07 3.5000e+02 3.8923e+02 1.2323e-07 6.9137e-01 3.0863e-01 3.0497e+02 1.0214e+03 2.5353e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5153e-02 9.7485e-01 -1.5000e-01 1.7333e+07 3.5000e+02 6.3201e+02 4.8872e-08 6.9138e-01 3.0862e-01 5.3970e+02 1.0246e+03 4.0932e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5140e-02 9.7486e-01 -2.0000e-01 2.2778e+07 3.5000e+02 7.4933e+02 2.0141e-08 6.9138e-01 3.0862e-01 6.6850e+02 1.0277e+03 5.3806e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5132e-02 9.7487e-01 -2.5000e-01 2.8222e+07 3.5000e+02 8.1139e+02 1.0856e-08 6.9139e-01 3.0861e-01 7.4098e+02 1.0308e+03 6.3051e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5128e-02 9.7487e-01 -3.0000e-01 3.3667e+07 3.5000e+02 8.5247e+02 7.5711e-09 6.9139e-01 3.0861e-01 7.9054e+02 1.0339e+03 7.0528e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5127e-02 9.7487e-01 -3.5000e-01 3.9111e+07 3.5000e+02 8.8315e+02 5.5626e-09 6.9138e-01 3.0862e-01 8.2831e+02 1.0370e+03 7.7028e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5131e-02 9.7487e-01 -4.0000e-01 4.4556e+07 3.5000e+02 9.0777e+02 4.5380e-09 6.9110e-01 3.0890e-01 8.5890e+02 1.0402e+03 8.2914e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5515e-02 9.7449e-01 -4.5000e-01 5.0000e+07 3.5000e+02 9.2831e+02 -1.2144e-12 6.9107e-01 3.0893e-01 8.8476e+02 1.0432e+03 8.8389e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5549e-02 9.7445e-01 -5.0000e-01 3.0000e+07 3.0400e+02 8.5628e+02 7.7352e-09 7.0800e-01 2.9200e-01 8.0121e+02 1.0275e+03 7.1971e-05 8.6631e-04 1.0000e+00 0.0000e+00 2.3630e-03 9.9764e-01 -5.5000e-01 1.0000e+07 2.5800e+02 3.3058e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0153e+03 2.2796e-05 1.9511e-03 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 -6.0000e-01 1.0000e+07 2.7156e+02 3.3059e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0155e+03 2.2796e-05 1.9588e-03 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 -6.5000e-01 1.0000e+07 2.8511e+02 3.3059e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0157e+03 2.2796e-05 1.3681e-03 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 -7.0000e-01 1.0000e+07 2.9867e+02 3.3060e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0158e+03 2.2796e-05 9.7022e-04 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 -7.5000e-01 1.0000e+07 3.1222e+02 3.3060e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0159e+03 2.2796e-05 7.3691e-04 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 -8.0000e-01 1.0000e+07 3.2578e+02 3.3060e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0160e+03 2.2796e-05 5.8345e-04 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 -8.5000e-01 1.0000e+07 3.3933e+02 3.3127e+02 1.5166e-07 7.0591e-01 2.9409e-01 2.5862e+02 1.0173e+03 2.2796e-05 4.7645e-04 1.0000e+00 0.0000e+00 5.2861e-03 9.9471e-01 -9.0000e-01 1.0000e+07 3.5289e+02 2.9374e+02 1.3343e-07 6.9111e-01 3.0889e-01 2.2287e+02 1.0183e+03 2.2020e-05 3.9764e-04 1.0000e+00 0.0000e+00 2.5496e-02 9.7450e-01 -9.5000e-01 1.0000e+07 3.6644e+02 2.7596e+02 1.2694e-07 6.9111e-01 3.0889e-01 2.0825e+02 1.0126e+03 2.1800e-05 3.4093e-04 1.0000e+00 0.0000e+00 2.5496e-02 9.7450e-01 -1.0000e+00 1.0000e+07 3.8000e+02 2.7593e+02 1.2693e-07 6.9111e-01 3.0889e-01 2.0825e+02 1.0113e+03 2.1860e-05 2.9672e-04 1.0000e+00 0.0000e+00 2.5496e-02 9.7450e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 2.2384e+01 -4.0985e-12 6.9134e-01 3.0866e-01 1.5581e+01 1.0149e+03 1.7476e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5190e-02 9.7481e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 1.6893e+02 1.9043e-07 6.9135e-01 3.0865e-01 1.2309e+02 1.0182e+03 1.8998e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5170e-02 9.7483e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 3.8923e+02 1.2323e-07 6.9137e-01 3.0863e-01 3.0497e+02 1.0214e+03 2.5353e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5153e-02 9.7485e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 6.3201e+02 4.8872e-08 6.9138e-01 3.0862e-01 5.3970e+02 1.0246e+03 4.0932e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5140e-02 9.7486e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 7.4933e+02 2.0141e-08 6.9138e-01 3.0862e-01 6.6850e+02 1.0277e+03 5.3806e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5132e-02 9.7487e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 8.1139e+02 1.0856e-08 6.9139e-01 3.0861e-01 7.4098e+02 1.0308e+03 6.3051e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5128e-02 9.7487e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 8.5247e+02 7.5711e-09 6.9139e-01 3.0861e-01 7.9054e+02 1.0339e+03 7.0528e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5127e-02 9.7487e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 8.8315e+02 5.5626e-09 6.9138e-01 3.0862e-01 8.2831e+02 1.0370e+03 7.7028e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5131e-02 9.7487e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 9.0777e+02 4.5380e-09 6.9110e-01 3.0890e-01 8.5890e+02 1.0402e+03 8.2914e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5515e-02 9.7449e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 9.2831e+02 -1.2144e-12 6.9107e-01 3.0893e-01 8.8476e+02 1.0432e+03 8.8389e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5549e-02 9.7445e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 8.5628e+02 7.7352e-09 7.0800e-01 2.9200e-01 8.0121e+02 1.0275e+03 7.1971e-05 8.6631e-04 1.0000e+00 0.0000e+00 2.3630e-03 9.9764e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 3.3058e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0153e+03 2.2796e-05 1.9511e-03 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 3.3059e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0155e+03 2.2796e-05 1.9588e-03 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 3.3059e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0157e+03 2.2796e-05 1.3681e-03 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 3.3060e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0158e+03 2.2796e-05 9.7022e-04 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 3.3060e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0159e+03 2.2796e-05 7.3691e-04 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 3.3060e+02 1.5126e-07 7.0790e-01 2.9210e-01 2.5862e+02 1.0160e+03 2.2796e-05 5.8345e-04 1.0000e+00 0.0000e+00 2.4980e-03 9.9750e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 3.3127e+02 1.5166e-07 7.0591e-01 2.9409e-01 2.5862e+02 1.0173e+03 2.2796e-05 4.7645e-04 1.0000e+00 0.0000e+00 5.2861e-03 9.9471e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 2.9374e+02 1.3343e-07 6.9111e-01 3.0889e-01 2.2287e+02 1.0183e+03 2.2020e-05 3.9764e-04 1.0000e+00 0.0000e+00 2.5496e-02 9.7450e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 2.6368e+02 1.2320e-07 6.9111e-01 3.0889e-01 1.9825e+02 1.0080e+03 2.1800e-05 3.4093e-04 1.0000e+00 0.0000e+00 2.5496e-02 9.7450e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 2.4148e+02 1.1656e-07 6.9111e-01 3.0889e-01 1.8038e+02 9.9699e+02 2.1860e-05 2.9672e-04 1.0000e+00 0.0000e+00 2.5496e-02 9.7450e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt index 1602cd55b4d..d10e2f779f7 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt @@ -13,7 +13,7 @@ 1.000000e-01 1.188889e+07 3.500000e+02 3.872625e+02 1.235889e-07 6.970361e-01 3.029639e-01 3.049677e+02 1.021383e+03 2.535323e-05 4.133014e-04 9.868221e-01 1.317789e-02 2.515310e-02 9.748469e-01 1.500000e-01 1.733333e+07 3.500000e+02 6.299791e+02 4.910724e-08 6.971827e-01 3.028173e-01 5.396999e+02 1.024564e+03 4.093159e-05 4.133014e-04 9.865058e-01 1.349424e-02 2.514050e-02 9.748595e-01 2.000000e-01 2.277778e+07 3.500000e+02 7.475845e+02 2.025386e-08 6.973287e-01 3.026713e-01 6.684956e+02 1.027711e+03 5.380604e-05 4.133014e-04 9.861841e-01 1.381594e-02 2.513194e-02 9.748681e-01 - 2.500000e-01 2.822222e+07 3.500000e+02 8.098725e+02 1.091981e-08 6.974725e-01 3.025275e-01 7.409817e+02 1.030826e+03 6.305096e-05 4.133014e-04 9.858603e-01 1.413974e-02 2.512750e-02 9.748725e-01 + 2.500000e-01 2.822222e+07 3.500000e+02 8.098725e+02 1.091982e-08 6.974725e-01 3.025275e-01 7.409817e+02 1.030826e+03 6.305096e-05 4.133014e-04 9.858603e-01 1.413974e-02 2.512750e-02 9.748725e-01 3.000000e-01 3.366667e+07 3.500000e+02 8.511236e+02 7.616453e-09 6.976160e-01 3.023840e-01 7.905432e+02 1.033912e+03 7.052829e-05 4.133014e-04 9.855306e-01 1.446941e-02 2.512707e-02 9.748729e-01 3.500000e-01 3.911111e+07 3.500000e+02 8.819464e+02 5.596183e-09 6.977601e-01 3.022399e-01 8.283089e+02 1.036970e+03 7.702816e-05 4.133014e-04 9.851927e-01 1.480733e-02 2.513081e-02 9.748692e-01 4.000000e-01 4.455556e+07 3.500000e+02 9.069049e+02 4.616396e-09 6.962942e-01 3.037058e-01 8.589037e+02 1.040182e+03 8.291432e-05 4.133014e-04 9.879163e-01 1.208368e-02 2.551474e-02 9.744853e-01 @@ -27,5 +27,5 @@ 8.000000e-01 1.000000e+07 3.257778e+02 3.266534e+02 1.520267e-07 7.205852e-01 2.794148e-01 2.586152e+02 1.015956e+03 2.279620e-05 5.834457e-04 9.698670e-01 3.013304e-02 2.498038e-03 9.975020e-01 8.500000e-01 1.000000e+07 3.393333e+02 3.280256e+02 1.533708e-07 7.162722e-01 2.837278e-01 2.586152e+02 1.017319e+03 2.279620e-05 4.764507e-04 9.753950e-01 2.460501e-02 5.286137e-03 9.947139e-01 9.000000e-01 1.000000e+07 3.528889e+02 2.921003e+02 1.337069e-07 6.965677e-01 3.034323e-01 2.228654e+02 1.018323e+03 2.202009e-05 3.976352e-04 9.873166e-01 1.268337e-02 2.549647e-02 9.745035e-01 - 9.500000e-01 1.000000e+07 3.664444e+02 2.743798e+02 1.271847e-07 6.965677e-01 3.034323e-01 2.082466e+02 1.012569e+03 2.180034e-05 3.409282e-04 9.873166e-01 1.268337e-02 2.549647e-02 9.745035e-01 - 1.000000e+00 1.000000e+07 3.800000e+02 2.743517e+02 1.271717e-07 6.965677e-01 3.034323e-01 2.082466e+02 1.011308e+03 2.185984e-05 2.967198e-04 9.873166e-01 1.268337e-02 2.549647e-02 9.745035e-01 + 9.500000e-01 1.000000e+07 3.664444e+02 2.621524e+02 1.234229e-07 6.965677e-01 3.034323e-01 1.982515e+02 1.008017e+03 2.180034e-05 3.409282e-04 9.873166e-01 1.268337e-02 2.549647e-02 9.745035e-01 + 1.000000e+00 1.000000e+07 3.800000e+02 2.400415e+02 1.167540e-07 6.965677e-01 3.034323e-01 1.803834e+02 9.969873e+02 2.185984e-05 2.967198e-04 9.873166e-01 1.268337e-02 2.549647e-02 9.745035e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt index 9df0c13cef2..43f52172e2e 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] -0.0000e+00 1.0000e+06 3.5000e+02 7.0237e+01 2.5631e-11 2.0920e-01 7.9080e-01 1.5581e+01 9.7518e+02 1.7476e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2780e-03 9.9772e-01 -5.0000e-02 6.4444e+06 3.5000e+02 4.2182e+02 1.3896e-07 1.9034e-01 8.0966e-01 1.2309e+02 9.8215e+02 1.8998e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.1952e-02 9.8805e-01 -1.0000e-01 1.1889e+07 3.5000e+02 7.0391e+02 6.0490e-08 1.7984e-01 8.2016e-01 3.0497e+02 9.8703e+02 2.5353e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.7255e-02 9.8275e-01 -1.5000e-01 1.7333e+07 3.5000e+02 8.6432e+02 1.7707e-08 1.7488e-01 8.2512e-01 5.3970e+02 9.9060e+02 4.0932e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.9739e-02 9.8026e-01 -2.0000e-01 2.2778e+07 3.5000e+02 9.1703e+02 6.6890e-09 1.7189e-01 8.2811e-01 6.6850e+02 9.9372e+02 5.3806e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.1232e-02 9.7877e-01 -2.5000e-01 2.8222e+07 3.5000e+02 9.4163e+02 3.5690e-09 1.6949e-01 8.3051e-01 7.4098e+02 9.9671e+02 6.3051e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2429e-02 9.7757e-01 -3.0000e-01 3.3667e+07 3.5000e+02 9.5727e+02 2.5032e-09 1.6736e-01 8.3264e-01 7.9054e+02 9.9964e+02 7.0528e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.3484e-02 9.7652e-01 -3.5000e-01 3.9111e+07 3.5000e+02 9.6883e+02 1.8830e-09 1.6542e-01 8.3458e-01 8.2831e+02 1.0025e+03 7.7028e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.4448e-02 9.7555e-01 -4.0000e-01 4.4556e+07 3.5000e+02 9.7812e+02 1.5612e-09 1.6360e-01 8.3640e-01 8.5890e+02 1.0054e+03 8.2914e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.5348e-02 9.7465e-01 -4.5000e-01 5.0000e+07 3.5000e+02 9.8599e+02 3.6882e-10 1.6188e-01 8.3812e-01 8.8476e+02 1.0083e+03 8.8389e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.6197e-02 9.7380e-01 -5.0000e-01 3.0000e+07 3.0400e+02 9.7666e+02 2.5443e-09 1.6783e-01 8.3217e-01 8.0121e+02 1.0218e+03 7.1971e-05 7.8492e-04 1.0000e+00 0.0000e+00 2.3250e-02 9.7675e-01 -5.5000e-01 1.0000e+07 2.5800e+02 6.6446e+02 8.1110e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0141e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -6.0000e-01 1.0000e+07 2.7156e+02 6.6447e+02 8.1111e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0142e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -6.5000e-01 1.0000e+07 2.8511e+02 6.6429e+02 8.1088e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0136e+03 2.2796e-05 1.2463e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -7.0000e-01 1.0000e+07 2.9867e+02 6.6334e+02 8.0969e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0110e+03 2.2796e-05 8.8041e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -7.5000e-01 1.0000e+07 3.1222e+02 6.6170e+02 8.0763e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0063e+03 2.2796e-05 6.6611e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -8.0000e-01 1.0000e+07 3.2578e+02 6.5950e+02 8.0485e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0001e+03 2.2796e-05 5.2535e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -8.5000e-01 1.0000e+07 3.3933e+02 6.5685e+02 8.0151e-08 1.8014e-01 8.1986e-01 2.5862e+02 9.9273e+02 2.2796e-05 4.2735e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -9.0000e-01 1.0000e+07 3.5289e+02 6.0588e+02 7.6868e-08 1.8266e-01 8.1734e-01 2.2287e+02 9.8369e+02 2.2020e-05 3.5529e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 -9.5000e-01 1.0000e+07 3.6644e+02 5.8269e+02 7.5133e-08 1.8266e-01 8.1734e-01 2.0825e+02 9.7414e+02 2.1800e-05 3.0346e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 -1.0000e+00 1.0000e+07 3.8000e+02 5.7962e+02 7.4722e-08 1.8266e-01 8.1734e-01 2.0825e+02 9.6370e+02 2.1860e-05 2.6310e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 7.0237e+01 2.5631e-11 2.0920e-01 7.9080e-01 1.5581e+01 9.7518e+02 1.7476e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2780e-03 9.9772e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 4.2182e+02 1.3908e-07 1.9034e-01 8.0966e-01 1.2309e+02 9.8215e+02 1.8998e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.1952e-02 9.8805e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 7.0391e+02 6.0598e-08 1.7984e-01 8.2016e-01 3.0497e+02 9.8703e+02 2.5353e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.7255e-02 9.8275e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 8.6432e+02 1.7767e-08 1.7488e-01 8.2512e-01 5.3970e+02 9.9060e+02 4.0932e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.9739e-02 9.8026e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 9.1703e+02 6.7374e-09 1.7189e-01 8.2811e-01 6.6850e+02 9.9372e+02 5.3806e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.1232e-02 9.7877e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 9.4163e+02 3.6105e-09 1.6949e-01 8.3051e-01 7.4098e+02 9.9671e+02 6.3051e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2429e-02 9.7757e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 9.5727e+02 2.5414e-09 1.6736e-01 8.3264e-01 7.9054e+02 9.9964e+02 7.0528e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.3484e-02 9.7652e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 9.6883e+02 1.9184e-09 1.6542e-01 8.3458e-01 8.2831e+02 1.0025e+03 7.7028e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.4448e-02 9.7555e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 9.7812e+02 1.5947e-09 1.6360e-01 8.3640e-01 8.5890e+02 1.0054e+03 8.2914e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.5348e-02 9.7465e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 9.8599e+02 3.6882e-10 1.6188e-01 8.3812e-01 8.8476e+02 1.0083e+03 8.8389e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.6197e-02 9.7380e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 9.7666e+02 2.5878e-09 1.6783e-01 8.3217e-01 8.0121e+02 1.0218e+03 7.1971e-05 7.8492e-04 1.0000e+00 0.0000e+00 2.3250e-02 9.7675e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 6.6446e+02 8.1262e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0141e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 6.6447e+02 8.1263e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0142e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 6.6429e+02 8.1239e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0136e+03 2.2796e-05 1.2463e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 6.6334e+02 8.1118e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0110e+03 2.2796e-05 8.8041e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 6.6170e+02 8.0909e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0063e+03 2.2796e-05 6.6611e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 6.5950e+02 8.0627e-08 1.8014e-01 8.1986e-01 2.5862e+02 1.0001e+03 2.2796e-05 5.2535e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 6.5685e+02 8.0287e-08 1.8014e-01 8.1986e-01 2.5862e+02 9.9273e+02 2.2796e-05 4.2735e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 6.0511e+02 7.7130e-08 1.8323e-01 8.1677e-01 2.2287e+02 9.8356e+02 2.2020e-05 3.5529e-04 1.0000e+00 0.0000e+00 1.5548e-02 9.8445e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 5.6409e+02 7.5342e-08 1.8560e-01 8.1440e-01 1.9825e+02 9.7351e+02 2.1800e-05 3.0346e-04 1.0000e+00 0.0000e+00 1.4352e-02 9.8565e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 5.3127e+02 7.4294e-08 1.8727e-01 8.1273e-01 1.8038e+02 9.6281e+02 2.1860e-05 2.6310e-04 1.0000e+00 0.0000e+00 1.3510e-02 9.8649e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt index 658585d20f6..fff2175593f 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] -0.0000e+00 1.0000e+06 3.5000e+02 3.0153e+01 6.8331e-12 5.0890e-01 4.9110e-01 1.5581e+01 9.7518e+02 1.7476e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2780e-03 9.9772e-01 -5.0000e-02 6.4444e+06 3.5000e+02 2.1973e+02 1.8071e-07 4.9719e-01 5.0281e-01 1.2309e+02 9.8215e+02 1.8998e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.1952e-02 9.8805e-01 -1.0000e-01 1.1889e+07 3.5000e+02 4.7060e+02 1.0674e-07 4.9067e-01 5.0933e-01 3.0497e+02 9.8703e+02 2.5353e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.7255e-02 9.8275e-01 -1.5000e-01 1.7333e+07 3.5000e+02 7.0387e+02 3.8725e-08 4.8759e-01 5.1241e-01 5.3970e+02 9.9060e+02 4.0932e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.9739e-02 9.8026e-01 -2.0000e-01 2.2778e+07 3.5000e+02 8.0378e+02 1.5410e-08 4.8573e-01 5.1427e-01 6.6850e+02 9.9372e+02 5.3806e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.1232e-02 9.7877e-01 -2.5000e-01 2.8222e+07 3.5000e+02 8.5399e+02 8.1962e-09 4.8424e-01 5.1576e-01 7.4098e+02 9.9671e+02 6.3051e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2429e-02 9.7757e-01 -3.0000e-01 3.3667e+07 3.5000e+02 8.8642e+02 5.6757e-09 4.8292e-01 5.1708e-01 7.9054e+02 9.9964e+02 7.0528e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.3484e-02 9.7652e-01 -3.5000e-01 3.9111e+07 3.5000e+02 9.1030e+02 4.1615e-09 4.8171e-01 5.1829e-01 8.2831e+02 1.0025e+03 7.7028e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.4448e-02 9.7555e-01 -4.0000e-01 4.4556e+07 3.5000e+02 9.2924e+02 3.3747e-09 4.8058e-01 5.1942e-01 8.5890e+02 1.0054e+03 8.2914e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.5348e-02 9.7465e-01 -4.5000e-01 5.0000e+07 3.5000e+02 9.4501e+02 2.1952e-10 4.7951e-01 5.2049e-01 8.8476e+02 1.0083e+03 8.8389e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.6197e-02 9.7380e-01 -5.0000e-01 3.0000e+07 3.0400e+02 9.0182e+02 5.7438e-09 4.8321e-01 5.1679e-01 8.0121e+02 1.0218e+03 7.1971e-05 7.8492e-04 1.0000e+00 0.0000e+00 2.3250e-02 9.7675e-01 -5.5000e-01 1.0000e+07 2.5800e+02 4.1666e+02 1.3361e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0141e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -6.0000e-01 1.0000e+07 2.7156e+02 4.1666e+02 1.3361e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0142e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -6.5000e-01 1.0000e+07 2.8511e+02 4.1662e+02 1.3360e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0136e+03 2.2796e-05 1.2463e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -7.0000e-01 1.0000e+07 2.9867e+02 4.1638e+02 1.3352e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0110e+03 2.2796e-05 8.8041e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -7.5000e-01 1.0000e+07 3.1222e+02 4.1598e+02 1.3339e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0063e+03 2.2796e-05 6.6611e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -8.0000e-01 1.0000e+07 3.2578e+02 4.1544e+02 1.3321e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0001e+03 2.2796e-05 5.2535e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -8.5000e-01 1.0000e+07 3.3933e+02 4.1479e+02 1.3300e-07 4.9085e-01 5.0915e-01 2.5862e+02 9.9273e+02 2.2796e-05 4.2735e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -9.0000e-01 1.0000e+07 3.5289e+02 3.6691e+02 1.2027e-07 4.9242e-01 5.0758e-01 2.2287e+02 9.8369e+02 2.2020e-05 3.5529e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 -9.5000e-01 1.0000e+07 3.6644e+02 3.4654e+02 1.1513e-07 4.9242e-01 5.0758e-01 2.0825e+02 9.7414e+02 2.1800e-05 3.0346e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 -1.0000e+00 1.0000e+07 3.8000e+02 3.4587e+02 1.1490e-07 4.9242e-01 5.0758e-01 2.0825e+02 9.6370e+02 2.1860e-05 2.6310e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 3.0153e+01 6.8331e-12 5.0890e-01 4.9110e-01 1.5581e+01 9.7518e+02 1.7476e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2780e-03 9.9772e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 2.1973e+02 1.8075e-07 4.9719e-01 5.0281e-01 1.2309e+02 9.8215e+02 1.8998e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.1952e-02 9.8805e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 4.7060e+02 1.0679e-07 4.9067e-01 5.0933e-01 3.0497e+02 9.8703e+02 2.5353e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.7255e-02 9.8275e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 7.0387e+02 3.8756e-08 4.8759e-01 5.1241e-01 5.3970e+02 9.9060e+02 4.0932e-05 3.6959e-04 1.0000e+00 0.0000e+00 1.9739e-02 9.8026e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 8.0378e+02 1.5436e-08 4.8573e-01 5.1427e-01 6.6850e+02 9.9372e+02 5.3806e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.1232e-02 9.7877e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 8.5399e+02 8.2196e-09 4.8424e-01 5.1576e-01 7.4098e+02 9.9671e+02 6.3051e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.2429e-02 9.7757e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 8.8642e+02 5.6977e-09 4.8292e-01 5.1708e-01 7.9054e+02 9.9964e+02 7.0528e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.3484e-02 9.7652e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 9.1030e+02 4.1821e-09 4.8171e-01 5.1829e-01 8.2831e+02 1.0025e+03 7.7028e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.4448e-02 9.7555e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 9.2924e+02 3.3945e-09 4.8058e-01 5.1942e-01 8.5890e+02 1.0054e+03 8.2914e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.5348e-02 9.7465e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 9.4501e+02 2.1952e-10 4.7951e-01 5.2049e-01 8.8476e+02 1.0083e+03 8.8389e-05 3.6959e-04 1.0000e+00 0.0000e+00 2.6197e-02 9.7380e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 9.0182e+02 5.7688e-09 4.8321e-01 5.1679e-01 8.0121e+02 1.0218e+03 7.1971e-05 7.8492e-04 1.0000e+00 0.0000e+00 2.3250e-02 9.7675e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 4.1666e+02 1.3367e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0141e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 4.1666e+02 1.3367e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0142e+03 2.2796e-05 1.7914e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 4.1662e+02 1.3366e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0136e+03 2.2796e-05 1.2463e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 4.1638e+02 1.3358e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0110e+03 2.2796e-05 8.8041e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 4.1598e+02 1.3345e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0063e+03 2.2796e-05 6.6611e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 4.1544e+02 1.3327e-07 4.9085e-01 5.0915e-01 2.5862e+02 1.0001e+03 2.2796e-05 5.2535e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 4.1479e+02 1.3305e-07 4.9085e-01 5.0915e-01 2.5862e+02 9.9273e+02 2.2796e-05 4.2735e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 3.6673e+02 1.2035e-07 4.9277e-01 5.0723e-01 2.2287e+02 9.8356e+02 2.2020e-05 3.5529e-04 1.0000e+00 0.0000e+00 1.5548e-02 9.8445e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 3.3195e+02 1.1255e-07 4.9425e-01 5.0575e-01 1.9825e+02 9.7351e+02 2.1800e-05 3.0346e-04 1.0000e+00 0.0000e+00 1.4352e-02 9.8565e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 3.0582e+02 1.0748e-07 4.9528e-01 5.0472e-01 1.8038e+02 9.6281e+02 2.1860e-05 2.6310e-04 1.0000e+00 0.0000e+00 1.3510e-02 9.8649e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt index 8906785dbfb..dd9e42f6abc 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] -0.0000e+00 1.0000e+06 3.5000e+02 7.0350e+01 -0.0000e+00 2.0920e-01 7.9080e-01 1.5581e+01 1.0033e+03 1.7476e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.2780e-03 9.9772e-01 -5.0000e-02 6.4444e+06 3.5000e+02 4.2620e+02 1.4060e-07 1.9028e-01 8.0972e-01 1.2309e+02 1.0115e+03 1.8998e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.1952e-02 9.8805e-01 -1.0000e-01 1.1889e+07 3.5000e+02 7.1657e+02 6.1766e-08 1.7971e-01 8.2029e-01 3.0497e+02 1.0174e+03 2.5353e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.7255e-02 9.8275e-01 -1.5000e-01 1.7333e+07 3.5000e+02 8.8389e+02 1.8255e-08 1.7472e-01 8.2528e-01 5.3970e+02 1.0219e+03 4.0932e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.9739e-02 9.8026e-01 -2.0000e-01 2.2778e+07 3.5000e+02 9.3956e+02 6.9892e-09 1.7171e-01 8.2829e-01 6.6850e+02 1.0258e+03 5.3806e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.1232e-02 9.7877e-01 -2.5000e-01 2.8222e+07 3.5000e+02 9.6584e+02 3.7839e-09 1.6928e-01 8.3072e-01 7.4098e+02 1.0295e+03 6.3051e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.2429e-02 9.7757e-01 -3.0000e-01 3.3667e+07 3.5000e+02 9.8271e+02 2.6836e-09 1.6714e-01 8.3286e-01 7.9054e+02 1.0331e+03 7.0528e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.3484e-02 9.7652e-01 -3.5000e-01 3.9111e+07 3.5000e+02 9.9529e+02 2.0386e-09 1.6518e-01 8.3482e-01 8.2831e+02 1.0366e+03 7.7028e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.4448e-02 9.7555e-01 -4.0000e-01 4.4556e+07 3.5000e+02 1.0055e+03 1.7012e-09 1.6334e-01 8.3666e-01 8.5890e+02 1.0401e+03 8.2914e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.5348e-02 9.7465e-01 -4.5000e-01 5.0000e+07 3.5000e+02 1.0141e+03 -0.0000e+00 1.6160e-01 8.3840e-01 8.8476e+02 1.0435e+03 8.8389e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.6197e-02 9.7380e-01 -5.0000e-01 3.0000e+07 3.0400e+02 9.8820e+02 2.6714e-09 1.6761e-01 8.3239e-01 8.0121e+02 1.0369e+03 7.1971e-05 8.6631e-04 1.0000e+00 0.0000e+00 2.3250e-02 9.7675e-01 -5.5000e-01 1.0000e+07 2.5800e+02 6.6631e+02 8.1373e-08 1.8000e-01 8.2000e-01 2.5862e+02 1.0189e+03 2.2796e-05 1.9511e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -6.0000e-01 1.0000e+07 2.7156e+02 6.6683e+02 8.1481e-08 1.8000e-01 8.2000e-01 2.5862e+02 1.0204e+03 2.2796e-05 1.9588e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -6.5000e-01 1.0000e+07 2.8511e+02 6.6723e+02 8.1565e-08 1.8001e-01 8.1999e-01 2.5862e+02 1.0216e+03 2.2796e-05 1.3681e-03 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -7.0000e-01 1.0000e+07 2.9867e+02 6.6753e+02 8.1627e-08 1.8001e-01 8.1999e-01 2.5862e+02 1.0224e+03 2.2796e-05 9.7022e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -7.5000e-01 1.0000e+07 3.1222e+02 6.6772e+02 8.1666e-08 1.8001e-01 8.1999e-01 2.5862e+02 1.0230e+03 2.2796e-05 7.3691e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -8.0000e-01 1.0000e+07 3.2578e+02 6.6781e+02 8.1685e-08 1.8002e-01 8.1998e-01 2.5862e+02 1.0232e+03 2.2796e-05 5.8345e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -8.5000e-01 1.0000e+07 3.3933e+02 6.6780e+02 8.1682e-08 1.8002e-01 8.1998e-01 2.5862e+02 1.0232e+03 2.2796e-05 4.7645e-04 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 -9.0000e-01 1.0000e+07 3.5289e+02 6.1511e+02 7.8253e-08 1.8256e-01 8.1744e-01 2.2287e+02 1.0135e+03 2.2020e-05 3.9764e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 -9.5000e-01 1.0000e+07 3.6644e+02 5.9255e+02 7.6620e-08 1.8256e-01 8.1744e-01 2.0825e+02 1.0080e+03 2.1800e-05 3.4093e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 -1.0000e+00 1.0000e+07 3.8000e+02 5.9234e+02 7.6569e-08 1.8255e-01 8.1745e-01 2.0825e+02 1.0072e+03 2.1860e-05 2.9672e-04 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 7.0128e+01 -0.0000e+00 2.0991e-01 7.9009e-01 1.5581e+01 1.0031e+03 1.7476e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.9113e-03 9.9809e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 4.2076e+02 1.4012e-07 1.9442e-01 8.0558e-01 1.2309e+02 1.0104e+03 1.8998e-05 4.1330e-04 1.0000e+00 0.0000e+00 9.8766e-03 9.9012e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 7.0876e+02 6.2613e-08 1.8589e-01 8.1411e-01 3.0497e+02 1.0159e+03 2.5353e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.4207e-02 9.8579e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 8.7797e+02 1.8713e-08 1.8189e-01 8.1811e-01 5.3970e+02 1.0201e+03 4.0932e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.6223e-02 9.8378e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 9.3472e+02 7.1683e-09 1.7949e-01 8.2051e-01 6.6850e+02 1.0239e+03 5.3806e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.7433e-02 9.8257e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 9.6152e+02 3.8743e-09 1.7754e-01 8.2246e-01 7.4098e+02 1.0275e+03 6.3051e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.8408e-02 9.8159e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 9.7872e+02 2.7452e-09 1.7582e-01 8.2418e-01 7.9054e+02 1.0311e+03 7.0528e-05 4.1330e-04 1.0000e+00 0.0000e+00 1.9272e-02 9.8073e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 9.9153e+02 2.0828e-09 1.7423e-01 8.2577e-01 8.2831e+02 1.0345e+03 7.7028e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.0066e-02 9.7993e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 1.0019e+03 1.7373e-09 1.7274e-01 8.2726e-01 8.5890e+02 1.0379e+03 8.2914e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.0811e-02 9.7919e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 1.0107e+03 -0.0000e+00 1.7132e-01 8.2868e-01 8.8476e+02 1.0413e+03 8.8389e-05 4.1330e-04 1.0000e+00 0.0000e+00 2.1518e-02 9.7848e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 9.8440e+02 2.7354e-09 1.7622e-01 8.2378e-01 8.0121e+02 1.0350e+03 7.1971e-05 8.6631e-04 1.0000e+00 0.0000e+00 1.9071e-02 9.8093e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 6.5825e+02 8.2318e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0182e+03 2.2796e-05 1.9511e-03 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 6.5867e+02 8.2404e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0194e+03 2.2796e-05 1.9588e-03 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 6.5899e+02 8.2472e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0203e+03 2.2796e-05 1.3681e-03 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 6.5923e+02 8.2521e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0210e+03 2.2796e-05 9.7022e-04 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 6.5939e+02 8.2553e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0215e+03 2.2796e-05 7.3691e-04 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 6.5946e+02 8.2568e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0217e+03 2.2796e-05 5.8345e-04 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 6.5945e+02 8.2566e-08 1.8617e-01 8.1383e-01 2.5862e+02 1.0217e+03 2.2796e-05 4.7645e-04 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 6.0674e+02 7.8820e-08 1.8863e-01 8.1137e-01 2.2287e+02 1.0120e+03 2.2020e-05 3.9764e-04 1.0000e+00 0.0000e+00 1.2818e-02 9.8718e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 5.6516e+02 7.6659e-08 1.9055e-01 8.0945e-01 1.9825e+02 1.0014e+03 2.1800e-05 3.4093e-04 1.0000e+00 0.0000e+00 1.1847e-02 9.8815e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 5.3199e+02 7.5372e-08 1.9191e-01 8.0809e-01 1.8038e+02 9.9055e+02 2.1860e-05 2.9672e-04 1.0000e+00 0.0000e+00 1.1151e-02 9.8885e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt index d6e955b2058..a3cddc788b1 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] - 0.000000e+00 1.000000e+06 3.500000e+02 3.016536e+01 -0.000000e+00 5.089022e-01 4.910978e-01 1.558128e+01 1.003303e+03 1.747638e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.277994e-03 9.977220e-01 - 5.000000e-02 6.444444e+06 3.500000e+02 2.204502e+02 1.813689e-07 4.971868e-01 5.028132e-01 1.230946e+02 1.011473e+03 1.899815e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.195219e-02 9.880478e-01 - 1.000000e-01 1.188889e+07 3.500000e+02 4.740379e+02 1.076109e-07 4.906675e-01 5.093325e-01 3.049677e+02 1.017404e+03 2.535323e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.725476e-02 9.827452e-01 - 1.500000e-01 1.733333e+07 3.500000e+02 7.117985e+02 3.924119e-08 4.875889e-01 5.124111e-01 5.396999e+02 1.021864e+03 4.093159e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.973906e-02 9.802609e-01 - 2.000000e-01 2.277778e+07 3.500000e+02 8.143664e+02 1.568867e-08 4.857319e-01 5.142681e-01 6.684956e+02 1.025779e+03 5.380604e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.123157e-02 9.787684e-01 - 2.500000e-01 2.822222e+07 3.500000e+02 8.661828e+02 8.383166e-09 4.842377e-01 5.157623e-01 7.409817e+02 1.029502e+03 6.305096e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.242914e-02 9.775709e-01 - 3.000000e-01 3.366667e+07 3.500000e+02 8.997842e+02 5.826937e-09 4.829188e-01 5.170812e-01 7.905432e+02 1.033113e+03 7.052829e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.348377e-02 9.765162e-01 - 3.500000e-01 3.911111e+07 3.500000e+02 9.246170e+02 4.287711e-09 4.817100e-01 5.182900e-01 8.283089e+02 1.036641e+03 7.702816e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.444839e-02 9.755516e-01 - 4.000000e-01 4.455556e+07 3.500000e+02 9.443580e+02 3.486464e-09 4.805809e-01 5.194191e-01 8.589037e+02 1.040103e+03 8.291432e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.534769e-02 9.746523e-01 - 4.500000e-01 5.000000e+07 3.500000e+02 9.608387e+02 -0.000000e+00 4.795131e-01 5.204869e-01 8.847573e+02 1.043507e+03 8.838897e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.619663e-02 9.738034e-01 - 5.000000e-01 3.000000e+07 3.040000e+02 9.078687e+02 5.838703e-09 4.832110e-01 5.167890e-01 8.012123e+02 1.036935e+03 7.197071e-05 8.663108e-04 1.000000e+00 0.000000e+00 2.325036e-02 9.767496e-01 - 5.500000e-01 1.000000e+07 2.580000e+02 4.170658e+02 1.337702e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.018909e+03 2.279620e-05 1.951069e-03 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 6.000000e-01 1.000000e+07 2.715556e+02 4.171930e+02 1.338278e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.020402e+03 2.279620e-05 1.958758e-03 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 6.500000e-01 1.000000e+07 2.851111e+02 4.172927e+02 1.338729e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.021574e+03 2.279620e-05 1.368087e-03 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 7.000000e-01 1.000000e+07 2.986667e+02 4.173656e+02 1.339059e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.022433e+03 2.279620e-05 9.702194e-04 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 7.500000e-01 1.000000e+07 3.122222e+02 4.174125e+02 1.339271e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.022986e+03 2.279620e-05 7.369136e-04 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 8.000000e-01 1.000000e+07 3.257778e+02 4.174342e+02 1.339368e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.023241e+03 2.279620e-05 5.834457e-04 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 8.500000e-01 1.000000e+07 3.393333e+02 4.174312e+02 1.339355e-07 4.908528e-01 5.091472e-01 2.586152e+02 1.023206e+03 2.279620e-05 4.764507e-04 1.000000e+00 0.000000e+00 1.710488e-02 9.828951e-01 - 9.000000e-01 1.000000e+07 3.528889e+02 3.689582e+02 1.210270e-07 4.924209e-01 5.075791e-01 2.228654e+02 1.013465e+03 2.202009e-05 3.976352e-04 1.000000e+00 0.000000e+00 1.583424e-02 9.841658e-01 - 9.500000e-01 1.000000e+07 3.664444e+02 3.486543e+02 1.159173e-07 4.924209e-01 5.075791e-01 2.082466e+02 1.007969e+03 2.180034e-05 3.409282e-04 1.000000e+00 0.000000e+00 1.583424e-02 9.841658e-01 - 1.000000e+00 1.000000e+07 3.800000e+02 3.486072e+02 1.158935e-07 4.924209e-01 5.075791e-01 2.082466e+02 1.007194e+03 2.185984e-05 2.967198e-04 1.000000e+00 0.000000e+00 1.583424e-02 9.841658e-01 + 0.000000e+00 1.000000e+06 3.500000e+02 3.014003e+01 -0.000000e+00 5.093418e-01 4.906582e-01 1.558128e+01 1.003122e+03 1.747638e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.911348e-03 9.980887e-01 + 5.000000e-02 6.444444e+06 3.500000e+02 2.195510e+02 1.810534e-07 4.997196e-01 5.002804e-01 1.230946e+02 1.010439e+03 1.899815e-05 4.133014e-04 1.000000e+00 0.000000e+00 9.876580e-03 9.901234e-01 + 1.000000e-01 1.188889e+07 3.500000e+02 4.719425e+02 1.077529e-07 4.944232e-01 5.055768e-01 3.049677e+02 1.015885e+03 2.535323e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.420697e-02 9.857930e-01 + 1.500000e-01 1.733333e+07 3.500000e+02 7.094484e+02 3.939650e-08 4.919412e-01 5.080588e-01 5.396999e+02 1.020123e+03 4.093159e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.622326e-02 9.837767e-01 + 2.000000e-01 2.277778e+07 3.500000e+02 8.121425e+02 1.575940e-08 4.904470e-01 5.095530e-01 6.684956e+02 1.023912e+03 5.380604e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.743311e-02 9.825669e-01 + 2.500000e-01 2.822222e+07 3.500000e+02 8.640585e+02 8.421158e-09 4.892400e-01 5.107600e-01 7.409817e+02 1.027542e+03 6.305096e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.840828e-02 9.815917e-01 + 3.000000e-01 3.366667e+07 3.500000e+02 8.977345e+02 5.854034e-09 4.881690e-01 5.118310e-01 7.905432e+02 1.031077e+03 7.052829e-05 4.133014e-04 1.000000e+00 0.000000e+00 1.927192e-02 9.807281e-01 + 3.500000e-01 3.911111e+07 3.500000e+02 9.226281e+02 4.307778e-09 4.871822e-01 5.128178e-01 8.283089e+02 1.034542e+03 7.702816e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.006636e-02 9.799336e-01 + 4.000000e-01 4.455556e+07 3.500000e+02 9.424216e+02 3.503328e-09 4.862556e-01 5.137444e-01 8.589037e+02 1.037949e+03 8.291432e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.081112e-02 9.791889e-01 + 4.500000e-01 5.000000e+07 3.500000e+02 9.589498e+02 -0.000000e+00 4.853750e-01 5.146250e-01 8.847573e+02 1.041307e+03 8.838897e-05 4.133014e-04 1.000000e+00 0.000000e+00 2.151791e-02 9.784821e-01 + 5.000000e-01 3.000000e+07 3.040000e+02 9.059034e+02 5.867539e-09 4.884181e-01 5.115819e-01 8.012123e+02 1.035022e+03 7.197071e-05 8.663108e-04 1.000000e+00 0.000000e+00 1.907116e-02 9.809288e-01 + 5.500000e-01 1.000000e+07 2.580000e+02 4.151326e+02 1.338928e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.018156e+03 2.279620e-05 1.951069e-03 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 6.000000e-01 1.000000e+07 2.715556e+02 4.152354e+02 1.339393e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.019380e+03 2.279620e-05 1.958758e-03 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 6.500000e-01 1.000000e+07 2.851111e+02 4.153159e+02 1.339758e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.020341e+03 2.279620e-05 1.368087e-03 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 7.000000e-01 1.000000e+07 2.986667e+02 4.153748e+02 1.340024e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.021045e+03 2.279620e-05 9.702194e-04 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 7.500000e-01 1.000000e+07 3.122222e+02 4.154127e+02 1.340196e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.021499e+03 2.279620e-05 7.369136e-04 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 8.000000e-01 1.000000e+07 3.257778e+02 4.154302e+02 1.340275e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.021708e+03 2.279620e-05 5.834457e-04 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 8.500000e-01 1.000000e+07 3.393333e+02 4.154278e+02 1.340264e-07 4.945956e-01 5.054044e-01 2.586152e+02 1.021679e+03 2.279620e-05 4.764507e-04 1.000000e+00 0.000000e+00 1.406667e-02 9.859333e-01 + 9.000000e-01 1.000000e+07 3.528889e+02 3.671015e+02 1.210247e-07 4.961270e-01 5.038730e-01 2.228654e+02 1.011968e+03 2.202009e-05 3.976352e-04 1.000000e+00 0.000000e+00 1.281805e-02 9.871820e-01 + 9.500000e-01 1.000000e+07 3.664444e+02 3.321740e+02 1.130544e-07 4.973159e-01 5.026841e-01 1.982515e+02 1.001443e+03 2.180034e-05 3.409282e-04 1.000000e+00 0.000000e+00 1.184660e-02 9.881534e-01 + 1.000000e+00 1.000000e+07 3.800000e+02 3.059671e+02 1.078762e-07 4.981656e-01 5.018344e-01 1.803834e+02 9.905529e+02 2.185984e-05 2.967198e-04 1.000000e+00 0.000000e+00 1.115109e-02 9.888489e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt index b192ed113b8..4b31e329a51 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt @@ -29,5 +29,5 @@ 8.0000e-01 1.0000e+07 3.2578e+02 2.5862e+02 1.6710e-07 1.0000e+00 0.0000e+00 2.5862e+02 1.0147e+03 2.5862e+02 1.0147e+03 2.2796e-05 5.8345e-04 4.4300e+05 2.4419e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 8.5000e-01 1.0000e+07 3.3933e+02 2.5862e+02 1.6710e-07 1.0000e+00 0.0000e+00 2.5862e+02 1.0147e+03 2.5862e+02 1.0147e+03 2.2796e-05 4.7645e-04 4.4300e+05 2.4419e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 9.0000e-01 1.0000e+07 3.5289e+02 2.2287e+02 1.4643e-07 1.0000e+00 0.0000e+00 2.2287e+02 1.0057e+03 2.2287e+02 1.0057e+03 2.2020e-05 3.9764e-04 4.6921e+05 3.0077e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 - 9.5000e-01 1.0000e+07 3.6644e+02 2.0825e+02 1.3856e-07 1.0000e+00 0.0000e+00 2.0825e+02 1.0006e+03 2.0825e+02 1.0006e+03 2.1800e-05 3.4093e-04 4.9257e+05 3.3151e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 - 1.0000e+00 1.0000e+07 3.8000e+02 2.0825e+02 1.3856e-07 1.0000e+00 0.0000e+00 2.0825e+02 1.0006e+03 2.0825e+02 1.0006e+03 2.1860e-05 2.9672e-04 5.1339e+05 3.3151e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 + 9.5000e-01 1.0000e+07 3.6644e+02 1.9825e+02 1.3397e-07 1.0000e+00 0.0000e+00 1.9825e+02 9.9588e+02 1.9825e+02 9.9588e+02 2.1800e-05 3.4093e-04 4.9257e+05 3.5888e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 + 1.0000e+00 1.0000e+07 3.8000e+02 1.8038e+02 1.2594e-07 1.0000e+00 0.0000e+00 1.8038e+02 9.8568e+02 1.8038e+02 9.8568e+02 2.1860e-05 2.9672e-04 5.1339e+05 4.1580e+05 1.0000e+00 0.0000e+00 0.0000e+00 1.0000e+00 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt index 1a8dd851403..6978296adab 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt @@ -10,24 +10,24 @@ # columns 14-15 = phase enthalpies # columns 16-17 = gas phase fractions [co2, water] # columns 18-19 = water phase fractions [co2, water] - 0.0000e+00 1.0000e+06 3.5000e+02 4.0414e+01 -0.0000e+00 3.7585e-01 6.2415e-01 1.5581e+01 1.0033e+03 1.5581e+01 1.0033e+03 1.7476e-05 4.1330e-04 5.4424e+05 2.8971e+05 1.0000e+00 0.0000e+00 2.2780e-03 9.9772e-01 - 5.0000e-02 6.4444e+06 3.5000e+02 2.8057e+02 1.6945e-07 3.6096e-01 6.3904e-01 1.2309e+02 1.0115e+03 1.2309e+02 1.0115e+03 1.8998e-05 4.1330e-04 5.0103e+05 2.9440e+05 1.0000e+00 0.0000e+00 1.1952e-02 9.8805e-01 - 1.0000e-01 1.1889e+07 3.5000e+02 5.5783e+02 9.1768e-08 3.5267e-01 6.4733e-01 3.0497e+02 1.0174e+03 3.0497e+02 1.0174e+03 2.5353e-05 4.1330e-04 4.4090e+05 2.9457e+05 1.0000e+00 0.0000e+00 1.7255e-02 9.8275e-01 - 1.5000e-01 1.7333e+07 3.5000e+02 7.7911e+02 3.1032e-08 3.4876e-01 6.5124e-01 5.3970e+02 1.0219e+03 5.3970e+02 1.0219e+03 4.0932e-05 4.1330e-04 3.8400e+05 2.9278e+05 1.0000e+00 0.0000e+00 1.9739e-02 9.8026e-01 - 2.0000e-01 2.2778e+07 3.5000e+02 8.6554e+02 1.2132e-08 3.4640e-01 6.5360e-01 6.6850e+02 1.0258e+03 6.6850e+02 1.0258e+03 5.3806e-05 4.1330e-04 3.5745e+05 2.9177e+05 1.0000e+00 0.0000e+00 2.1232e-02 9.7877e-01 - 2.5000e-01 2.8222e+07 3.5000e+02 9.0774e+02 6.4648e-09 3.4450e-01 6.5550e-01 7.4098e+02 1.0295e+03 7.4098e+02 1.0295e+03 6.3051e-05 4.1330e-04 3.4572e+05 2.9134e+05 1.0000e+00 0.0000e+00 2.2429e-02 9.7757e-01 - 3.0000e-01 3.3667e+07 3.5000e+02 9.3478e+02 4.5000e-09 3.4282e-01 6.5718e-01 7.9054e+02 1.0331e+03 7.9054e+02 1.0331e+03 7.0528e-05 4.1330e-04 3.3933e+05 2.9112e+05 1.0000e+00 0.0000e+00 2.3484e-02 9.7652e-01 - 3.5000e-01 3.9111e+07 3.5000e+02 9.5469e+02 3.3303e-09 3.4129e-01 6.5871e-01 8.2831e+02 1.0366e+03 8.2831e+02 1.0366e+03 7.7028e-05 4.1330e-04 3.3554e+05 2.9101e+05 1.0000e+00 0.0000e+00 2.4448e-02 9.7555e-01 - 4.0000e-01 4.4556e+07 3.5000e+02 9.7052e+02 2.7218e-09 3.3985e-01 6.6015e-01 8.5890e+02 1.0401e+03 8.5890e+02 1.0401e+03 8.2914e-05 4.1330e-04 3.3329e+05 2.9098e+05 1.0000e+00 0.0000e+00 2.5348e-02 9.7465e-01 - 4.5000e-01 5.0000e+07 3.5000e+02 9.8376e+02 -0.0000e+00 3.3849e-01 6.6151e-01 8.8476e+02 1.0435e+03 8.8476e+02 1.0435e+03 8.8389e-05 4.1330e-04 3.3203e+05 2.9099e+05 1.0000e+00 0.0000e+00 2.6197e-02 9.7380e-01 - 5.0000e-01 3.0000e+07 3.0400e+02 9.4184e+02 4.4991e-09 3.4319e-01 6.5681e-01 8.0121e+02 1.0369e+03 8.0121e+02 1.0369e+03 7.1971e-05 8.6631e-04 3.2279e+05 2.4851e+05 1.0000e+00 0.0000e+00 2.3250e-02 9.7675e-01 - 5.5000e-01 1.0000e+07 2.5800e+02 5.0008e+02 1.1631e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0189e+03 2.5862e+02 1.0189e+03 2.2796e-05 1.9511e-03 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 6.0000e-01 1.0000e+07 2.7156e+02 5.0031e+02 1.1639e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0204e+03 2.5862e+02 1.0204e+03 2.2796e-05 1.9588e-03 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 6.5000e-01 1.0000e+07 2.8511e+02 5.0049e+02 1.1645e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0216e+03 2.5862e+02 1.0216e+03 2.2796e-05 1.3681e-03 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 7.0000e-01 1.0000e+07 2.9867e+02 5.0063e+02 1.1650e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0224e+03 2.5862e+02 1.0224e+03 2.2796e-05 9.7022e-04 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 7.5000e-01 1.0000e+07 3.1222e+02 5.0071e+02 1.1653e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0230e+03 2.5862e+02 1.0230e+03 2.2796e-05 7.3691e-04 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 8.0000e-01 1.0000e+07 3.2578e+02 5.0075e+02 1.1654e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0232e+03 2.5862e+02 1.0232e+03 2.2796e-05 5.8345e-04 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 8.5000e-01 1.0000e+07 3.3933e+02 5.0075e+02 1.1654e-07 3.5291e-01 6.4709e-01 2.5862e+02 1.0232e+03 2.5862e+02 1.0232e+03 2.2796e-05 4.7645e-04 4.4300e+05 2.5230e+05 1.0000e+00 0.0000e+00 1.7105e-02 9.8290e-01 - 9.0000e-01 1.0000e+07 3.5289e+02 4.4864e+02 1.0717e-07 3.5490e-01 6.4510e-01 2.2287e+02 1.0135e+03 2.2287e+02 1.0135e+03 2.2020e-05 3.9764e-04 4.6921e+05 3.0715e+05 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 - 9.5000e-01 1.0000e+07 3.6644e+02 4.2658e+02 1.0335e-07 3.5490e-01 6.4510e-01 2.0825e+02 1.0080e+03 2.0825e+02 1.0080e+03 2.1800e-05 3.4093e-04 4.9257e+05 3.3721e+05 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 - 1.0000e+00 1.0000e+07 3.8000e+02 4.2649e+02 1.0332e-07 3.5490e-01 6.4510e-01 2.0825e+02 1.0072e+03 2.0825e+02 1.0072e+03 2.1860e-05 2.9672e-04 5.1339e+05 3.3721e+05 1.0000e+00 0.0000e+00 1.5834e-02 9.8417e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 4.0357e+01 -0.0000e+00 3.7640e-01 6.2360e-01 1.5581e+01 1.0031e+03 1.5581e+01 1.0031e+03 1.7476e-05 4.1330e-04 5.4424e+05 2.8948e+05 1.0000e+00 0.0000e+00 1.9113e-03 9.9809e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 2.7873e+02 1.6902e-07 3.6418e-01 6.3582e-01 1.2309e+02 1.0104e+03 1.2309e+02 1.0104e+03 1.8998e-05 4.1330e-04 5.0103e+05 2.9335e+05 1.0000e+00 0.0000e+00 9.8766e-03 9.9012e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 5.5415e+02 9.2084e-08 3.5744e-01 6.4256e-01 3.0497e+02 1.0159e+03 3.0497e+02 1.0159e+03 2.5353e-05 4.1330e-04 4.4090e+05 2.9348e+05 1.0000e+00 0.0000e+00 1.4207e-02 9.8579e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 7.7554e+02 3.1285e-08 3.5429e-01 6.4571e-01 5.3970e+02 1.0201e+03 5.3970e+02 1.0201e+03 4.0932e-05 4.1330e-04 3.8400e+05 2.9200e+05 1.0000e+00 0.0000e+00 1.6223e-02 9.8378e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 8.6235e+02 1.2241e-08 3.5239e-01 6.4761e-01 6.6850e+02 1.0239e+03 6.6850e+02 1.0239e+03 5.3806e-05 4.1330e-04 3.5745e+05 2.9116e+05 1.0000e+00 0.0000e+00 1.7433e-02 9.8257e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 9.0478e+02 6.5216e-09 3.5086e-01 6.4914e-01 7.4098e+02 1.0275e+03 7.4098e+02 1.0275e+03 6.3051e-05 4.1330e-04 3.4572e+05 2.9080e+05 1.0000e+00 0.0000e+00 1.8408e-02 9.8159e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 9.3197e+02 4.5397e-09 3.4950e-01 6.5050e-01 7.9054e+02 1.0311e+03 7.9054e+02 1.0311e+03 7.0528e-05 4.1330e-04 3.3933e+05 2.9063e+05 1.0000e+00 0.0000e+00 1.9272e-02 9.8073e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 9.5200e+02 3.3593e-09 3.4824e-01 6.5176e-01 8.2831e+02 1.0345e+03 8.2831e+02 1.0345e+03 7.7028e-05 4.1330e-04 3.3554e+05 2.9054e+05 1.0000e+00 0.0000e+00 2.0066e-02 9.7993e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 9.6792e+02 2.7458e-09 3.4706e-01 6.5294e-01 8.5890e+02 1.0379e+03 8.5890e+02 1.0379e+03 8.2914e-05 4.1330e-04 3.3329e+05 2.9051e+05 1.0000e+00 0.0000e+00 2.0811e-02 9.7919e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 9.8124e+02 -0.0000e+00 3.4594e-01 6.5406e-01 8.8476e+02 1.0413e+03 8.8476e+02 1.0413e+03 8.8389e-05 4.1330e-04 3.3203e+05 2.9052e+05 1.0000e+00 0.0000e+00 2.1518e-02 9.7848e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 9.3915e+02 4.5409e-09 3.4981e-01 6.5019e-01 8.0121e+02 1.0350e+03 8.0121e+02 1.0350e+03 7.1971e-05 8.6631e-04 3.2279e+05 2.4776e+05 1.0000e+00 0.0000e+00 1.9071e-02 9.8093e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 4.9655e+02 1.1662e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0182e+03 2.5862e+02 1.0182e+03 2.2796e-05 1.9511e-03 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 4.9674e+02 1.1668e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0194e+03 2.5862e+02 1.0194e+03 2.2796e-05 1.9588e-03 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 4.9689e+02 1.1673e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0203e+03 2.5862e+02 1.0203e+03 2.2796e-05 1.3681e-03 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 4.9700e+02 1.1677e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0210e+03 2.5862e+02 1.0210e+03 2.2796e-05 9.7022e-04 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 4.9706e+02 1.1680e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0215e+03 2.5862e+02 1.0215e+03 2.2796e-05 7.3691e-04 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 4.9710e+02 1.1681e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0217e+03 2.5862e+02 1.0217e+03 2.2796e-05 5.8345e-04 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 4.9709e+02 1.1680e-07 3.5766e-01 6.4234e-01 2.5862e+02 1.0217e+03 2.5862e+02 1.0217e+03 2.2796e-05 4.7645e-04 4.4300e+05 2.5089e+05 1.0000e+00 0.0000e+00 1.4067e-02 9.8593e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 4.4516e+02 1.0728e-07 3.5961e-01 6.4039e-01 2.2287e+02 1.0120e+03 2.2287e+02 1.0120e+03 2.2020e-05 3.9764e-04 4.6921e+05 3.0596e+05 1.0000e+00 0.0000e+00 1.2818e-02 9.8718e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 4.0659e+02 1.0143e-07 3.6112e-01 6.3888e-01 1.9825e+02 1.0014e+03 1.9825e+02 1.0014e+03 2.1800e-05 3.4093e-04 4.9257e+05 3.6269e+05 1.0000e+00 0.0000e+00 1.1847e-02 9.8815e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 3.7710e+02 9.7647e-08 3.6220e-01 6.3780e-01 1.8038e+02 9.9055e+02 1.8038e+02 9.9055e+02 2.1860e-05 2.9672e-04 5.1339e+05 4.1842e+05 1.0000e+00 0.0000e+00 1.1151e-02 9.8885e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt index 0a33d6dc22e..b765229a555 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] -0.0000e+00 1.0000e+06 3.5000e+02 6.7780e+01 2.1337e-08 2.1773e-01 7.8227e-01 1.5581e+01 1.0033e+03 1.7476e-05 4.1330e-04 9.5589e-01 4.4112e-02 2.2320e-03 9.9777e-01 -5.0000e-02 6.4444e+06 3.5000e+02 4.2328e+02 1.3988e-07 1.9253e-01 8.0747e-01 1.2309e+02 1.0114e+03 1.8998e-05 4.1330e-04 9.8984e-01 1.0158e-02 1.1731e-02 9.8827e-01 -1.0000e-01 1.1889e+07 3.5000e+02 7.1407e+02 6.1644e-08 1.8180e-01 8.1820e-01 3.0497e+02 1.0173e+03 2.5353e-05 4.1330e-04 9.9079e-01 9.2115e-03 1.7035e-02 9.8297e-01 -1.5000e-01 1.7333e+07 3.5000e+02 8.8262e+02 1.8484e-08 1.7661e-01 8.2339e-01 5.3970e+02 1.0219e+03 4.0932e-05 4.1330e-04 9.8874e-01 1.1255e-02 1.9789e-02 9.8021e-01 -2.0000e-01 2.2778e+07 3.5000e+02 9.3903e+02 7.0636e-09 1.7314e-01 8.2686e-01 6.6850e+02 1.0260e+03 5.3806e-05 4.1330e-04 9.8725e-01 1.2749e-02 2.1623e-02 9.7838e-01 -2.5000e-01 2.8222e+07 3.5000e+02 9.6553e+02 3.7969e-09 1.7065e-01 8.2935e-01 7.4098e+02 1.0297e+03 6.3051e-05 4.1330e-04 9.8650e-01 1.3500e-02 2.2909e-02 9.7709e-01 -3.0000e-01 3.3667e+07 3.5000e+02 9.8236e+02 2.6667e-09 1.6883e-01 8.3117e-01 7.9054e+02 1.0333e+03 7.0528e-05 4.1330e-04 9.8604e-01 1.3961e-02 2.3841e-02 9.7616e-01 -3.5000e-01 3.9111e+07 3.5000e+02 9.9478e+02 2.0090e-09 1.6746e-01 8.3254e-01 8.2831e+02 1.0367e+03 7.7028e-05 4.1330e-04 9.8571e-01 1.4290e-02 2.4538e-02 9.7546e-01 -4.0000e-01 4.4556e+07 3.5000e+02 1.0047e+03 1.6650e-09 1.6641e-01 8.3359e-01 8.5890e+02 1.0400e+03 8.2914e-05 4.1330e-04 9.8545e-01 1.4547e-02 2.5069e-02 9.7493e-01 -4.5000e-01 5.0000e+07 3.5000e+02 1.0131e+03 5.1360e-11 1.6561e-01 8.3439e-01 8.8476e+02 1.0432e+03 8.8389e-05 4.1330e-04 9.8524e-01 1.4761e-02 2.5477e-02 9.7452e-01 -5.0000e-01 3.0000e+07 3.0400e+02 9.8816e+02 2.6607e-09 1.6844e-01 8.3156e-01 8.0121e+02 1.0372e+03 7.1971e-05 8.6631e-04 9.8918e-01 1.0819e-02 2.3786e-02 9.7621e-01 -5.5000e-01 1.0000e+07 2.5800e+02 6.6430e+02 8.2527e-08 1.8156e-01 8.1844e-01 2.5862e+02 1.0189e+03 2.2796e-05 1.9511e-03 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -6.0000e-01 1.0000e+07 2.7156e+02 6.6481e+02 8.2643e-08 1.8156e-01 8.1844e-01 2.5862e+02 1.0203e+03 2.2796e-05 1.9588e-03 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -6.5000e-01 1.0000e+07 2.8511e+02 6.6522e+02 8.2733e-08 1.8156e-01 8.1844e-01 2.5862e+02 1.0215e+03 2.2796e-05 1.3681e-03 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -7.0000e-01 1.0000e+07 2.9867e+02 6.6551e+02 8.2800e-08 1.8156e-01 8.1844e-01 2.5862e+02 1.0223e+03 2.2796e-05 9.7022e-04 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -7.5000e-01 1.0000e+07 3.1222e+02 6.6570e+02 8.2842e-08 1.8156e-01 8.1844e-01 2.5862e+02 1.0229e+03 2.2796e-05 7.3691e-04 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -8.0000e-01 1.0000e+07 3.2578e+02 6.6579e+02 8.2862e-08 1.8156e-01 8.1844e-01 2.5862e+02 1.0231e+03 2.2796e-05 5.8345e-04 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -8.5000e-01 1.0000e+07 3.3933e+02 6.6563e+02 8.2888e-08 1.8167e-01 8.1833e-01 2.5862e+02 1.0231e+03 2.2796e-05 4.7645e-04 9.9353e-01 6.4726e-03 1.6875e-02 9.8313e-01 -9.0000e-01 1.0000e+07 3.5289e+02 6.1186e+02 7.9623e-08 1.8498e-01 8.1502e-01 2.2287e+02 1.0133e+03 2.2020e-05 3.9764e-04 9.9066e-01 9.3377e-03 1.5456e-02 9.8454e-01 -9.5000e-01 1.0000e+07 3.6644e+02 5.8928e+02 7.7989e-08 1.8498e-01 8.1502e-01 2.0825e+02 1.0078e+03 2.1800e-05 3.4093e-04 9.9066e-01 9.3377e-03 1.5456e-02 9.8454e-01 -1.0000e+00 1.0000e+07 3.8000e+02 5.8907e+02 7.7935e-08 1.8498e-01 8.1502e-01 2.0825e+02 1.0070e+03 2.1860e-05 2.9672e-04 9.9066e-01 9.3377e-03 1.5456e-02 9.8454e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 6.7803e+01 -0.0000e+00 2.1765e-01 7.8235e-01 1.5581e+01 1.0033e+03 1.7476e-05 4.1330e-04 9.5624e-01 4.3763e-02 2.2361e-03 9.9776e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 4.2372e+02 1.4158e-07 1.9220e-01 8.0780e-01 1.2309e+02 1.0114e+03 1.8998e-05 4.1330e-04 9.9009e-01 9.9058e-03 1.1877e-02 9.8812e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 7.1447e+02 6.2058e-08 1.8148e-01 8.1852e-01 3.0497e+02 1.0174e+03 2.5353e-05 4.1330e-04 9.9097e-01 9.0295e-03 1.7180e-02 9.8282e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 8.8272e+02 1.8503e-08 1.7650e-01 8.2350e-01 5.3970e+02 1.0219e+03 4.0932e-05 4.1330e-04 9.8862e-01 1.1385e-02 1.9853e-02 9.8015e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 9.3909e+02 7.0724e-09 1.7304e-01 8.2696e-01 6.6850e+02 1.0260e+03 5.3806e-05 4.1330e-04 9.8719e-01 1.2810e-02 2.1675e-02 9.7832e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 9.6556e+02 3.7888e-09 1.7058e-01 8.2942e-01 7.4098e+02 1.0298e+03 6.3051e-05 4.1330e-04 9.8648e-01 1.3525e-02 2.2943e-02 9.7706e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 9.8238e+02 2.6614e-09 1.6879e-01 8.3121e-01 7.9054e+02 1.0333e+03 7.0528e-05 4.1330e-04 9.8603e-01 1.3972e-02 2.3861e-02 9.7614e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 9.9479e+02 2.0006e-09 1.6743e-01 8.3257e-01 8.2831e+02 1.0367e+03 7.7028e-05 4.1330e-04 9.8570e-01 1.4295e-02 2.4550e-02 9.7545e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 1.0047e+03 1.6589e-09 1.6640e-01 8.3360e-01 8.5890e+02 1.0400e+03 8.2914e-05 4.1330e-04 9.8545e-01 1.4549e-02 2.5074e-02 9.7493e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 1.0131e+03 -0.0000e+00 1.6561e-01 8.3439e-01 8.8476e+02 1.0432e+03 8.8389e-05 4.1330e-04 9.8524e-01 1.4762e-02 2.5477e-02 9.7452e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 9.8810e+02 2.6433e-09 1.6858e-01 8.3142e-01 8.0121e+02 1.0372e+03 7.1971e-05 8.6631e-04 9.8894e-01 1.1064e-02 2.3734e-02 9.7627e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 6.6468e+02 8.1615e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0189e+03 2.2796e-05 1.9511e-03 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 6.6520e+02 8.1721e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0204e+03 2.2796e-05 1.9588e-03 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 6.6560e+02 8.1804e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0216e+03 2.2796e-05 1.3681e-03 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 6.6590e+02 8.1865e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0224e+03 2.2796e-05 9.7022e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 6.6609e+02 8.1904e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0230e+03 2.2796e-05 7.3691e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 6.6618e+02 8.1922e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0232e+03 2.2796e-05 5.8345e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 6.6617e+02 8.1919e-08 1.8128e-01 8.1872e-01 2.5862e+02 1.0232e+03 2.2796e-05 4.7645e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 6.1193e+02 7.8867e-08 1.8494e-01 8.1506e-01 2.2287e+02 1.0133e+03 2.2020e-05 3.9764e-04 9.9032e-01 9.6756e-03 1.5506e-02 9.8449e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 5.6888e+02 7.7290e-08 1.8793e-01 8.1207e-01 1.9825e+02 1.0027e+03 2.1800e-05 3.4093e-04 9.8522e-01 1.4779e-02 1.4444e-02 9.8556e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 5.3443e+02 7.6629e-08 1.9024e-01 8.0976e-01 1.8038e+02 9.9177e+02 2.1860e-05 2.9672e-04 9.7813e-01 2.1871e-02 1.3906e-02 9.8609e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt index 762ffae5a75..74e201c9889 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt @@ -8,24 +8,24 @@ # columns 10-11 = phase viscosities # columns 12-13 = gas phase fractions [co2, water] # columns 14-15 = water phase fractions [co2, water] -0.0000e+00 1.0000e+06 3.5000e+02 2.9256e+01 8.7493e-09 5.2521e-01 4.7479e-01 1.5581e+01 1.0033e+03 1.7476e-05 4.1330e-04 9.5589e-01 4.4112e-02 2.2320e-03 9.9777e-01 -5.0000e-02 6.4444e+06 3.5000e+02 2.1910e+02 1.8135e-07 5.0111e-01 4.9889e-01 1.2309e+02 1.0114e+03 1.8998e-05 4.1330e-04 9.8984e-01 1.0158e-02 1.1731e-02 9.8827e-01 -1.0000e-01 1.1889e+07 3.5000e+02 4.7218e+02 1.0761e-07 4.9425e-01 5.0575e-01 3.0497e+02 1.0173e+03 2.5353e-05 4.1330e-04 9.9079e-01 9.2115e-03 1.7035e-02 9.8297e-01 -1.5000e-01 1.7333e+07 3.5000e+02 7.1004e+02 3.9438e-08 4.9158e-01 5.0842e-01 5.3970e+02 1.0219e+03 4.0932e-05 4.1330e-04 9.8874e-01 1.1255e-02 1.9789e-02 9.8021e-01 -2.0000e-01 2.2778e+07 3.5000e+02 8.1301e+02 1.5784e-08 4.8984e-01 5.1016e-01 6.6850e+02 1.0260e+03 5.3806e-05 4.1330e-04 9.8725e-01 1.2749e-02 2.1623e-02 9.7838e-01 -2.5000e-01 2.8222e+07 3.5000e+02 8.6506e+02 8.4258e-09 4.8850e-01 5.1150e-01 7.4098e+02 1.0297e+03 6.3051e-05 4.1330e-04 9.8650e-01 1.3500e-02 2.2909e-02 9.7709e-01 -3.0000e-01 3.3667e+07 3.5000e+02 8.9875e+02 5.8443e-09 4.8750e-01 5.1250e-01 7.9054e+02 1.0333e+03 7.0528e-05 4.1330e-04 9.8604e-01 1.3961e-02 2.3841e-02 9.7616e-01 -3.5000e-01 3.9111e+07 3.5000e+02 9.2359e+02 4.2911e-09 4.8675e-01 5.1325e-01 8.2831e+02 1.0367e+03 7.7028e-05 4.1330e-04 9.8571e-01 1.4290e-02 2.4538e-02 9.7546e-01 -4.0000e-01 4.4556e+07 3.5000e+02 9.4329e+02 3.4823e-09 4.8618e-01 5.1382e-01 8.5890e+02 1.0400e+03 8.2914e-05 4.1330e-04 9.8545e-01 1.4547e-02 2.5069e-02 9.7493e-01 -4.5000e-01 5.0000e+07 3.5000e+02 9.5970e+02 2.8240e-11 4.8574e-01 5.1426e-01 8.8476e+02 1.0432e+03 8.8389e-05 4.1330e-04 9.8524e-01 1.4761e-02 2.5477e-02 9.7452e-01 -5.0000e-01 3.0000e+07 3.0400e+02 9.0721e+02 5.8529e-09 4.8643e-01 5.1357e-01 8.0121e+02 1.0372e+03 7.1971e-05 8.6631e-04 9.8918e-01 1.0819e-02 2.3786e-02 9.7621e-01 -5.5000e-01 1.0000e+07 2.5800e+02 4.1580e+02 1.3435e-07 4.9338e-01 5.0662e-01 2.5862e+02 1.0189e+03 2.2796e-05 1.9511e-03 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -6.0000e-01 1.0000e+07 2.7156e+02 4.1592e+02 1.3441e-07 4.9338e-01 5.0662e-01 2.5862e+02 1.0203e+03 2.2796e-05 1.9588e-03 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -6.5000e-01 1.0000e+07 2.8511e+02 4.1602e+02 1.3446e-07 4.9338e-01 5.0662e-01 2.5862e+02 1.0215e+03 2.2796e-05 1.3681e-03 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -7.0000e-01 1.0000e+07 2.9867e+02 4.1609e+02 1.3449e-07 4.9338e-01 5.0662e-01 2.5862e+02 1.0223e+03 2.2796e-05 9.7022e-04 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -7.5000e-01 1.0000e+07 3.1222e+02 4.1614e+02 1.3452e-07 4.9338e-01 5.0662e-01 2.5862e+02 1.0229e+03 2.2796e-05 7.3691e-04 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -8.0000e-01 1.0000e+07 3.2578e+02 4.1616e+02 1.3453e-07 4.9338e-01 5.0662e-01 2.5862e+02 1.0231e+03 2.2796e-05 5.8345e-04 9.9359e-01 6.4066e-03 1.6921e-02 9.8308e-01 -8.5000e-01 1.0000e+07 3.3933e+02 4.1611e+02 1.3454e-07 4.9346e-01 5.0654e-01 2.5862e+02 1.0231e+03 2.2796e-05 4.7645e-04 9.9353e-01 6.4726e-03 1.6875e-02 9.8313e-01 -9.0000e-01 1.0000e+07 3.5289e+02 3.6713e+02 1.2176e-07 4.9624e-01 5.0376e-01 2.2287e+02 1.0133e+03 2.2020e-05 3.9764e-04 9.9066e-01 9.3377e-03 1.5456e-02 9.8454e-01 -9.5000e-01 1.0000e+07 3.6644e+02 3.4688e+02 1.1663e-07 4.9624e-01 5.0376e-01 2.0825e+02 1.0078e+03 2.1800e-05 3.4093e-04 9.9066e-01 9.3377e-03 1.5456e-02 9.8454e-01 -1.0000e+00 1.0000e+07 3.8000e+02 3.4684e+02 1.1661e-07 4.9624e-01 5.0376e-01 2.0825e+02 1.0070e+03 2.1860e-05 2.9672e-04 9.9066e-01 9.3377e-03 1.5456e-02 9.8454e-01 + 0.0000e+00 1.0000e+06 3.5000e+02 2.9263e+01 -0.0000e+00 5.2507e-01 4.7493e-01 1.5581e+01 1.0033e+03 1.7476e-05 4.1330e-04 9.5624e-01 4.3763e-02 2.2361e-03 9.9776e-01 + 5.0000e-02 6.4444e+06 3.5000e+02 2.1919e+02 1.8208e-07 5.0084e-01 4.9916e-01 1.2309e+02 1.0114e+03 1.8998e-05 4.1330e-04 9.9009e-01 9.9058e-03 1.1877e-02 9.8812e-01 + 1.0000e-01 1.1889e+07 3.5000e+02 4.7232e+02 1.0783e-07 4.9401e-01 5.0599e-01 3.0497e+02 1.0174e+03 2.5353e-05 4.1330e-04 9.9097e-01 9.0295e-03 1.7180e-02 9.8282e-01 + 1.5000e-01 1.7333e+07 3.5000e+02 7.1006e+02 3.9445e-08 4.9155e-01 5.0845e-01 5.3970e+02 1.0219e+03 4.0932e-05 4.1330e-04 9.8862e-01 1.1385e-02 1.9853e-02 9.8015e-01 + 2.0000e-01 2.2778e+07 3.5000e+02 8.1304e+02 1.5789e-08 4.8979e-01 5.1021e-01 6.6850e+02 1.0260e+03 5.3806e-05 4.1330e-04 9.8719e-01 1.2810e-02 2.1675e-02 9.7832e-01 + 2.5000e-01 2.8222e+07 3.5000e+02 8.6507e+02 8.4220e-09 4.8847e-01 5.1153e-01 7.4098e+02 1.0298e+03 6.3051e-05 4.1330e-04 9.8648e-01 1.3525e-02 2.2943e-02 9.7706e-01 + 3.0000e-01 3.3667e+07 3.5000e+02 8.9876e+02 5.8416e-09 4.8748e-01 5.1252e-01 7.9054e+02 1.0333e+03 7.0528e-05 4.1330e-04 9.8603e-01 1.3972e-02 2.3861e-02 9.7614e-01 + 3.5000e-01 3.9111e+07 3.5000e+02 9.2360e+02 4.2866e-09 4.8674e-01 5.1326e-01 8.2831e+02 1.0367e+03 7.7028e-05 4.1330e-04 9.8570e-01 1.4295e-02 2.4550e-02 9.7545e-01 + 4.0000e-01 4.4556e+07 3.5000e+02 9.4329e+02 3.4789e-09 4.8617e-01 5.1383e-01 8.5890e+02 1.0400e+03 8.2914e-05 4.1330e-04 9.8545e-01 1.4549e-02 2.5074e-02 9.7493e-01 + 4.5000e-01 5.0000e+07 3.5000e+02 9.5970e+02 -0.0000e+00 4.8574e-01 5.1426e-01 8.8476e+02 1.0432e+03 8.8389e-05 4.1330e-04 9.8524e-01 1.4762e-02 2.5477e-02 9.7452e-01 + 5.0000e-01 3.0000e+07 3.0400e+02 9.0717e+02 5.8442e-09 4.8658e-01 5.1342e-01 8.0121e+02 1.0372e+03 7.1971e-05 8.6631e-04 9.8894e-01 1.1064e-02 2.3734e-02 9.7627e-01 + 5.5000e-01 1.0000e+07 2.5800e+02 4.1590e+02 1.3395e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0189e+03 2.2796e-05 1.9511e-03 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 6.0000e-01 1.0000e+07 2.7156e+02 4.1603e+02 1.3401e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0204e+03 2.2796e-05 1.9588e-03 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 6.5000e-01 1.0000e+07 2.8511e+02 4.1612e+02 1.3405e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0216e+03 2.2796e-05 1.3681e-03 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 7.0000e-01 1.0000e+07 2.9867e+02 4.1620e+02 1.3409e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0224e+03 2.2796e-05 9.7022e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 7.5000e-01 1.0000e+07 3.1222e+02 4.1624e+02 1.3411e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0230e+03 2.2796e-05 7.3691e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 8.0000e-01 1.0000e+07 3.2578e+02 4.1626e+02 1.3412e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0232e+03 2.2796e-05 5.8345e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 8.5000e-01 1.0000e+07 3.3933e+02 4.1626e+02 1.3412e-07 4.9318e-01 5.0682e-01 2.5862e+02 1.0232e+03 2.2796e-05 4.7645e-04 9.9368e-01 6.3236e-03 1.7058e-02 9.8294e-01 + 9.0000e-01 1.0000e+07 3.5289e+02 3.6711e+02 1.2142e-07 4.9630e-01 5.0370e-01 2.2287e+02 1.0133e+03 2.2020e-05 3.9764e-04 9.9032e-01 9.6756e-03 1.5506e-02 9.8449e-01 + 9.5000e-01 1.0000e+07 3.6644e+02 3.3128e+02 1.1378e-07 4.9947e-01 5.0053e-01 1.9825e+02 1.0027e+03 2.1800e-05 3.4093e-04 9.8522e-01 1.4779e-02 1.4444e-02 9.8556e-01 + 1.0000e+00 1.0000e+07 3.8000e+02 3.0410e+02 1.0903e-07 5.0273e-01 4.9727e-01 1.8038e+02 9.9177e+02 2.1860e-05 2.9672e-04 9.7813e-01 2.1871e-02 1.3906e-02 9.8609e-01 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT.txt deleted file mode 100644 index 7894909ba43..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT.txt +++ /dev/null @@ -1,2 +0,0 @@ -DensityFun PhillipsBrineDensity 1e6 5e7 1e6 340 360 10 1.0 -ViscosityFun PhillipsBrineViscosity 1.0 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt deleted file mode 100755 index 01dc19cc64f..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt +++ /dev/null @@ -1,2 +0,0 @@ -DensityFun EzrokhiBrineDensity 0.1033 -2.2991e-5 -2.3658e-6 -ViscosityFun EzrokhiBrineViscosity 0 0 0 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt deleted file mode 100644 index 20d27884f68..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt +++ /dev/null @@ -1,3 +0,0 @@ -DensityFun PhillipsBrineDensity 1e6 5e7 1e6 340 360 10 1.0 -ViscosityFun PhillipsBrineViscosity 1.0 -EnthalpyFun BrineEnthalpy 1e6 5e7 1e6 340 360 10 1.0 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt deleted file mode 100644 index 40c0cc8c35a..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt +++ /dev/null @@ -1 +0,0 @@ -FlashModel CO2Solubility 1e6 5e7 1e6 340 350 10 0 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt deleted file mode 100644 index f9661292bea..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt +++ /dev/null @@ -1,2 +0,0 @@ -DensityFun SpanWagnerCO2Density 1e6 5e7 1e6 340 360 10 -ViscosityFun FenghourCO2Viscosity 1e6 5e7 1e6 340 460 10 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt deleted file mode 100644 index 01cfd693883..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt +++ /dev/null @@ -1,3 +0,0 @@ -DensityFun SpanWagnerCO2Density 1e6 5e7 1e6 340 360 10 -ViscosityFun FenghourCO2Viscosity 1e6 5e7 1e6 340 460 10 -EnthalpyFun CO2Enthalpy 1e6 5e7 1e6 340 460 10 diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt deleted file mode 100644 index 98f2cb18927..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt +++ /dev/null @@ -1 +0,0 @@ -FlashModel CO2Solubility 0.99e6 5.01e7 4.911e6 339 351 1 0 1.0e-10 SpycherPruess diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt b/src/coreComponents/unitTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt deleted file mode 100644 index 3a70442e959..00000000000 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt +++ /dev/null @@ -1,2 +0,0 @@ -DensityFun WaterDensity -ViscosityFun PhillipsBrineViscosity 1.0 diff --git a/src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.xml b/src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.xml index d37ed605c49..dba47b3b159 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.xml +++ b/src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.xml @@ -39,8 +39,7 @@ name="reactiveFluid" phaseNames="{ water }" componentNames="{ H+, HCO3-, Ca+2, SO4-2, Cl-, Mg+2, Na+1 }" - componentMolarWeight="{ 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3}" - phasePVTParaFiles="{ testPVT_data/reactiveBrinePVT.txt }"/> + componentMolarWeight="{ 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3}" /> diff --git a/src/coreComponents/unitTests/fluidFlowTests/testFlowStatistics.cpp b/src/coreComponents/unitTests/fluidFlowTests/testFlowStatistics.cpp index 1ce3a8aad3f..4028836cf0c 100644 --- a/src/coreComponents/unitTests/fluidFlowTests/testFlowStatistics.cpp +++ b/src/coreComponents/unitTests/fluidFlowTests/testFlowStatistics.cpp @@ -39,7 +39,6 @@ CommandLineOptions g_commandLineOptions; struct TestInputs { string xmlInput; - std::map< string, string > tableFiles; string sourceFluxName; string sinkFluxName; @@ -146,35 +145,7 @@ struct TestSet class FlowStatisticsTest : public ::testing::Test -{ -public: - - void writeTableFiles( std::map< string, string > const & files ) - { - for( auto const & [fileName, content] : files ) - { - std::ofstream os( fileName ); - ASSERT_TRUE( os.is_open() ); - os << content; - os.close(); - - m_tableFileNames.push_back( fileName ); - } - } - - void TearDown() override - { - // removing temp table files - for( string const & fileName : m_tableFileNames ) - { - ASSERT_TRUE( std::remove( fileName.c_str() ) == 0 ); - } - m_tableFileNames.clear(); - } - -private: - stdVector< string > m_tableFileNames; -}; +{}; void setRateTable( array2d< real64 > & rateTable, std::initializer_list< std::initializer_list< real64 > > timestepPhaseValues ) @@ -648,8 +619,12 @@ TestSet getTestSet() phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" - flashModelParaFile="co2flash.txt" /> + pressureCoordinates="{1.5e7, 2.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{370.15, 400.15}" + temperatureInterval="2.0" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0, 0, 0}" /> )xml"; - testInputs.tableFiles["pvtgas.txt"] = "DensityFun SpanWagnerCO2Density 1.5e7 2.5e7 1e5 370.15 400.15 2\n" - "ViscosityFun FenghourCO2Viscosity 1.5e7 2.5e7 1e5 370.15 400.15 2\n"; - - testInputs.tableFiles["pvtliquid.txt"] = "DensityFun EzrokhiBrineDensity 0.1033 -2.2991e-5 -2.3658e-6\n" - "ViscosityFun EzrokhiBrineViscosity 0 0 0\n"; - - testInputs.tableFiles["co2flash.txt"] = "FlashModel CO2Solubility 1.5e7 2.5e7 1e5 370.15 400.15 2 0\n"; - - testInputs.sourceFluxName = "sourceFlux"; testInputs.sinkFluxName = "sinkFlux"; testInputs.timeStepCheckerPath = "/Tasks/timeStepChecker"; @@ -838,7 +804,6 @@ TestSet getTestSet() TEST_F( FlowStatisticsTest, checkMultiPhaseFluxStatisticsMass ) { TestSet const testSet = getTestSet(); - writeTableFiles( testSet.inputs.tableFiles ); GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); ProblemManager & problem = state.getProblemManager(); @@ -922,8 +887,12 @@ TestSet getTestSet() phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" - flashModelParaFile="co2flash.txt" /> + pressureCoordinates="{1.5e7, 2.5e7}" + pressureInterval="1e5" + temperatureCoordinates="{370.15, 400.15}" + temperatureInterval="2.0" + ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}" + ezrokhiViscosityCoefficients="{0, 0, 0}" /> )xml"; - testInputs.tableFiles["pvtgas.txt"] = "DensityFun SpanWagnerCO2Density 1.5e7 2.5e7 1e5 370.15 400.15 2\n" - "ViscosityFun FenghourCO2Viscosity 1.5e7 2.5e7 1e5 370.15 400.15 2\n"; - - testInputs.tableFiles["pvtliquid.txt"] = "DensityFun EzrokhiBrineDensity 0.1033 -2.2991e-5 -2.3658e-6\n" - "ViscosityFun EzrokhiBrineViscosity 0 0 0\n"; - - testInputs.tableFiles["co2flash.txt"] = "FlashModel CO2Solubility 1.5e7 2.5e7 1e5 370.15 400.15 2 0\n"; - - testInputs.sourceFluxName = "sourceFlux"; testInputs.sinkFluxName = "sinkFlux"; testInputs.timeStepCheckerPath = "/Tasks/timeStepChecker"; @@ -1116,7 +1076,6 @@ TestSet getTestSet() TEST_F( FlowStatisticsTest, checkMultiPhaseFluxStatisticsMol ) { TestSet const testSet = getTestSet(); - writeTableFiles( testSet.inputs.tableFiles ); GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); ProblemManager & problem = state.getProblemManager(); diff --git a/src/coreComponents/unitTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp b/src/coreComponents/unitTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp index 90a8e454cd2..ea13de12f54 100644 --- a/src/coreComponents/unitTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp +++ b/src/coreComponents/unitTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp @@ -34,16 +34,6 @@ CommandLineOptions g_commandLineOptions; // Sphinx start after input XML -char const * pvtLiquid = "DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 295.15 370.15 25 0\n" - "ViscosityFun PhillipsBrineViscosity 0\n" - "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 295.15 370.15 25 0\n"; - -char const * pvtGas = "DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 295.15 370.15 25\n" - "ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 295.15 370.15 25\n" - "EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 295.15 370.15 25\n"; - -char const * co2flash = "FlashModel CO2Solubility 1e6 7.5e7 5e5 295.15 370.15 25 0"; - char const * xmlInput = R"xml( @@ -119,8 +109,10 @@ char const * xmlInput = phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" - flashModelParaFile="co2flash.txt" /> + pressureCoordinates="{1e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{295.15, 370.15}" + temperatureInterval="25" /> ( g_commandLineOptions ) ) - { - writeTableToFile( pvtLiquidFilename, pvtLiquid ); - writeTableToFile( pvtGasFilename, pvtGas ); - writeTableToFile( co2flashFilename, co2flash ); - } + {} - ~ThermalCompositionalMultiphaseFlowTest() override - { - removeFile( pvtLiquidFilename ); - removeFile( pvtGasFilename ); - removeFile( co2flashFilename ); - } + ~ThermalCompositionalMultiphaseFlowTest() override = default; protected: @@ -313,10 +282,6 @@ class ThermalCompositionalMultiphaseFlowTest : public ::testing::Test GeosxState state; CompositionalMultiphaseFVM * solver; - - string const pvtLiquidFilename = "pvtliquid.txt"; - string const pvtGasFilename = "pvtgas.txt"; - string const co2flashFilename = "co2flash.txt"; }; real64 constexpr ThermalCompositionalMultiphaseFlowTest::time; diff --git a/src/coreComponents/unitTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp b/src/coreComponents/unitTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp index a3cf132a802..4b65ba10cd4 100644 --- a/src/coreComponents/unitTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp +++ b/src/coreComponents/unitTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp @@ -23,30 +23,8 @@ #include #include - using namespace geos; -void writeTableToFile( string const & filename, char const * str ) -{ - std::ofstream os( filename ); - ASSERT_TRUE( os.is_open() ); - os << str; - os.close(); -} - -void removeFile( string const & filename ) -{ - int const ret = std::remove( filename.c_str() ); - ASSERT_TRUE( ret == 0 ); -} -char const * co2flash = "FlashModel CO2Solubility 1e6 7.5e7 5e5 299.15 369.15 10 0"; -char const * pvtLiquid = "DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 299.15 369.15 10 0\n" - "ViscosityFun PhillipsBrineViscosity 0\n" - "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0\n"; - -char const * pvtGas = "DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 299.15 369.15 10\n" - "ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 299.15 369.15 10\n" - "EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 299.15 369.15 10\n"; char const * xmlInput = R"xml( @@ -204,8 +182,10 @@ char const * xmlInput = phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" - flashModelParaFile="co2flash.txt"/> + pressureCoordinates="{1e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{299.15, 369.15}" + temperatureInterval="10" /> ( g_commandLineOptions ) ); ProblemManager & problem = state.getProblemManager(); @@ -303,20 +284,18 @@ TEST( testTableFunctionsOutput, testOutputFiles ) EXPECT_TRUE( std::filesystem::exists( f2 )); EXPECT_TRUE( std::filesystem::exists( f3 )); EXPECT_TRUE( std::filesystem::exists( f4 )); - EXPECT_FALSE( std::filesystem::exists( f5 )); - - std::filesystem::remove( "fluid_phaseModel1_PhillipsBrineDensity_table.csv" ); - std::filesystem::remove( "fluid_phaseModel2_SpanWagnerCO2Density_table.csv" ); - std::filesystem::remove( "fluid_phaseModel2_FenghourCO2Viscosity_table.csv" ); - std::filesystem::remove( "fluid_CO2Solubility_co2Dissolution_table.csv" ); - std::filesystem::remove( "fluid_phaseModel1_PhillipsBrineViscosity_table.csv" ); + EXPECT_TRUE( std::filesystem::exists( f5 )); + EXPECT_FALSE( std::filesystem::exists( f6 )); + + std::filesystem::remove( f1 ); + std::filesystem::remove( f2 ); + std::filesystem::remove( f3 ); + std::filesystem::remove( f4 ); + std::filesystem::remove( f5 ); } int main( int argc, char * * argv ) { - writeTableToFile( "co2flash.txt", co2flash ); - writeTableToFile( "pvtliquid.txt", pvtLiquid ); - writeTableToFile( "pvtgas.txt", pvtGas ); ::testing::InitGoogleTest( &argc, argv ); g_commandLineOptions = *geos::basicSetup( argc, argv ); diff --git a/src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp b/src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp index 9a1ed698624..ca6178e4ee6 100644 --- a/src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp +++ b/src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp @@ -36,27 +36,7 @@ using namespace geos::constitutive; using namespace geos::testing; CommandLineOptions g_commandLineOptions; -void writeTableToFile( string const & filename, char const * str ) -{ - std::ofstream os( filename ); - ASSERT_TRUE( os.is_open() ); - os << str; - os.close(); -} -void removeFile( string const & filename ) -{ - int const ret = std::remove( filename.c_str() ); - ASSERT_TRUE( ret == 0 ); -} -char const * co2flash = "FlashModel CO2Solubility 1e6 7.5e7 5e5 299.15 369.15 10 0"; -char const * pvtLiquid = "DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 299.15 369.15 10 0\n" - "ViscosityFun PhillipsBrineViscosity 0\n" - "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0\n"; - -char const * pvtGas = "DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 299.15 369.15 10\n" - "ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 299.15 369.15 10\n" - "EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 299.15 369.15 10\n"; char const * xmlInput = R"xml( @@ -214,8 +194,10 @@ char const * xmlInput = phaseNames="{ gas, water }" componentNames="{ co2, water }" componentMolarWeight="{ 44e-3, 18e-3 }" - phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }" - flashModelParaFile="co2flash.txt"/> + pressureCoordinates="{1e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{299.15, 369.15}" + temperatureInterval="10" /> + pressureCoordinates="{1e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{299.15, 369.15}" + temperatureInterval="10" /> + pressureCoordinates="{1e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{299.15, 369.15}" + temperatureInterval="10" /> + pressureCoordinates="{1e6, 7.5e7}" + pressureInterval="5e5" + temperatureCoordinates="{299.15, 369.15}" + temperatureInterval="10" /> Date: Fri, 15 Aug 2025 14:26:02 -0500 Subject: [PATCH 5/5] Schema --- src/coreComponents/schema/schema.xsd | 109 ++++++++++++++++++++++----- 1 file changed, 89 insertions(+), 20 deletions(-) diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 875611d0423..725b7206f69 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -5821,8 +5821,10 @@ The expected format is "{ waterMax, oilMax }", in that order--> - - + + + + - - + + + + + + + + + + + + + + + + + + + + + @@ -5848,8 +5871,10 @@ Information output from lower logLevels is added with the desired log level - - + + + + - - + + + + + + + + + + + + + + + + @@ -5875,8 +5916,6 @@ Information output from lower logLevels is added with the desired log level - - - - + + + + + + + + + + + + + + + + @@ -5902,8 +5957,6 @@ Information output from lower logLevels is added with the desired log level - - - - + + + + + + + + + + + + + + + + @@ -7113,8 +7182,8 @@ Information output from lower logLevels is added with the desired log level - - + + @@ -7134,8 +7203,8 @@ Information output from lower logLevels is added with the desired log level - - + +