Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate fluid models #3123

Merged
merged 13 commits into from
Jun 4, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,19 @@ void constitutiveUpdatePassThru( MultiFluidBase const & fluid,
{
ConstitutivePassThruHandler< DeadOilFluid,
BlackOilFluid,
CompositionalTwoPhasePengRobinsonConstantViscosity,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity,
// CompositionalTwoPhasePengRobinsonLBCViscosity,
// CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
#ifdef GEOSX_USE_PVTPackage
CompositionalMultiphaseFluidPVTPackage,
#endif
CO2BrinePhillipsFluid,
CO2BrineEzrokhiFluid,
CO2BrinePhillipsThermalFluid
// ,CO2BrineEzrokhiThermalFluid "Uncommenting this will lead to compiler segfault. Need to split compilation
// units for all the options"
CO2BrinePhillipsThermalFluid,
#if !defined(GEOSX_DEVICE_COMPILE)
dkachuma marked this conversation as resolved.
Show resolved Hide resolved
CO2BrineEzrokhiThermalFluid,
CompositionalTwoPhasePengRobinsonLBCViscosity,
CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
#endif
CompositionalTwoPhasePengRobinsonConstantViscosity,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity
>::execute( fluid, std::forward< LAMBDA >( lambda ) );
}

Expand All @@ -62,18 +63,19 @@ void constitutiveUpdatePassThru( MultiFluidBase & fluid,
{
ConstitutivePassThruHandler< DeadOilFluid,
BlackOilFluid,
CompositionalTwoPhasePengRobinsonConstantViscosity,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity,
// CompositionalTwoPhasePengRobinsonLBCViscosity,
// CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
#ifdef GEOSX_USE_PVTPackage
CompositionalMultiphaseFluidPVTPackage,
#endif
CO2BrinePhillipsFluid,
CO2BrineEzrokhiFluid,
CO2BrinePhillipsThermalFluid
//,CO2BrineEzrokhiThermalFluid "Uncommenting this will lead to compiler segfault. Need to split compilation
// units for all the options"
CO2BrinePhillipsThermalFluid,
#if !defined(GEOSX_DEVICE_COMPILE)
CO2BrineEzrokhiThermalFluid,
CompositionalTwoPhasePengRobinsonLBCViscosity,
CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
#endif
CompositionalTwoPhasePengRobinsonConstantViscosity,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity
>::execute( fluid, std::forward< LAMBDA >( lambda ) );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ void PVTDriver::compareWithBaseline()
{
headerRows++;
}
if( m_outputMassDensity )
{
headerRows++;
}
if( m_outputPhaseComposition )
{
headerRows += getFluid().numFluidPhases();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,14 @@ struct NegativeTwoPhaseFlash
}

bool kValueReset = true;
constexpr real64 boundsTolerance = 1.0e-3;
constexpr real64 boundsTolerance = MultiFluidConstants::SSITolerance;
if( needInitialisation )
{
KValueInitialization::computeWilsonGasLiquidKvalue( numComps,
pressure,
temperature,
componentProperties,
kVapourLiquid );/**
vapourPhaseMoleFraction = RachfordRice::solve(
kVapourLiquid.toSliceConst(), composition, presentComponents
);
if( vapourPhaseMoleFraction < -boundsTolerance ||
vapourPhaseMoleFraction > 1.0 + boundsTolerance )
{
kValueReset = true;
KValueInitialization::computeConstantLiquidKvalue( numComps,
pressure,
temperature,
componentProperties,
kVapourLiquid );
}*/
kVapourLiquid );
}

vapourPhaseMoleFraction = RachfordRice::solve( kVapourLiquid.toSliceConst(), composition, presentComponents );
Expand Down Expand Up @@ -164,20 +151,7 @@ struct NegativeTwoPhaseFlash
kVapourLiquid[ic] *= exp( fugacityRatios[ic] );
}
}
//std::cout
//<< std::setw(3) << iterationCount << " "
//<< std::setw(12) << pressure << " "
//<< std::setw(10) << temperature << " "
//<< std::setw(15) << error << " "
//<< std::setw(15) << vapourPhaseMoleFraction << " ";
//for( integer const ic : {0,1,8} )
//{
// std::cout << std::setw(15) << kVapourLiquid[ic] << " ";
//}
//std::cout
//<< "\n";
}
//std::cout << "================================================================================\n";

// Retrieve physical bounds from negative flash values
if( vapourPhaseMoleFraction < MultiFluidConstants::epsilon )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
integer const numDofs = 2 + m_numComponents;

// Iterative solve to converge flash
bool const flashStatus = NegativeTwoPhaseFlash::compute< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >(
NegativeTwoPhaseFlash::compute< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >(

Check warning on line 67 in src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp#L67

Added line #L67 was not covered by tests
m_numComponents,
pressure,
temperature,
Expand All @@ -74,9 +74,6 @@
phaseFraction.value[m_vapourIndex],
phaseCompFraction.value[m_liquidIndex],
phaseCompFraction.value[m_vapourIndex] );
GEOS_UNUSED_VAR( flashStatus );
//GEOS_ERROR_IF( !flashStatus,
dkachuma marked this conversation as resolved.
Show resolved Hide resolved
// GEOS_FMT( "Negative two phase flash failed to converge {:.5e} {:.3f}", pressure, temperature ));

// Calculate derivatives
NegativeTwoPhaseFlash::computeDerivatives< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set( gtest_pvt_xmls
testPVT_CO2Brine.xml
testPVT_CO2BrineTables.xml
testPVT_PhaseComposition.xml
testPVT_Compositional.xml
)

set( gtest_reactivefluid_xmls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
outputMassDensity="1"
outputCompressibility="1"
outputPhaseComposition="1"
output="testPVT_Compositional_liveOilPR.txt"
baseline="testPVT_Compositional_liveOilPR.txt"
logLevel="1"/>
<PVTDriver
name="testLiveOilPRLBC"
Expand All @@ -24,7 +24,7 @@
outputMassDensity="1"
outputCompressibility="1"
outputPhaseComposition="1"
output="testPVT_Compositional_liveOilPRLBC.txt"
baseline="testPVT_Compositional_liveOilPRLBC.txt"
logLevel="1"/>
<PVTDriver
name="testLiveOilSRK"
Expand All @@ -36,7 +36,7 @@
outputMassDensity="1"
outputCompressibility="1"
outputPhaseComposition="1"
output="testPVT_Compositional_liveOilSRK.txt"
baseline="testPVT_Compositional_liveOilSRK.txt"
logLevel="1"/>
<PVTDriver
name="testLiveOilSRKLBC"
Expand All @@ -48,7 +48,7 @@
outputMassDensity="1"
outputCompressibility="1"
outputPhaseComposition="1"
output="testPVT_Compositional_liveOilSRKLBC.txt"
baseline="testPVT_Compositional_liveOilSRKLBC.txt"
logLevel="1"/>
</Tasks>

Expand Down
Loading