diff --git a/opm/material/fluidsystems/chifluid/chiwoms.h b/opm/material/fluidsystems/chifluid/chiwoms.h deleted file mode 100644 index 3c1db10be..000000000 --- a/opm/material/fluidsystems/chifluid/chiwoms.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef __CHIWOMS_H__ -#define __CHIWOMS_H__ - -// values are from the paper "Field-scale implications of density-driven -// convection in CO2-EOR reservoirs", to be presented at the Fifth CO2 -// Geological Storage Workshop, at 21–23 November 2018, in Utrecht, -// The Netherlands. - -constexpr double TEMPERATURE = 80; /* degree Celsius */ -constexpr double GRAVITYFACTOR = 1; /* fraction og gravity */ -constexpr double MIN_PRES = 75; /* bars */ -const double MAX_PRES = 220; /* bars */ -constexpr double SIM_TIME = 1; /* days */ -constexpr double Y_SIZE = 1.0; /* meter */ -constexpr double X_SIZE = 1.0; /* meter */ -constexpr double Z_SIZE = 1.0; /* meter */ -const unsigned NX = 5; /* number of cells x-dir */ -const unsigned NY = 5; /* number of cells y-dir */ -const unsigned NZ = 5; /* number of cells z-dir */ -const double POROSITY = 0.2; /* non-dimensional */ -const double PERMEABILITY = 100; /* milli-Darcy */ -const double DIFFUSIVITY = 1e-9; /* square meter per second */ -const double MFCOMP0 = 0.9999999; -const double MFCOMP1 = 0.0000001; -const double MFCOMP2 = 0.0; -constexpr double INFLOW_RATE = -1e-4; /* unit kg/s ? */ - -/* "random" fields will be equal as long as this is set the same */ -const double SEED = 5163166242092481088; - -#endif /* __CHIWOMS_H__ */ diff --git a/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh b/opm/material/fluidsystems/chifluid/threecomponentfluidsystem.hh similarity index 93% rename from opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh rename to opm/material/fluidsystems/chifluid/threecomponentfluidsystem.hh index a08101d9b..8d7aa81a7 100644 --- a/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh +++ b/opm/material/fluidsystems/chifluid/threecomponentfluidsystem.hh @@ -1,5 +1,5 @@ -#ifndef OPM_JULIATHREECOMPONENTFLUIDSYSTEM_HH -#define OPM_JULIATHREECOMPONENTFLUIDSYSTEM_HH +#ifndef OPM_THREECOMPONENTFLUIDSYSTEM_HH +#define OPM_THREECOMPONENTFLUIDSYSTEM_HH #include #include @@ -12,13 +12,13 @@ namespace Opm { /*! * \ingroup FluidSystem * - * \brief A two phase three component fluid system from the Julia test + * \brief A two phase three component fluid system with components * CO2, Methane and NDekan */ template - class JuliaThreeComponentFluidSystem - : public Opm::BaseFluidSystem > { + class ThreeComponentFluidSystem + : public Opm::BaseFluidSystem > { public: // TODO: I do not think these should be constant in fluidsystem, will try to make it non-constant later static constexpr int numPhases=2; @@ -39,9 +39,9 @@ namespace Opm { using Comp2 = Opm::JuliaC10; template - using ParameterCache = Opm::ChiParameterCache>; - using LBCviscosity = typename Opm::LBCviscosity>; - using PengRobinsonMixture = typename Opm::PengRobinsonMixture>; + using ParameterCache = Opm::ChiParameterCache>; + using LBCviscosity = typename Opm::LBCviscosity>; + using PengRobinsonMixture = typename Opm::PengRobinsonMixture>; /*! * \brief The acentric factor of a component []. @@ -197,4 +197,4 @@ namespace Opm { }; } -#endif //OPM_JULIATHREECOMPONENTFLUIDSYSTEM_HH \ No newline at end of file +#endif //OPM_THREECOMPONENTFLUIDSYSTEM_HH \ No newline at end of file diff --git a/opm/material/fluidsystems/chifluid/twophasefluidsystem.hh b/opm/material/fluidsystems/chifluid/twophasefluidsystem.hh deleted file mode 100644 index 670b5b674..000000000 --- a/opm/material/fluidsystems/chifluid/twophasefluidsystem.hh +++ /dev/null @@ -1,307 +0,0 @@ -#ifndef TWOPHASEFLUIDSYSTEM_HH -#define TWOPHASEFLUIDSYSTEM_HH - -#include "components.hh" -#include "chiwoms.h" -#include "LBCviscosity.hpp" - -#include -#include -#include // invalid_argument -#include -#include -#include -#include // mt19937, normal_distribution -#include // epsilon -#include // boost::format - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include "ChiParameterCache.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - - -namespace Opm { -/*! - * \ingroup Fluidsystems - * - * \brief A two-phase fluid system with three components - */ -template -class TwoPhaseTwoComponentFluidSystem - : public Opm::BaseFluidSystem > -{ - using ThisType = TwoPhaseTwoComponentFluidSystem; - using PengRobinsonMixture = typename Opm::PengRobinsonMixture; - using LBCviscosity = typename Opm::LBCviscosity; - -public: - //! \copydoc BaseFluidSystem::ParameterCache - //template - //using ParameterCache = Opm::NullParameterCache; - - //! \copydoc BaseFluidSystem::ParameterCache - template - using ParameterCache = Opm::ChiParameterCache; - - /**************************************** - * Fluid phase related static parameters - ****************************************/ - - //! \copydoc BaseFluidSystem::numPhases - static const int numPhases = 2; - - //! Index of the liquid phase - static const int oilPhaseIdx = 0; - static const int gasPhaseIdx = 1; - - //! \copydoc BaseFluidSystem::phaseName - static const char* phaseName(unsigned phaseIdx) - { - static const char* name[] = {"o", // oleic phase - "g"}; // gas phase - - assert(0 <= phaseIdx && phaseIdx < numPhases); - return name[phaseIdx]; - } - - //! \copydoc BaseFluidSystem::isIdealMixture - static bool isIdealMixture(unsigned phaseIdx) - { - if (phaseIdx == oilPhaseIdx) - return false; - - // CO2 have associative effects - return true; - } - - - /**************************************** - * Component related static parameters - ****************************************/ - - //! \copydoc BaseFluidSystem::numComponents - static const int numComponents = 2; // Comp0, Comp1 and Comp2 - - //! first comp idx - static const int Comp0Idx = 0; - - //! second comp idx - static const int Comp1Idx = 1; - - // TODO: make this a loop over choises in chiwoms.hh - // using Comp0 = Opm::Methane; - using Comp0 = Opm::ChiwomsBrine; - using Comp1 = Opm::ChiwomsCO2; - - - //! \copydoc BaseFluidSystem::componentName - static const char* componentName(unsigned compIdx) - { - static const char* name[] = { - Comp0::name(), - Comp1::name(), - }; - - assert(0 <= compIdx && compIdx < numComponents); - return name[compIdx]; - } - - //! \copydoc BaseFluidSystem::molarMass - static Scalar molarMass(unsigned compIdx) - { - return (compIdx == Comp0Idx) - ? Comp0::molarMass() - : (compIdx == Comp1Idx) - ? Comp1::molarMass() - : throw std::invalid_argument("Molar mass component index"); - } - - /*! - * \brief Critical temperature of a component [K]. - * - * \copydetails Doxygen::compIdxParam - */ - static Scalar criticalTemperature(unsigned compIdx) - { - return (compIdx == Comp0Idx) - ? Comp0::criticalTemperature() - : (compIdx == Comp1Idx) - ? Comp1::criticalTemperature() - : throw std::invalid_argument("Critical temperature component index"); - } - - /*! - * \brief Critical pressure of a component [Pa]. - * - * \copydetails Doxygen::compIdxParam - */ - static Scalar criticalPressure(unsigned compIdx) - { - return (compIdx == Comp0Idx) - ? Comp0::criticalPressure() - : (compIdx == Comp1Idx) - ? Comp1::criticalPressure() - : throw std::invalid_argument("Critical pressure component index"); - } - - /*! - * \brief Critical volume of a component [m3]. - * - * \copydetails Doxygen::compIdxParam - */ - static Scalar criticalVolume(unsigned compIdx) - { - return (compIdx == Comp0Idx) - ? Comp0::criticalVolume() - : (compIdx == Comp1Idx) - ? Comp1::criticalVolume() - : throw std::invalid_argument("Critical volume component index"); - } - - /*! - * \brief The acentric factor of a component []. - * - * \copydetails Doxygen::compIdxParam - */ - static Scalar acentricFactor(unsigned compIdx) - { - return (compIdx == Comp0Idx) - ? Comp0::acentricFactor() - : (compIdx == Comp1Idx) - ? Comp1::acentricFactor() - : throw std::invalid_argument("Molar mass component index"); - } - - /**************************************** - * thermodynamic relations - ****************************************/ - - /*! - * \copydoc BaseFluidSystem::density - */ - template - static LhsEval density(const FluidState& fluidState, - const ParameterCache& paramCache, - unsigned phaseIdx) - { - - LhsEval dens; - if (phaseIdx == oilPhaseIdx || phaseIdx == gasPhaseIdx) { - // paramCache.updatePhase(fluidState, phaseIdx); - dens = fluidState.averageMolarMass(phaseIdx) / paramCache.molarVolume(phaseIdx); - } - return dens; - - } - - //! \copydoc BaseFluidSystem::viscosity - template - static LhsEval viscosity(const FluidState& fluidState, - const ParameterCache& paramCache, - unsigned phaseIdx) - { - // Use LBC method to calculate viscosity - LhsEval mu; - // if (phaseIdx == gasPhaseIdx) { - mu = LBCviscosity::LBCmod(fluidState, paramCache, phaseIdx); - // } - // else { - // const auto& T = Opm::decay(fluidState.temperature(phaseIdx)); - // const auto& p = Opm::decay(fluidState.pressure(0)); - // mu = Brine::liquidViscosity(T, p); - // } - return mu; - - } - - //! \copydoc BaseFluidSystem::enthalpy - template - static LhsEval enthalpy(const FluidState& fluidState, - const ParameterCache& /*paramCache*/, - unsigned phaseIdx) - { - const auto& T = Opm::decay(fluidState.temperature(phaseIdx)); - const auto& p = Opm::decay(fluidState.pressure(phaseIdx)); - const auto& x = Opm::decay(fluidState.moleFraction(phaseIdx, Comp1Idx)); - - if(phaseIdx == oilPhaseIdx) { - return EOS::oleic_enthalpy(T, p, x); //TODO - } - else { - return EOS::aqueous_enthalpy(T, p, x); //TODO - } - } - - //! \copydoc BaseFluidSystem::fugacityCoefficient - template - static LhsEval fugacityCoefficient(const FluidState& fluidState, - const ParameterCache& paramCache, - unsigned phaseIdx, - unsigned compIdx) - { - assert(0 <= phaseIdx && phaseIdx < numPhases); - assert(0 <= compIdx && compIdx < numComponents); - - LhsEval phi = PengRobinsonMixture::computeFugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx); - //Scalar phi = Opm::getValue( - // PengRobinsonMixture::computeFugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx)); - return phi; - - - throw std::invalid_argument("crap!"); - } - - //! \copydoc BaseFluidSystem::diffusionCoefficient - template - static LhsEval diffusionCoefficient(const FluidState& /*fluidState*/, - const ParameterCache& /*paramCache*/, - unsigned /*phaseIdx*/, - unsigned /*compIdx*/) - { - return DIFFUSIVITY; - } - - /*! - * \brief Returns the interaction coefficient for two components. - *. - */ - static Scalar interactionCoefficient(unsigned /*comp1Idx*/, unsigned /*comp2Idx*/) - { - return 0.0; //-0.101;//0.1089; - } - -}; - -};//namespace opm - -#endif // TWOPHASEFLUIDSYSTEM_HH diff --git a/tests/test_chiflash.cpp b/tests/test_chiflash.cpp index 10975a612..bd8bf280a 100644 --- a/tests/test_chiflash.cpp +++ b/tests/test_chiflash.cpp @@ -28,7 +28,7 @@ #include "config.h" #include -#include +#include #include #include @@ -40,8 +40,7 @@ void testChiFlash() { using Scalar = double; - // TODO: the name Julia should not be there, remaining to be changed - using FluidSystem = Opm::JuliaThreeComponentFluidSystem; + using FluidSystem = Opm::ThreeComponentFluidSystem; constexpr auto numComponents = FluidSystem::numComponents; using Evaluation = Opm::DenseAd::Evaluation;