diff --git a/opm/models/blackoil/blackoilbrinemodules.hh b/opm/models/blackoil/blackoilbrinemodules.hh index 1cae8ba08..0cae11fef 100644 --- a/opm/models/blackoil/blackoilbrinemodules.hh +++ b/opm/models/blackoil/blackoilbrinemodules.hh @@ -29,10 +29,8 @@ #define EWOMS_BLACK_OIL_BRINE_MODULE_HH #include "blackoilproperties.hh" -#include -#include -#include +#include #if HAVE_ECL_INPUT #include @@ -43,8 +41,6 @@ #include #endif -#include - #include #include @@ -74,8 +70,7 @@ class BlackOilBrineModule using Toolbox = MathToolbox; - using TabulatedFunction = Tabulated1DFunction; - using TabulatedTwoDFunction = IntervalTabulated2DFunction; + using TabulatedFunction = typename BlackOilBrineParams::TabulatedFunction; static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx; static constexpr unsigned contiBrineEqIdx = Indices::contiBrineEqIdx; @@ -113,38 +108,38 @@ public: const auto& tableManager = eclState.getTableManager(); unsigned numPvtRegions = tableManager.getTabdims().getNumPVTTables(); - referencePressure_.resize(numPvtRegions); + params_.referencePressure_.resize(numPvtRegions); const auto& pvtwsaltTables = tableManager.getPvtwSaltTables(); // initialize the objects which deal with the BDENSITY keyword const auto& bdensityTables = tableManager.getBrineDensityTables(); if (!bdensityTables.empty()) { - bdensityTable_.resize(numPvtRegions); + params_.bdensityTable_.resize(numPvtRegions); assert(numPvtRegions == bdensityTables.size()); for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) { const auto& bdensityTable = bdensityTables[pvtRegionIdx]; const auto& pvtwsaltTable = pvtwsaltTables[pvtRegionIdx]; const auto& c = pvtwsaltTable.getSaltConcentrationColumn(); - bdensityTable_[pvtRegionIdx].setXYContainers(c, bdensityTable); + params_.bdensityTable_[pvtRegionIdx].setXYContainers(c, bdensityTable); } } if constexpr (enableSaltPrecipitation) { const TableContainer& permfactTables = tableManager.getPermfactTables(); - permfactTable_.resize(numPvtRegions); + params_.permfactTable_.resize(numPvtRegions); for (size_t i = 0; i < permfactTables.size(); ++i) { const PermfactTable& permfactTable = permfactTables.getTable(i); - permfactTable_[i].setXYContainers(permfactTable.getPorosityChangeColumn(), permfactTable.getPermeabilityMultiplierColumn()); + params_.permfactTable_[i].setXYContainers(permfactTable.getPorosityChangeColumn(), permfactTable.getPermeabilityMultiplierColumn()); } const TableContainer& saltsolTables = tableManager.getSaltsolTables(); if (!saltsolTables.empty()) { - saltsolTable_.resize(numPvtRegions); + params_.saltsolTable_.resize(numPvtRegions); assert(numPvtRegions == saltsolTables.size()); for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) { const SaltsolTable& saltsolTable = saltsolTables.getTable(pvtRegionIdx ); - saltsolTable_[pvtRegionIdx] = saltsolTable.getSaltsolColumn().front(); + params_.saltsolTable_[pvtRegionIdx] = saltsolTable.getSaltsolColumn().front(); } } } @@ -319,7 +314,7 @@ public: unsigned timeIdx) { unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx); - return referencePressure_[pvtnumRegionIdx]; + return params_.referencePressure_[pvtnumRegionIdx]; } @@ -328,7 +323,7 @@ public: unsigned timeIdx) { unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx); - return bdensityTable_[pvtnumRegionIdx]; + return params_.bdensityTable_[pvtnumRegionIdx]; } static const TabulatedFunction& permfactTable(const ElementContext& elemCtx, @@ -336,7 +331,7 @@ public: unsigned timeIdx) { unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx); - return permfactTable_[pvtnumRegionIdx]; + return params_.permfactTable_[pvtnumRegionIdx]; } static const Scalar saltsolTable(const ElementContext& elemCtx, @@ -344,46 +339,31 @@ public: unsigned timeIdx) { unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx); - return saltsolTable_[pvtnumRegionIdx]; + return params_.saltsolTable_[pvtnumRegionIdx]; } static bool hasBDensityTables() { - return !bdensityTable_.empty(); + return !params_.bdensityTable_.empty(); } static bool hasSaltsolTables() { - return !saltsolTable_.empty(); + return !params_.saltsolTable_.empty(); } static Scalar saltSol(unsigned regionIdx) { - return saltsolTable_[regionIdx]; + return params_.saltsolTable_[regionIdx]; } private: - static std::vector bdensityTable_; - static std::vector permfactTable_; - static std::vector saltsolTable_; - static std::vector referencePressure_; + static BlackOilBrineParams params_; }; template -std::vector::TabulatedFunction> -BlackOilBrineModule::bdensityTable_; - -template -std::vector::Scalar> -BlackOilBrineModule::referencePressure_; - -template -std::vector::Scalar> -BlackOilBrineModule::saltsolTable_; - -template -std::vector::TabulatedFunction> -BlackOilBrineModule::permfactTable_; +BlackOilBrineParams::Scalar> +BlackOilBrineModule::params_; /*! * \ingroup BlackOil diff --git a/opm/models/blackoil/blackoilbrineparams.hh b/opm/models/blackoil/blackoilbrineparams.hh new file mode 100644 index 000000000..55fd6fdb7 --- /dev/null +++ b/opm/models/blackoil/blackoilbrineparams.hh @@ -0,0 +1,50 @@ +// -*- 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 . + + 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. +*/ +/*! + * \file + * + * \brief Contains the parameters required to extend the black-oil model by brine. + */ +#ifndef EWOMS_BLACK_OIL_BRINE_PARAMS_HH +#define EWOMS_BLACK_OIL_BRINE_PARAMS_HH + +#include + +#include + +namespace Opm { + +//! \brief Struct holding the parameters for the BlackoilBrineModule class. +template +struct BlackOilBrineParams { + using TabulatedFunction = Tabulated1DFunction; + + std::vector bdensityTable_; + std::vector permfactTable_; + std::vector saltsolTable_; + std::vector referencePressure_; +}; + +} // namespace Opm + +#endif