Skip to content

Commit

Permalink
Remove EOS template parameter from compositional fluid model (#3166)
Browse files Browse the repository at this point in the history
* Add generic parameters

* Fix LBC test

* Add EOS parameters to flash

---------

Co-authored-by: Pavel Tomin <[email protected]>
  • Loading branch information
dkachuma and paveltomin authored Jul 3, 2024
1 parent 1d43a2b commit 390b356
Show file tree
Hide file tree
Showing 37 changed files with 1,251 additions and 1,123 deletions.
8 changes: 4 additions & 4 deletions src/coreComponents/constitutive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ set( constitutive_headers
fluid/multifluid/compositional/functions/CompositionalProperties.hpp
fluid/multifluid/compositional/functions/CompositionalPropertiesImpl.hpp
fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp
fluid/multifluid/compositional/functions/FugacityCalculator.hpp
fluid/multifluid/compositional/functions/KValueInitialization.hpp
fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp
fluid/multifluid/compositional/functions/RachfordRice.hpp
fluid/multifluid/compositional/functions/StabilityTest.hpp
fluid/multifluid/compositional/models/ComponentProperties.hpp
fluid/multifluid/compositional/models/CompositionalDensity.hpp
fluid/multifluid/compositional/models/ConstantViscosity.hpp
fluid/multifluid/compositional/models/EquationOfState.hpp
fluid/multifluid/compositional/models/FunctionBase.hpp
fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp
fluid/multifluid/compositional/models/LohrenzBrayClarkViscosityImpl.hpp
Expand Down Expand Up @@ -226,10 +228,8 @@ set( constitutive_sources
fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.cpp
fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp
fluid/multifluid/compositional/CompositionalMultiphaseFluidUpdates.cpp
fluid/multifluid/compositional/PVTDriverRunTestCompositionalPR.cpp
fluid/multifluid/compositional/PVTDriverRunTestCompositionalPRLBC.cpp
fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRK.cpp
fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRKLBC.cpp
fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp
fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp
fluid/multifluid/reactive/ReactiveBrineFluid.cpp
fluid/multifluid/reactive/ReactiveMultiFluid.cpp
fluid/multifluid/reactive/ReactiveFluidDriver.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ void constitutiveUpdatePassThru( MultiFluidBase const & fluid,
// Need to split compilation units for all the options
#if !defined(GEOS_DEVICE_COMPILE)
CO2BrineEzrokhiThermalFluid,
CompositionalTwoPhasePengRobinsonLBCViscosity,
CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
CompositionalTwoPhaseLohrenzBrayClarkViscosity,
#endif
CompositionalTwoPhasePengRobinsonConstantViscosity,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity
CompositionalTwoPhaseConstantViscosity
>::execute( fluid, std::forward< LAMBDA >( lambda ) );
}

Expand All @@ -75,11 +73,9 @@ void constitutiveUpdatePassThru( MultiFluidBase & fluid,
// Need to split compilation units for all the options"
#if !defined(GEOS_DEVICE_COMPILE)
CO2BrineEzrokhiThermalFluid,
CompositionalTwoPhasePengRobinsonLBCViscosity,
CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
CompositionalTwoPhaseLohrenzBrayClarkViscosity,
#endif
CompositionalTwoPhasePengRobinsonConstantViscosity,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity
CompositionalTwoPhaseConstantViscosity
>::execute( fluid, std::forward< LAMBDA >( lambda ) );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,10 @@ integer CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::getWaterP
return PVTProps::PVTFunctionHelpers::findName( m_phaseNames, expectedWaterPhaseNames, viewKeyStruct::phaseNamesString() );
}

// Naming conventions
namespace compositional
{
template< int NP > struct PhaseName {};
template<> struct PhaseName< 2 > { static constexpr char const * catalogName() { return "TwoPhase"; } };
template<> struct PhaseName< 3 > { static constexpr char const * catalogName() { return "ThreePhase"; } };
}

template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 >
string CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::catalogName()
{
return GEOS_FMT( "Compositional{}Fluid{}{}",
compositional::PhaseName< FLASH::KernelWrapper::getNumberOfPhases() >::catalogName(),
return GEOS_FMT( "Compositional{}Fluid{}",
FLASH::catalogName(),
PHASE1::Viscosity::catalogName() );
}
Expand Down Expand Up @@ -268,39 +259,21 @@ CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::createModelParame

// Explicit instantiation of the model template.
template class CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashPRPR,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel > >;
template class CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashSRKSRK,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel > >;
compositional::NegativeTwoPhaseFlashModel,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel > >;
template class CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashPRPR,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >;
template class CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashSRKSRK,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >;

REGISTER_CATALOG_ENTRY( ConstitutiveBase,
CompositionalTwoPhasePengRobinsonConstantViscosity,
string const &,
dataRepository::Group * const )

REGISTER_CATALOG_ENTRY( ConstitutiveBase,
CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity,
string const &,
dataRepository::Group * const )
compositional::NegativeTwoPhaseFlashModel,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >;

REGISTER_CATALOG_ENTRY( ConstitutiveBase,
CompositionalTwoPhasePengRobinsonLBCViscosity,
CompositionalTwoPhaseConstantViscosity,
string const &,
dataRepository::Group * const )

REGISTER_CATALOG_ENTRY( ConstitutiveBase,
CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity,
CompositionalTwoPhaseLohrenzBrayClarkViscosity,
string const &,
dataRepository::Group * const )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#include "constitutive/fluid/multifluid/compositional/models/NullModel.hpp"
#include "constitutive/fluid/multifluid/compositional/models/PhaseModel.hpp"

#include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
#include "constitutive/fluid/multifluid/MultiFluidUtils.hpp"

namespace geos
{
namespace constitutive
Expand Down Expand Up @@ -134,22 +131,14 @@ class CompositionalMultiphaseFluid : public MultiFluidBase
PhaseComp::ValueType m_kValues;
};

using CompositionalTwoPhasePengRobinsonConstantViscosity = CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashPRPR,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel > >;
using CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity = CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashSRKSRK,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel > >;
using CompositionalTwoPhasePengRobinsonLBCViscosity = CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashPRPR,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >;
using CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity = CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashSRKSRK,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >;
using CompositionalTwoPhaseConstantViscosity = CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashModel,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel > >;
using CompositionalTwoPhaseLohrenzBrayClarkViscosity = CompositionalMultiphaseFluid<
compositional::NegativeTwoPhaseFlashModel,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >,
compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >;

} /* namespace constitutive */

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
*/

/*
* PVTDriverRunTestCompositionalPRLBC.cpp
* PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp
*/

#include "constitutive/fluid/multifluid/PVTDriverRunTest.hpp"
#include "constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp"

namespace geos
{
template void PVTDriver::runTest< constitutive::CompositionalTwoPhasePengRobinsonLBCViscosity >(
constitutive::CompositionalTwoPhasePengRobinsonLBCViscosity &, arrayView2d< real64 > const & );
template void PVTDriver::runTest< constitutive::CompositionalTwoPhaseConstantViscosity >(
constitutive::CompositionalTwoPhaseConstantViscosity &, arrayView2d< real64 > const & );
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
*/

/*
* PVTDriverRunTestCompositionalPR.cpp
* PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp
*/

#include "constitutive/fluid/multifluid/PVTDriverRunTest.hpp"
#include "constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp"

namespace geos
{
template void PVTDriver::runTest< constitutive::CompositionalTwoPhasePengRobinsonConstantViscosity >(
constitutive::CompositionalTwoPhasePengRobinsonConstantViscosity &, arrayView2d< real64 > const & );
template void PVTDriver::runTest< constitutive::CompositionalTwoPhaseLohrenzBrayClarkViscosity >(
constitutive::CompositionalTwoPhaseLohrenzBrayClarkViscosity &, arrayView2d< real64 > const & );
}
Loading

0 comments on commit 390b356

Please sign in to comment.