mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 09:16:27 -06:00
removing GenericOutputCompositionalModule
we do the compostional related in GenericOutputBlackoilModule to minimize the code change. there needs to be refatoring for GenericOutputBlackoilModule to split the black oil and compostional related.
This commit is contained in:
parent
ad587e77ad
commit
a8d2c5bc2c
@ -98,7 +98,6 @@ list (APPEND MAIN_SOURCE_FILES
|
|||||||
opm/simulators/flow/FlowUtils.cpp
|
opm/simulators/flow/FlowUtils.cpp
|
||||||
opm/simulators/flow/GenericCpGridVanguard.cpp
|
opm/simulators/flow/GenericCpGridVanguard.cpp
|
||||||
opm/simulators/flow/GenericOutputBlackoilModule.cpp
|
opm/simulators/flow/GenericOutputBlackoilModule.cpp
|
||||||
opm/simulators/flow/GenericOutputCompositionalModule.cpp
|
|
||||||
opm/simulators/flow/GenericThresholdPressure.cpp
|
opm/simulators/flow/GenericThresholdPressure.cpp
|
||||||
opm/simulators/flow/GenericTracerModel.cpp
|
opm/simulators/flow/GenericTracerModel.cpp
|
||||||
opm/simulators/flow/InterRegFlows.cpp
|
opm/simulators/flow/InterRegFlows.cpp
|
||||||
@ -818,7 +817,6 @@ list (APPEND PUBLIC_HEADER_FILES
|
|||||||
opm/simulators/flow/FlowThresholdPressure.hpp
|
opm/simulators/flow/FlowThresholdPressure.hpp
|
||||||
opm/simulators/flow/GenericCpGridVanguard.hpp
|
opm/simulators/flow/GenericCpGridVanguard.hpp
|
||||||
opm/simulators/flow/GenericOutputBlackoilModule.hpp
|
opm/simulators/flow/GenericOutputBlackoilModule.hpp
|
||||||
opm/simulators/flow/GenericOutputCompositionalModule.hpp
|
|
||||||
opm/simulators/flow/GenericThresholdPressure.hpp
|
opm/simulators/flow/GenericThresholdPressure.hpp
|
||||||
opm/simulators/flow/GenericThresholdPressure_impl.hpp
|
opm/simulators/flow/GenericThresholdPressure_impl.hpp
|
||||||
opm/simulators/flow/GenericTracerModel.hpp
|
opm/simulators/flow/GenericTracerModel.hpp
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
|
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
|
||||||
#include <opm/material/fluidsystems/BlackOilDefaultIndexTraits.hpp>
|
#include <opm/material/fluidsystems/BlackOilDefaultIndexTraits.hpp>
|
||||||
|
|
||||||
|
#include <opm/material/fluidsystems/GenericOilGasFluidSystem.hpp>
|
||||||
|
|
||||||
#include <opm/grid/common/CommunicationUtils.hpp>
|
#include <opm/grid/common/CommunicationUtils.hpp>
|
||||||
|
|
||||||
#include <opm/output/data/Solution.hpp>
|
#include <opm/output/data/Solution.hpp>
|
||||||
@ -624,6 +626,33 @@ assignToSolution(data::Solution& sol)
|
|||||||
DataEntry{"UREA", UnitSystem::measure::density, cUrea_},
|
DataEntry{"UREA", UnitSystem::measure::density, cUrea_},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// basically, for compositional, we can not use std::array for this. We need to generate the ZMF1, ZMF2, and so on
|
||||||
|
// and also, we need to map these values.
|
||||||
|
auto compositionalEntries = std::vector<DataEntry>{};
|
||||||
|
{
|
||||||
|
// ZMF
|
||||||
|
for (int i = 0; i < numComponents; ++i) {
|
||||||
|
const std::string name = "ZMF" + std::to_string(i + 1); // Generate ZMF1, ZMF2, ...
|
||||||
|
compositionalEntries.emplace_back(name, UnitSystem::measure::identity, moleFractions_[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// XMF
|
||||||
|
for (int i = 0; i < numComponents; ++i) {
|
||||||
|
const std::string name = "XMF" + std::to_string(i + 1); // Generate XMF1, XMF2, ...
|
||||||
|
compositionalEntries.emplace_back(name, UnitSystem::measure::identity, phaseMoleFractions_[oilPhaseIdx][i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// YMF
|
||||||
|
for (int i = 0; i < numComponents; ++i) {
|
||||||
|
const std::string name = "YMF" + std::to_string(i + 1); // Generate YMF1, YMF2, ...
|
||||||
|
compositionalEntries.emplace_back(name, UnitSystem::measure::identity, phaseMoleFractions_[gasPhaseIdx][i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const auto& array : compositionalEntries) {
|
||||||
|
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto& array : baseSolutionArrays) {
|
for (const auto& array : baseSolutionArrays) {
|
||||||
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
||||||
}
|
}
|
||||||
@ -660,6 +689,15 @@ assignToSolution(data::Solution& sol)
|
|||||||
data::TargetType::RESTART_SOLUTION);
|
data::TargetType::RESTART_SOLUTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FluidSystem::phaseIsActive(oilPhaseIdx) &&
|
||||||
|
! this->saturation_[oilPhaseIdx].empty())
|
||||||
|
{
|
||||||
|
sol.insert("SOIL", UnitSystem::measure::identity,
|
||||||
|
std::move(this->saturation_[oilPhaseIdx]),
|
||||||
|
data::TargetType::RESTART_SOLUTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((eclState_.runspec().co2Storage() || eclState_.runspec().h2Storage()) && !rsw_.empty()) {
|
if ((eclState_.runspec().co2Storage() || eclState_.runspec().h2Storage()) && !rsw_.empty()) {
|
||||||
auto mfrac = std::vector<double>(this->rsw_.size(), 0.0);
|
auto mfrac = std::vector<double>(this->rsw_.size(), 0.0);
|
||||||
|
|
||||||
@ -1481,6 +1519,28 @@ doAllocBuffers(const unsigned bufferSize,
|
|||||||
overburdenPressure_.resize(bufferSize, 0.0);
|
overburdenPressure_.resize(bufferSize, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rstKeywords["ZMF"] > 0) {
|
||||||
|
rstKeywords["ZMF"] = 0;
|
||||||
|
for (int i = 0; i < numComponents; ++i) {
|
||||||
|
moleFractions_[i].resize(bufferSize, 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rstKeywords["XMF"] > 0 && FluidSystem::phaseIsActive(oilPhaseIdx)) {
|
||||||
|
rstKeywords["XMF"] = 0;
|
||||||
|
for (int i = 0; i < numComponents; ++i) {
|
||||||
|
phaseMoleFractions_[oilPhaseIdx][i].resize(bufferSize, 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rstKeywords["YMF"] > 0 && FluidSystem::phaseIsActive(gasPhaseIdx)) {
|
||||||
|
rstKeywords["YMF"] = 0;
|
||||||
|
for (int i = 0; i < numComponents; ++i) {
|
||||||
|
phaseMoleFractions_[gasPhaseIdx][i].resize(bufferSize, 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Warn for any unhandled keyword
|
//Warn for any unhandled keyword
|
||||||
if (log) {
|
if (log) {
|
||||||
for (auto& keyValue: rstKeywords) {
|
for (auto& keyValue: rstKeywords) {
|
||||||
@ -1752,4 +1812,17 @@ INSTANTIATE_TYPE(double)
|
|||||||
INSTANTIATE_TYPE(float)
|
INSTANTIATE_TYPE(float)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define INSTANTIATE_COMP(NUM) \
|
||||||
|
template<class T> using FS##NUM = GenericOilGasFluidSystem<T, NUM>; \
|
||||||
|
template class GenericOutputBlackoilModule<FS##NUM<double>>;
|
||||||
|
|
||||||
|
//INSTANTIATE_COMP(2)
|
||||||
|
INSTANTIATE_COMP(3)
|
||||||
|
//INSTANTIATE_COMP(4)
|
||||||
|
//INSTANTIATE_COMP(5)
|
||||||
|
//INSTANTIATE_COMP(6)
|
||||||
|
//INSTANTIATE_COMP(7)
|
||||||
|
// template class GenericOutputBlackoilModule<GenericOilGasFluidSystem<double, 3>>;
|
||||||
|
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -342,13 +342,13 @@ protected:
|
|||||||
const bool substep,
|
const bool substep,
|
||||||
const bool log,
|
const bool log,
|
||||||
const bool isRestart,
|
const bool isRestart,
|
||||||
const bool vapparsActive,
|
const bool vapparsActive = false,
|
||||||
const bool enablePCHysteresis,
|
const bool enablePCHysteresis = false,
|
||||||
const bool enableNonWettingHysteresis,
|
const bool enableNonWettingHysteresis =false,
|
||||||
const bool enableWettingHysteresis,
|
const bool enableWettingHysteresis = false,
|
||||||
unsigned numTracers,
|
unsigned numTracers = 0,
|
||||||
const std::vector<bool>& enableSolTracers,
|
const std::vector<bool>& enableSolTracers = {},
|
||||||
unsigned numOutputNnc);
|
unsigned numOutputNnc = 0);
|
||||||
|
|
||||||
void makeRegionSum(Inplace& inplace,
|
void makeRegionSum(Inplace& inplace,
|
||||||
const std::string& region_name,
|
const std::string& region_name,
|
||||||
@ -539,6 +539,10 @@ protected:
|
|||||||
std::array<ScalarBuffer, numPhases> viscosity_;
|
std::array<ScalarBuffer, numPhases> viscosity_;
|
||||||
std::array<ScalarBuffer, numPhases> relativePermeability_;
|
std::array<ScalarBuffer, numPhases> relativePermeability_;
|
||||||
|
|
||||||
|
// totoal mole fractions for each component
|
||||||
|
std::array<ScalarBuffer, numComponents> moleFractions_;
|
||||||
|
// mole fractions for each component in each phase
|
||||||
|
std::array<std::array<ScalarBuffer, numComponents>, numPhases> phaseMoleFractions_;
|
||||||
std::vector<ScalarBuffer> freeTracerConcentrations_;
|
std::vector<ScalarBuffer> freeTracerConcentrations_;
|
||||||
std::vector<ScalarBuffer> solTracerConcentrations_;
|
std::vector<ScalarBuffer> solTracerConcentrations_;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,567 +0,0 @@
|
|||||||
// -*- 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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
* \file
|
|
||||||
* \copydoc Opm::OutputCompositionalModule
|
|
||||||
*/
|
|
||||||
#ifndef OPM_GENERIC_OUTPUT_COMPOSITIONAL_MODULE_HPP
|
|
||||||
#define OPM_GENERIC_OUTPUT_COMPOSITIONAL_MODULE_HPP
|
|
||||||
|
|
||||||
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
|
||||||
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
|
||||||
|
|
||||||
#include <opm/output/data/Wells.hpp>
|
|
||||||
#include <opm/output/eclipse/Inplace.hpp>
|
|
||||||
|
|
||||||
#include <opm/simulators/flow/FlowsData.hpp>
|
|
||||||
#include <opm/simulators/flow/InterRegFlows.hpp>
|
|
||||||
#include <opm/simulators/flow/LogOutputHelper.hpp>
|
|
||||||
#include <opm/simulators/flow/RegionPhasePVAverage.hpp>
|
|
||||||
|
|
||||||
#include <opm/simulators/utils/ParallelCommunication.hpp>
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <cstddef>
|
|
||||||
#include <functional>
|
|
||||||
#include <map>
|
|
||||||
#include <optional>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace Opm {
|
|
||||||
|
|
||||||
namespace data { class Solution; }
|
|
||||||
class EclipseState;
|
|
||||||
class Schedule;
|
|
||||||
class SummaryConfig;
|
|
||||||
class SummaryConfigNode;
|
|
||||||
class SummaryState;
|
|
||||||
|
|
||||||
template<class FluidSystem>
|
|
||||||
class GenericOutputCompositionalModule {
|
|
||||||
public:
|
|
||||||
using Scalar = typename FluidSystem::Scalar;
|
|
||||||
|
|
||||||
// Virtual destructor for safer inheritance.
|
|
||||||
virtual ~GenericOutputCompositionalModule();
|
|
||||||
|
|
||||||
Scalar* getPRESSURE_ptr(void) {
|
|
||||||
return (this->fluidPressure_.data()) ;
|
|
||||||
};
|
|
||||||
|
|
||||||
int getPRESSURE_size( void ) {
|
|
||||||
return (this->fluidPressure_.size()) ;
|
|
||||||
};
|
|
||||||
|
|
||||||
void outputTimeStamp(const std::string& lbl,
|
|
||||||
double elapsed,
|
|
||||||
int rstep,
|
|
||||||
boost::posix_time::ptime currentDate);
|
|
||||||
|
|
||||||
/// Clear internal arrays for parallel accumulation of per-region phase
|
|
||||||
/// density averages.
|
|
||||||
void prepareDensityAccumulation();
|
|
||||||
|
|
||||||
/// Run cross-rank parallel accumulation of per-region phase density
|
|
||||||
/// running sums (average values).
|
|
||||||
void accumulateDensityParallel();
|
|
||||||
|
|
||||||
// write cumulative production and injection reports to output
|
|
||||||
void outputCumLog(std::size_t reportStepNum);
|
|
||||||
|
|
||||||
// write production report to output
|
|
||||||
void outputProdLog(std::size_t reportStepNum);
|
|
||||||
|
|
||||||
// write injection report to output
|
|
||||||
void outputInjLog(std::size_t reportStepNum);
|
|
||||||
|
|
||||||
// calculate Fluid In Place
|
|
||||||
Inplace calc_inplace(std::map<std::string, double>& miscSummaryData,
|
|
||||||
std::map<std::string, std::vector<double>>& regionData,
|
|
||||||
const Parallel::Communication& comm);
|
|
||||||
|
|
||||||
void outputFipAndResvLog(const Inplace& inplace,
|
|
||||||
const std::size_t reportStepNum,
|
|
||||||
double elapsed,
|
|
||||||
boost::posix_time::ptime currentDate,
|
|
||||||
const bool substep,
|
|
||||||
const Parallel::Communication& comm);
|
|
||||||
|
|
||||||
void outputErrorLog(const Parallel::Communication& comm) const;
|
|
||||||
|
|
||||||
void addRftDataToWells(data::Wells& wellDatas,
|
|
||||||
std::size_t reportStepNum);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Move all buffers to data::Solution.
|
|
||||||
*/
|
|
||||||
void assignToSolution(data::Solution& sol);
|
|
||||||
|
|
||||||
void setRestart(const data::Solution& sol,
|
|
||||||
unsigned elemIdx,
|
|
||||||
unsigned globalDofIndex);
|
|
||||||
|
|
||||||
Scalar getSolventSaturation(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (sSol_.size() > elemIdx)
|
|
||||||
return sSol_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getSolventRsw(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (rswSol_.size() > elemIdx)
|
|
||||||
return rswSol_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getPolymerConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cPolymer_.size() > elemIdx)
|
|
||||||
return cPolymer_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getFoamConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cFoam_.size() > elemIdx)
|
|
||||||
return cFoam_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getSaltConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cSalt_.size() > elemIdx)
|
|
||||||
return cSalt_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getSaltSaturation(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (pSalt_.size() > elemIdx)
|
|
||||||
return pSalt_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getPermFactor(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (permFact_.size() > elemIdx)
|
|
||||||
return permFact_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getMicrobialConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cMicrobes_.size() > elemIdx)
|
|
||||||
return cMicrobes_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getOxygenConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cOxygen_.size() > elemIdx)
|
|
||||||
return cOxygen_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getUreaConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cUrea_.size() > elemIdx)
|
|
||||||
return cUrea_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getBiofilmConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cBiofilm_.size() > elemIdx)
|
|
||||||
return cBiofilm_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scalar getCalciteConcentration(unsigned elemIdx) const
|
|
||||||
{
|
|
||||||
if (cCalcite_.size() > elemIdx)
|
|
||||||
return cCalcite_[elemIdx];
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::array<FlowsData<double>, 3>& getFlowsn() const
|
|
||||||
{
|
|
||||||
return this->flowsn_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasFlowsn() const
|
|
||||||
{
|
|
||||||
return enableFlowsn_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasFlows() const
|
|
||||||
{
|
|
||||||
return enableFlows_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasBlockFlows() const
|
|
||||||
{
|
|
||||||
return blockFlows_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool anyFlows() const
|
|
||||||
{
|
|
||||||
return anyFlows_;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::array<FlowsData<double>, 3>& getFloresn() const
|
|
||||||
{
|
|
||||||
return this->floresn_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasFloresn() const
|
|
||||||
{
|
|
||||||
return enableFloresn_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasFlores() const
|
|
||||||
{
|
|
||||||
return enableFlores_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool anyFlores() const
|
|
||||||
{
|
|
||||||
return anyFlores_;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool needInterfaceFluxes([[maybe_unused]] const bool isSubStep) const
|
|
||||||
{
|
|
||||||
return this->interRegionFlows_.wantInterRegflowSummary();
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::map<std::pair<std::string, int>, double>& getBlockData()
|
|
||||||
{
|
|
||||||
return blockData_;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Inplace& initialInplace() const
|
|
||||||
{
|
|
||||||
return this->initialInplace_.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool localDataValid() const{
|
|
||||||
return local_data_valid_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void invalidateLocalData(){
|
|
||||||
local_data_valid_ = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void validateLocalData(){
|
|
||||||
local_data_valid_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setCnvData(const std::vector<std::vector<int>>& data)
|
|
||||||
{
|
|
||||||
cnvData_ = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Serializer>
|
|
||||||
void serializeOp(Serializer& serializer)
|
|
||||||
{
|
|
||||||
serializer(initialInplace_);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! \brief Assign fields that are in global numbering to the solution.
|
|
||||||
//! \detail This is used to add fields that for some reason cannot be collected
|
|
||||||
//! using the regular collect mechanism to the solution. In particular this
|
|
||||||
//! is used with RPTRST CONV output.
|
|
||||||
void assignGlobalFieldsToSolution(data::Solution& sol);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
using ScalarBuffer = std::vector<Scalar>;
|
|
||||||
using StringBuffer = std::vector<std::string>;
|
|
||||||
enum { numPhases = FluidSystem::numPhases };
|
|
||||||
enum { numComponents = FluidSystem::numComponents };
|
|
||||||
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
|
|
||||||
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
|
|
||||||
enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
|
|
||||||
enum { gasCompIdx = FluidSystem::gasCompIdx };
|
|
||||||
enum { oilCompIdx = FluidSystem::oilCompIdx };
|
|
||||||
enum { waterCompIdx = FluidSystem::waterCompIdx };
|
|
||||||
using Dir = FaceDir::DirEnum;
|
|
||||||
|
|
||||||
GenericOutputCompositionalModule(const EclipseState& eclState,
|
|
||||||
const Schedule& schedule,
|
|
||||||
const SummaryConfig& summaryConfig,
|
|
||||||
const SummaryState& summaryState,
|
|
||||||
const std::string& moduleVersionName,
|
|
||||||
bool enableEnergy,
|
|
||||||
bool enableTemperature,
|
|
||||||
bool enableMech,
|
|
||||||
bool enableSolvent,
|
|
||||||
bool enablePolymer,
|
|
||||||
bool enableFoam,
|
|
||||||
bool enableBrine,
|
|
||||||
bool enableSaltPrecipitation,
|
|
||||||
bool enableExtbo,
|
|
||||||
bool enableMICP);
|
|
||||||
|
|
||||||
void doAllocBuffers(unsigned bufferSize,
|
|
||||||
unsigned reportStepNum,
|
|
||||||
const bool substep,
|
|
||||||
const bool log,
|
|
||||||
const bool isRestart,
|
|
||||||
const bool vapparsActive = false,
|
|
||||||
const bool enablePCHysteresis = false,
|
|
||||||
const bool enableNonWettingHysteresis =false,
|
|
||||||
const bool enableWettingHysteresis = false,
|
|
||||||
unsigned numTracers = 0,
|
|
||||||
const std::vector<bool>& enableSolTracers = {},
|
|
||||||
unsigned numOutputNnc = 0);
|
|
||||||
|
|
||||||
void makeRegionSum(Inplace& inplace,
|
|
||||||
const std::string& region_name,
|
|
||||||
const Parallel::Communication& comm) const;
|
|
||||||
|
|
||||||
Inplace accumulateRegionSums(const Parallel::Communication& comm);
|
|
||||||
|
|
||||||
void updateSummaryRegionValues(const Inplace& inplace,
|
|
||||||
std::map<std::string, double>& miscSummaryData,
|
|
||||||
std::map<std::string, std::vector<double>>& regionData) const;
|
|
||||||
|
|
||||||
static bool isOutputCreationDirective_(const std::string& keyword);
|
|
||||||
|
|
||||||
// Sum Fip values over regions.
|
|
||||||
static ScalarBuffer regionSum(const ScalarBuffer& property,
|
|
||||||
const std::vector<int>& regionId,
|
|
||||||
const std::size_t maxNumberOfRegions,
|
|
||||||
const Parallel::Communication& comm);
|
|
||||||
|
|
||||||
static int regionMax(const std::vector<int>& region,
|
|
||||||
const Parallel::Communication& comm);
|
|
||||||
|
|
||||||
static void update(Inplace& inplace,
|
|
||||||
const std::string& region_name,
|
|
||||||
const Inplace::Phase phase,
|
|
||||||
const std::size_t ntFip,
|
|
||||||
const ScalarBuffer& values);
|
|
||||||
|
|
||||||
static Scalar sum(const ScalarBuffer& v);
|
|
||||||
|
|
||||||
void setupBlockData(std::function<bool(int)> isCartIdxOnThisRank);
|
|
||||||
|
|
||||||
virtual bool isDefunctParallelWell(std::string wname) const = 0;
|
|
||||||
|
|
||||||
const EclipseState& eclState_;
|
|
||||||
const Schedule& schedule_;
|
|
||||||
const SummaryState& summaryState_;
|
|
||||||
|
|
||||||
SummaryConfig summaryConfig_;
|
|
||||||
|
|
||||||
InterRegFlowMap interRegionFlows_;
|
|
||||||
LogOutputHelper<Scalar> logOutput_;
|
|
||||||
|
|
||||||
bool enableEnergy_{false};
|
|
||||||
bool enableTemperature_{false};
|
|
||||||
bool enableMech_{false};
|
|
||||||
|
|
||||||
bool enableSolvent_{false};
|
|
||||||
bool enablePolymer_{false};
|
|
||||||
bool enableFoam_{false};
|
|
||||||
bool enableBrine_{false};
|
|
||||||
bool enableSaltPrecipitation_{false};
|
|
||||||
bool enableExtbo_{false};
|
|
||||||
bool enableMICP_{false};
|
|
||||||
|
|
||||||
bool forceDisableFipOutput_{false};
|
|
||||||
bool forceDisableFipresvOutput_{false};
|
|
||||||
bool computeFip_{false};
|
|
||||||
|
|
||||||
struct OutputFIPRestart {
|
|
||||||
/// Whether or not run requests (surface condition) fluid-in-place
|
|
||||||
/// restart file output using the 'FIP' mnemonic.
|
|
||||||
bool noPrefix {false};
|
|
||||||
|
|
||||||
/// Whether or not run requests surface condition fluid-in-place
|
|
||||||
/// restart file output using the 'SFIP' mnemonic.
|
|
||||||
bool surface {false};
|
|
||||||
|
|
||||||
/// Whether or not run requests reservoir condition fluid-in-place
|
|
||||||
/// restart file output using the 'RFIP' mnemonic.
|
|
||||||
bool reservoir {false};
|
|
||||||
|
|
||||||
void clearBits()
|
|
||||||
{
|
|
||||||
this->noPrefix = this->surface = this->reservoir = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
explicit operator bool() const
|
|
||||||
{
|
|
||||||
return this->noPrefix || this->surface || this->reservoir;
|
|
||||||
}
|
|
||||||
} outputFipRestart_{};
|
|
||||||
|
|
||||||
bool anyFlows_{false};
|
|
||||||
bool anyFlores_{false};
|
|
||||||
bool blockFlows_{false};
|
|
||||||
bool enableFlows_{false};
|
|
||||||
bool enableFlores_{false};
|
|
||||||
bool enableFlowsn_{false};
|
|
||||||
bool enableFloresn_{false};
|
|
||||||
|
|
||||||
std::unordered_map<Inplace::Phase, ScalarBuffer> fip_;
|
|
||||||
std::unordered_map<std::string, std::vector<int>> regions_;
|
|
||||||
std::unordered_map<Inplace::Phase, std::vector<SummaryConfigNode>> regionNodes_;
|
|
||||||
|
|
||||||
std::vector<SummaryConfigNode> RPRNodes_;
|
|
||||||
std::vector<SummaryConfigNode> RPRPNodes_;
|
|
||||||
|
|
||||||
std::vector<int> failedCellsPb_;
|
|
||||||
std::vector<int> failedCellsPd_;
|
|
||||||
|
|
||||||
ScalarBuffer gasFormationVolumeFactor_;
|
|
||||||
ScalarBuffer hydrocarbonPoreVolume_;
|
|
||||||
ScalarBuffer pressureTimesPoreVolume_;
|
|
||||||
ScalarBuffer pressureTimesHydrocarbonVolume_;
|
|
||||||
ScalarBuffer dynamicPoreVolume_;
|
|
||||||
ScalarBuffer rPorV_;
|
|
||||||
ScalarBuffer fluidPressure_;
|
|
||||||
ScalarBuffer temperature_;
|
|
||||||
ScalarBuffer rs_;
|
|
||||||
ScalarBuffer rsw_;
|
|
||||||
ScalarBuffer rv_;
|
|
||||||
ScalarBuffer rvw_;
|
|
||||||
ScalarBuffer overburdenPressure_;
|
|
||||||
ScalarBuffer oilSaturationPressure_;
|
|
||||||
ScalarBuffer drsdtcon_;
|
|
||||||
ScalarBuffer sSol_;
|
|
||||||
ScalarBuffer rswSol_;
|
|
||||||
ScalarBuffer cPolymer_;
|
|
||||||
ScalarBuffer cFoam_;
|
|
||||||
ScalarBuffer cSalt_;
|
|
||||||
ScalarBuffer pSalt_;
|
|
||||||
ScalarBuffer permFact_;
|
|
||||||
ScalarBuffer extboX_;
|
|
||||||
ScalarBuffer extboY_;
|
|
||||||
ScalarBuffer extboZ_;
|
|
||||||
ScalarBuffer mFracOil_;
|
|
||||||
ScalarBuffer mFracGas_;
|
|
||||||
ScalarBuffer mFracCo2_;
|
|
||||||
ScalarBuffer soMax_;
|
|
||||||
ScalarBuffer swMax_;
|
|
||||||
ScalarBuffer sgmax_;
|
|
||||||
ScalarBuffer shmax_;
|
|
||||||
ScalarBuffer somin_;
|
|
||||||
ScalarBuffer swmin_;
|
|
||||||
ScalarBuffer ppcw_;
|
|
||||||
ScalarBuffer gasDissolutionFactor_;
|
|
||||||
ScalarBuffer oilVaporizationFactor_;
|
|
||||||
ScalarBuffer gasDissolutionFactorInWater_;
|
|
||||||
ScalarBuffer waterVaporizationFactor_;
|
|
||||||
ScalarBuffer bubblePointPressure_;
|
|
||||||
ScalarBuffer dewPointPressure_;
|
|
||||||
ScalarBuffer rockCompPorvMultiplier_;
|
|
||||||
ScalarBuffer minimumOilPressure_;
|
|
||||||
ScalarBuffer saturatedOilFormationVolumeFactor_;
|
|
||||||
ScalarBuffer rockCompTransMultiplier_;
|
|
||||||
ScalarBuffer cMicrobes_;
|
|
||||||
ScalarBuffer cOxygen_;
|
|
||||||
ScalarBuffer cUrea_;
|
|
||||||
ScalarBuffer cBiofilm_;
|
|
||||||
ScalarBuffer cCalcite_;
|
|
||||||
ScalarBuffer pcgw_;
|
|
||||||
ScalarBuffer pcow_;
|
|
||||||
ScalarBuffer pcog_;
|
|
||||||
|
|
||||||
// buffers for mechanical output
|
|
||||||
ScalarBuffer mechPotentialForce_;
|
|
||||||
ScalarBuffer mechPotentialPressForce_;
|
|
||||||
ScalarBuffer mechPotentialTempForce_;
|
|
||||||
|
|
||||||
ScalarBuffer dispX_;
|
|
||||||
ScalarBuffer dispY_;
|
|
||||||
ScalarBuffer dispZ_;
|
|
||||||
ScalarBuffer stressXX_;
|
|
||||||
ScalarBuffer stressYY_;
|
|
||||||
ScalarBuffer stressZZ_;
|
|
||||||
ScalarBuffer stressXY_;
|
|
||||||
ScalarBuffer stressXZ_;
|
|
||||||
ScalarBuffer stressYZ_;
|
|
||||||
ScalarBuffer delstressXX_;
|
|
||||||
ScalarBuffer delstressYY_;
|
|
||||||
ScalarBuffer delstressZZ_;
|
|
||||||
ScalarBuffer delstressXY_;
|
|
||||||
ScalarBuffer delstressXZ_;
|
|
||||||
ScalarBuffer delstressYZ_;
|
|
||||||
ScalarBuffer strainXX_;
|
|
||||||
ScalarBuffer strainYY_;
|
|
||||||
ScalarBuffer strainZZ_;
|
|
||||||
ScalarBuffer strainXY_;
|
|
||||||
ScalarBuffer strainXZ_;
|
|
||||||
ScalarBuffer strainYZ_;
|
|
||||||
|
|
||||||
std::array<ScalarBuffer, numPhases> saturation_;
|
|
||||||
std::array<ScalarBuffer, numPhases> invB_;
|
|
||||||
std::array<ScalarBuffer, numPhases> density_;
|
|
||||||
std::array<ScalarBuffer, numPhases> viscosity_;
|
|
||||||
std::array<ScalarBuffer, numPhases> relativePermeability_;
|
|
||||||
|
|
||||||
std::array<ScalarBuffer, numComponents> moleFractions_;
|
|
||||||
std::array<std::array<ScalarBuffer, numComponents>, numPhases> phaseMoleFractions_;
|
|
||||||
|
|
||||||
std::vector<ScalarBuffer> freeTracerConcentrations_;
|
|
||||||
std::vector<ScalarBuffer> solTracerConcentrations_;
|
|
||||||
|
|
||||||
std::array<ScalarBuffer, numPhases> residual_;
|
|
||||||
|
|
||||||
std::array<std::array<ScalarBuffer, numPhases>, 6> flows_;
|
|
||||||
std::array<std::array<ScalarBuffer, numPhases>, 6> flores_;
|
|
||||||
|
|
||||||
std::array<FlowsData<double>, 3> floresn_;
|
|
||||||
std::array<FlowsData<double>, 3> flowsn_;
|
|
||||||
|
|
||||||
std::map<std::size_t, Scalar> oilConnectionPressures_;
|
|
||||||
std::map<std::size_t, Scalar> waterConnectionSaturations_;
|
|
||||||
std::map<std::size_t, Scalar> gasConnectionSaturations_;
|
|
||||||
std::map<std::pair<std::string, int>, double> blockData_;
|
|
||||||
|
|
||||||
std::vector<std::vector<int>> cnvData_; //!< Data for CNV_xxx arrays
|
|
||||||
|
|
||||||
std::optional<Inplace> initialInplace_;
|
|
||||||
bool local_data_valid_{false};
|
|
||||||
|
|
||||||
std::optional<RegionPhasePoreVolAverage> regionAvgDensity_;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Opm
|
|
||||||
|
|
||||||
#endif // OPM_GENERIC_OUTPUT_BLACK_OIL_MODULE_HPP
|
|
@ -52,7 +52,8 @@
|
|||||||
#include <opm/output/eclipse/Inplace.hpp>
|
#include <opm/output/eclipse/Inplace.hpp>
|
||||||
|
|
||||||
#include <opm/simulators/flow/FlowBaseVanguard.hpp>
|
#include <opm/simulators/flow/FlowBaseVanguard.hpp>
|
||||||
#include <opm/simulators/flow/GenericOutputCompositionalModule.hpp>
|
// #include <opm/simulators/flow/GenericOutputCompositionalModule.hpp>
|
||||||
|
#include <opm/simulators/flow/GenericOutputBlackoilModule.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -86,7 +87,7 @@ class EcfvDiscretization;
|
|||||||
* ECL binary format.
|
* ECL binary format.
|
||||||
*/
|
*/
|
||||||
template <class TypeTag>
|
template <class TypeTag>
|
||||||
class OutputCompositionalModule : public GenericOutputCompositionalModule<GetPropType<TypeTag, Properties::FluidSystem>>
|
class OutputCompositionalModule : public GenericOutputBlackoilModule<GetPropType<TypeTag, Properties::FluidSystem>>
|
||||||
{
|
{
|
||||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||||
using Discretization = GetPropType<TypeTag, Properties::Discretization>;
|
using Discretization = GetPropType<TypeTag, Properties::Discretization>;
|
||||||
@ -100,7 +101,7 @@ class OutputCompositionalModule : public GenericOutputCompositionalModule<GetPro
|
|||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
using Element = typename GridView::template Codim<0>::Entity;
|
using Element = typename GridView::template Codim<0>::Entity;
|
||||||
using ElementIterator = typename GridView::template Codim<0>::Iterator;
|
using ElementIterator = typename GridView::template Codim<0>::Iterator;
|
||||||
using BaseType = GenericOutputCompositionalModule<FluidSystem>;
|
using BaseType = GenericOutputBlackoilModule<FluidSystem>;
|
||||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
using Dir = FaceDir::DirEnum;
|
using Dir = FaceDir::DirEnum;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user