fix disabled component index

This commit is contained in:
Paul Egberts 2020-12-01 10:49:47 +01:00 committed by Arne Morten Kvarving
parent d0421582e1
commit 13cd4b476e
2 changed files with 56 additions and 4 deletions

View File

@ -31,7 +31,59 @@
#include "ebos_gaswater.hh"
int main(int argc, char** argv)
{
return Opm::ebosGasWaterMain(argc, argv);
#include "ebos.hh"
#include "startEbos.hh"
namespace Opm::Properties {
namespace TTag {
struct EbosGasWaterTypeTag {
using InheritsFrom = std::tuple<EbosTypeTag>;
};
}
//! The indices indices which only enable oil and water
template<class TypeTag>
struct Indices<TypeTag, TTag::EbosGasWaterTypeTag>
{
private:
// it is unfortunately not possible to simply use 'TypeTag' here because this leads
// to cyclic definitions of some properties. if this happens the compiler error
// messages unfortunately are *really* confusing and not really helpful.
using FluidSystem = GetPropType<TTag::EbosTypeTag, Properties::FluidSystem>;
public:
typedef Opm::BlackOilTwoPhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::oilCompIdx> type;
};
} // namespace Opm::Properties
namespace Opm {
void ebosGasWaterSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosOilWaterTypeTag;
using Vanguard = GetPropType<ProblemTypeTag, Properties::Vanguard>;
Vanguard::setExternalSetupTime(externalSetupTime);
Vanguard::setExternalParseContext(std::move(parseContext));
Vanguard::setExternalErrorGuard(std::move(errorGuard));
Vanguard::setExternalDeck(std::move(deck));
}
int ebosGasWaterMain(int argc, char **argv)
{
using ProblemTypeTag = Properties::TTag::EbosGasWaterTypeTag;
return Opm::startEbos<ProblemTypeTag>(argc, argv);
}
}

View File

@ -60,7 +60,7 @@ public:
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx> type;
/*disabledCompIdx=*/FluidSystem::oilCompIdx> type;
};
}}