Merge pull request #3269 from akva2/small_cleanups

Some small cleanups
This commit is contained in:
Bård Skaflestad
2021-05-19 23:50:01 +02:00
committed by GitHub
9 changed files with 71 additions and 106 deletions
+2 -18
View File
@@ -33,23 +33,7 @@
#include "ebos.hh"
#include "startEbos.hh"
namespace Opm {
class EclAlternativeBlackOilIndexTraits
{
typedef Opm::BlackOilDefaultIndexTraits DIT;
public:
static const unsigned waterPhaseIdx = DIT::oilPhaseIdx;
static const unsigned oilPhaseIdx = DIT::gasPhaseIdx;
static const unsigned gasPhaseIdx = DIT::waterPhaseIdx;
static const unsigned waterCompIdx = DIT::gasCompIdx;
static const unsigned oilCompIdx = DIT::waterCompIdx;
static const unsigned gasCompIdx = DIT::oilCompIdx;
};
}
#include "eclalternativeblackoilindices.hh"
namespace Opm::Properties {
@@ -66,7 +50,7 @@ struct FluidSystem<TypeTag, TTag::EbosAltIdxTypeTag>
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
typedef Opm::BlackOilFluidSystem<Scalar, Opm::EclAlternativeBlackOilIndexTraits> type;
typedef BlackOilFluidSystem<Scalar, EclAlternativeBlackOilIndexTraits> type;
};
} // namespace Opm::Properties
+8 -8
View File
@@ -50,14 +50,14 @@ private:
using FluidSystem = GetPropType<TTag::EbosTypeTag, Properties::FluidSystem>;
public:
typedef Opm::BlackOilTwoPhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnableExtbo>(),
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx> type;
typedef BlackOilTwoPhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnableExtbo>(),
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx> type;
};
} // namespace Opm::Properties
+4 -4
View File
@@ -48,9 +48,9 @@ struct EnableSolvent<TypeTag, TTag::EbosSolventTypeTag> {
namespace Opm {
void ebosSolventSetDeck(std::unique_ptr<Opm::Deck> deck,
std::unique_ptr<Opm::ParseContext> parseContext,
std::unique_ptr<Opm::ErrorGuard> errorGuard,
void ebosSolventSetDeck(std::unique_ptr<Deck> deck,
std::unique_ptr<ParseContext> parseContext,
std::unique_ptr<ErrorGuard> errorGuard,
double externalSetupTime)
{
using ProblemTypeTag = Properties::TTag::EbosSolventTypeTag;
@@ -65,7 +65,7 @@ void ebosSolventSetDeck(std::unique_ptr<Opm::Deck> deck,
int ebosSolventMain(int argc, char **argv)
{
using ProblemTypeTag = Properties::TTag::EbosSolventTypeTag;
return Opm::startEbos<ProblemTypeTag>(argc, argv);
return startEbos<ProblemTypeTag>(argc, argv);
}
}
+47
View File
@@ -0,0 +1,47 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef ECL_ALTERNATIVE_BLACKOIL_INDICES_HH
#define ECL_ALTERNATIVE_BLACKOIL_INDICES_HH
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
namespace Opm {
class EclAlternativeBlackOilIndexTraits
{
using DIT = Opm::BlackOilDefaultIndexTraits;
public:
static const unsigned waterPhaseIdx = DIT::oilPhaseIdx;
static const unsigned oilPhaseIdx = DIT::gasPhaseIdx;
static const unsigned gasPhaseIdx = DIT::waterPhaseIdx;
static const unsigned waterCompIdx = DIT::gasCompIdx;
static const unsigned oilCompIdx = DIT::waterCompIdx;
static const unsigned gasCompIdx = DIT::oilCompIdx;
};
}
#endif
-65
View File
@@ -2247,71 +2247,6 @@ private:
OpmLog::note(ss.str());
}
std::string WPEnumToString_(int i)
{
typedef typename WellProdDataType::WPId WPId;
switch(static_cast<WPId>(i))
{
case WellProdDataType::WellName: return "WName";
case WellProdDataType::WellLocationi: return "WLi";
case WellProdDataType::WellLocationj: return "WLj";
case WellProdDataType::CTRLMode: return "CTRL";
case WellProdDataType::OilRate: return "OR";
case WellProdDataType::WaterRate: return "WR";
case WellProdDataType::GasRate: return "GR";
case WellProdDataType::FluidResVol: return "FRV";
case WellProdDataType::WaterCut: return "WC";
case WellProdDataType::GasOilRatio: return "GOR";
case WellProdDataType::WatGasRatio: return "WGR";
case WellProdDataType::BHP: return "BHP";
case WellProdDataType::THP: return "THP";
case WellProdDataType::SteadyStatePI: return "SteadyStatePI";
}
return "ERROR";
}
std::string WIEnumToString_(int i)
{
typedef typename WellInjDataType::WIId WIId;
switch(static_cast<WIId>(i))
{
case WellInjDataType::WellName: return "WName";
case WellInjDataType::WellLocationi: return "WLi";
case WellInjDataType::WellLocationj: return "WLj";
case WellInjDataType::CTRLModeOil: return "CTRLo";
case WellInjDataType::CTRLModeWat: return "CTRLw";
case WellInjDataType::CTRLModeGas: return "CTRLg";
case WellInjDataType::OilRate: return "OR";
case WellInjDataType::WaterRate: return "WR";
case WellInjDataType::GasRate: return "GR";
case WellInjDataType::FluidResVol: return "FRV";
case WellInjDataType::BHP: return "BHP";
case WellInjDataType::THP: return "THP";
case WellInjDataType::SteadyStateII: return "SteadyStateII";
}
return "ERROR";
}
std::string WCEnumToString_(int i)
{
typedef typename WellCumDataType::WCId WCId;
switch(static_cast<WCId>(i))
{
case WellCumDataType::WellName: return "WName";
case WellCumDataType::WellLocationi: return "WLi";
case WellCumDataType::WellLocationj: return "WLj";
case WellCumDataType::WellType: return "WType";
case WellCumDataType::WellCTRL: return "WCTRL";
case WellCumDataType::OilProd: return "OP";
case WellCumDataType::WaterProd: return "WP";
case WellCumDataType::GasProd: return "GP";
case WellCumDataType::FluidResVolProd: return "FRVP";
case WellCumDataType::OilInj: return "OI";
case WellCumDataType::WaterInj: return "WI";
case WellCumDataType::GasInj: return "GI";
case WellCumDataType::FluidResVolInj: return "FRVI";
}
return "ERROR";
}
bool isOutputCreationDirective_(const std::string& keyword) const
{
return (keyword == "BASIC") || (keyword == "FREQ")
+3 -3
View File
@@ -45,12 +45,12 @@ void flowEbosBlackoilSetDeck(double setupTime, std::unique_ptr<Deck> deck,
Vanguard::setExternalSummaryConfig(std::move(summaryConfig));
}
std::unique_ptr<Opm::FlowMainEbos<Properties::TTag::EclFlowProblem>>
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblem>>
flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
Opm::resetLocale();
resetLocale();
#if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv);
@@ -58,7 +58,7 @@ flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFile
Dune::MPIHelper::instance(argc, argv);
#endif
return std::make_unique<Opm::FlowMainEbos<Properties::TTag::EclFlowProblem>>(
return std::make_unique<FlowMainEbos<Properties::TTag::EclFlowProblem>>(
argc, argv, outputCout, outputFiles);
}
+2 -3
View File
@@ -42,15 +42,14 @@ private:
using FluidSystem = GetPropType<BaseTypeTag, Properties::FluidSystem>;
public:
typedef Opm::BlackOilOnePhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
using type = BlackOilOnePhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnableExtbo>(),
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0,
/*enebledCompIdx=*/FluidSystem::waterCompIdx>
type;
/*enabledCompIdx=*/FluidSystem::waterCompIdx>;
};
} // namespace Opm::Properties
@@ -103,8 +103,8 @@ public:
void deserialize_tran(const std::vector<char>& buffer) override;
protected:
std::map<std::string, Opm::Fieldprops::FieldData<int>> m_intProps; //!< Map of integer properties in process-local compressed indices.
std::map<std::string, Opm::Fieldprops::FieldData<double>> m_doubleProps; //!< Map of double properties in process-local compressed indices.
std::map<std::string, Fieldprops::FieldData<int>> m_intProps; //!< Map of integer properties in process-local compressed indices.
std::map<std::string, Fieldprops::FieldData<double>> m_doubleProps; //!< Map of double properties in process-local compressed indices.
FieldPropsManager& m_manager; //!< Underlying field property manager (only used on root process).
Dune::CollectiveCommunication<Dune::MPIHelper::MPICommunicator> m_comm; //!< Collective communication handler.
std::function<int(void)> m_activeSize; //!< active size function of the grid
+3 -3
View File
@@ -348,13 +348,13 @@ ADD_PACK_PROTOTYPES(data::WellRates)
ADD_PACK_PROTOTYPES(RestartKey)
ADD_PACK_PROTOTYPES(RestartValue)
ADD_PACK_PROTOTYPES(std::string)
ADD_PACK_PROTOTYPES(Opm::time_point)
ADD_PACK_PROTOTYPES(time_point)
} // end namespace Mpi
RestartValue loadParallelRestart(const EclipseIO* eclIO, Action::State& actionState, SummaryState& summaryState,
const std::vector<Opm::RestartKey>& solutionKeys,
const std::vector<Opm::RestartKey>& extraKeys,
const std::vector<RestartKey>& solutionKeys,
const std::vector<RestartKey>& extraKeys,
Dune::CollectiveCommunication<Dune::MPIHelper::MPICommunicator> comm);
} // end namespace Opm