mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5211 from akva2/flows_simplify_data_structure
Flows: simplify data structure
This commit is contained in:
commit
283086edeb
@ -453,6 +453,7 @@ list (APPEND PUBLIC_HEADER_FILES
|
|||||||
opm/simulators/flow/ConvergenceOutputConfiguration.hpp
|
opm/simulators/flow/ConvergenceOutputConfiguration.hpp
|
||||||
opm/simulators/flow/ExtraConvergenceOutputThread.hpp
|
opm/simulators/flow/ExtraConvergenceOutputThread.hpp
|
||||||
opm/simulators/flow/FlowMain.hpp
|
opm/simulators/flow/FlowMain.hpp
|
||||||
|
opm/simulators/flow/FlowsData.hpp
|
||||||
opm/simulators/flow/InterRegFlows.hpp
|
opm/simulators/flow/InterRegFlows.hpp
|
||||||
opm/simulators/flow/Main.hpp
|
opm/simulators/flow/Main.hpp
|
||||||
opm/simulators/flow/NonlinearSolver.hpp
|
opm/simulators/flow/NonlinearSolver.hpp
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <opm/output/data/Solution.hpp>
|
#include <opm/output/data/Solution.hpp>
|
||||||
#include <opm/output/data/Wells.hpp>
|
#include <opm/output/data/Wells.hpp>
|
||||||
|
|
||||||
|
#include <opm/simulators/flow/FlowsData.hpp>
|
||||||
#include <opm/simulators/flow/InterRegFlows.hpp>
|
#include <opm/simulators/flow/InterRegFlows.hpp>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -82,8 +83,8 @@ public:
|
|||||||
const data::Aquifers& localAquiferData,
|
const data::Aquifers& localAquiferData,
|
||||||
const WellTestState& localWellTestState,
|
const WellTestState& localWellTestState,
|
||||||
const InterRegFlowMap& interRegFlows,
|
const InterRegFlowMap& interRegFlows,
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& localFlowsn,
|
const std::array<FlowsData<double>, 3>& localFlowsn,
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& localFloresn);
|
const std::array<FlowsData<double>, 3>& localFloresn);
|
||||||
|
|
||||||
const std::map<std::pair<std::string, int>, double>& globalBlockData() const
|
const std::map<std::pair<std::string, int>, double>& globalBlockData() const
|
||||||
{ return globalBlockData_; }
|
{ return globalBlockData_; }
|
||||||
@ -115,10 +116,10 @@ public:
|
|||||||
const InterRegFlowMap& globalInterRegFlows() const
|
const InterRegFlowMap& globalInterRegFlows() const
|
||||||
{ return this->globalInterRegFlows_; }
|
{ return this->globalInterRegFlows_; }
|
||||||
|
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& globalFlowsn() const
|
const std::array<FlowsData<double>, 3>& globalFlowsn() const
|
||||||
{ return globalFlowsn_; }
|
{ return globalFlowsn_; }
|
||||||
|
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& globalFloresn() const
|
const std::array<FlowsData<double>, 3>& globalFloresn() const
|
||||||
{ return globalFloresn_; }
|
{ return globalFloresn_; }
|
||||||
|
|
||||||
bool isIORank() const
|
bool isIORank() const
|
||||||
@ -160,8 +161,8 @@ protected:
|
|||||||
data::Aquifers globalAquiferData_;
|
data::Aquifers globalAquiferData_;
|
||||||
WellTestState globalWellTestState_;
|
WellTestState globalWellTestState_;
|
||||||
std::vector<int> localIdxToGlobalIdx_;
|
std::vector<int> localIdxToGlobalIdx_;
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3> globalFlowsn_;
|
std::array<FlowsData<double>, 3> globalFlowsn_;
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3> globalFloresn_;
|
std::array<FlowsData<double>, 3> globalFloresn_;
|
||||||
/// \brief sorted list of cartesian indices present-
|
/// \brief sorted list of cartesian indices present-
|
||||||
///
|
///
|
||||||
/// non-empty only when running in parallel
|
/// non-empty only when running in parallel
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include <dune/grid/common/mcmgmapper.hh>
|
#include <dune/grid/common/mcmgmapper.hh>
|
||||||
#include <dune/grid/common/partitionset.hh>
|
#include <dune/grid/common/partitionset.hh>
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -782,13 +781,13 @@ public:
|
|||||||
|
|
||||||
class PackUnpackFlows : public P2PCommunicatorType::DataHandleInterface
|
class PackUnpackFlows : public P2PCommunicatorType::DataHandleInterface
|
||||||
{
|
{
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& localFlows_;
|
const std::array<FlowsData<double>, 3>& localFlows_;
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& globalFlows_;
|
std::array<FlowsData<double>, 3>& globalFlows_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PackUnpackFlows(const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3> & localFlows,
|
PackUnpackFlows(const std::array<FlowsData<double>, 3> & localFlows,
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& globalFlows,
|
std::array<FlowsData<double>, 3>& globalFlows,
|
||||||
const bool isIORank)
|
const bool isIORank)
|
||||||
: localFlows_(localFlows)
|
: localFlows_(localFlows)
|
||||||
, globalFlows_(globalFlows)
|
, globalFlows_(globalFlows)
|
||||||
{
|
{
|
||||||
@ -807,14 +806,14 @@ public:
|
|||||||
if (link != 0)
|
if (link != 0)
|
||||||
throw std::logic_error("link in method pack is not 0 as expected");
|
throw std::logic_error("link in method pack is not 0 as expected");
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
const auto& name = localFlows_[i].first;
|
const auto& name = localFlows_[i].name;
|
||||||
buffer.write(name);
|
buffer.write(name);
|
||||||
unsigned int size = localFlows_[i].second.first.size();
|
const std::size_t size = localFlows_[i].indices.size();
|
||||||
buffer.write(size);
|
buffer.write(size);
|
||||||
for (unsigned int j = 0; j < size; ++j) {
|
for (std::size_t j = 0; j < size; ++j) {
|
||||||
const auto& nncIdx = localFlows_[i].second.first[j];
|
const auto& nncIdx = localFlows_[i].indices[j];
|
||||||
buffer.write(nncIdx);
|
buffer.write(nncIdx);
|
||||||
const auto& flows = localFlows_[i].second.second[j];
|
const auto& flows = localFlows_[i].values[j];
|
||||||
buffer.write(flows);
|
buffer.write(flows);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -825,7 +824,7 @@ public:
|
|||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
std::string name;
|
std::string name;
|
||||||
buffer.read(name);
|
buffer.read(name);
|
||||||
globalFlows_[i].first = name;
|
globalFlows_[i].name = name;
|
||||||
unsigned int size = 0;
|
unsigned int size = 0;
|
||||||
buffer.read(size);
|
buffer.read(size);
|
||||||
for (unsigned int j = 0; j < size; ++j) {
|
for (unsigned int j = 0; j < size; ++j) {
|
||||||
@ -836,7 +835,7 @@ public:
|
|||||||
if (nncIdx < 0)
|
if (nncIdx < 0)
|
||||||
continue;
|
continue;
|
||||||
// This array is initialized in the collect(...) method below
|
// This array is initialized in the collect(...) method below
|
||||||
globalFlows_[i].second.second[nncIdx] = data;
|
globalFlows_[i].values[nncIdx] = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -975,8 +974,8 @@ collect(const data::Solution& localCellData,
|
|||||||
const data::Aquifers& localAquiferData,
|
const data::Aquifers& localAquiferData,
|
||||||
const WellTestState& localWellTestState,
|
const WellTestState& localWellTestState,
|
||||||
const InterRegFlowMap& localInterRegFlows,
|
const InterRegFlowMap& localInterRegFlows,
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& localFlowsn,
|
const std::array<FlowsData<double>, 3>& localFlowsn,
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& localFloresn)
|
const std::array<FlowsData<double>, 3>& localFloresn)
|
||||||
{
|
{
|
||||||
globalCellData_ = {};
|
globalCellData_ = {};
|
||||||
globalBlockData_.clear();
|
globalBlockData_.clear();
|
||||||
@ -1010,12 +1009,10 @@ collect(const data::Solution& localCellData,
|
|||||||
|
|
||||||
// Set the right sizes for Flowsn and Floresn
|
// Set the right sizes for Flowsn and Floresn
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
unsigned int sizeFlr = localFloresn[i].second.first.size();
|
const std::size_t sizeFlr = localFloresn[i].indices.size();
|
||||||
globalFloresn_[i].second.first.resize(sizeFlr, 0);
|
globalFloresn_[i].resize(sizeFlr);
|
||||||
globalFloresn_[i].second.second.resize(sizeFlr, 0.0);
|
const std::size_t sizeFlo = localFlowsn[i].indices.size();
|
||||||
unsigned int sizeFlo = localFlowsn[i].second.first.size();
|
globalFlowsn_[i].resize(sizeFlo);
|
||||||
globalFlowsn_[i].second.first.resize(sizeFlo, 0);
|
|
||||||
globalFlowsn_[i].second.second.resize(sizeFlo, 0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PackUnPackWellData packUnpackWellData {
|
PackUnPackWellData packUnpackWellData {
|
||||||
|
@ -1137,9 +1137,9 @@ doAllocBuffers(const unsigned bufferSize,
|
|||||||
if (numOutputNnc > 0) {
|
if (numOutputNnc > 0) {
|
||||||
enableFlowsn_ = true;
|
enableFlowsn_ = true;
|
||||||
|
|
||||||
flowsn_[compIdxs[ii]].first = rstName[ii];
|
flowsn_[compIdxs[ii]].name = rstName[ii];
|
||||||
flowsn_[compIdxs[ii]].second.first.resize(numOutputNnc, -1);
|
flowsn_[compIdxs[ii]].indices.resize(numOutputNnc, -1);
|
||||||
flowsn_[compIdxs[ii]].second.second.resize(numOutputNnc, 0.0);
|
flowsn_[compIdxs[ii]].values.resize(numOutputNnc, 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1173,9 +1173,9 @@ doAllocBuffers(const unsigned bufferSize,
|
|||||||
if (numOutputNnc > 0) {
|
if (numOutputNnc > 0) {
|
||||||
enableFloresn_ = true;
|
enableFloresn_ = true;
|
||||||
|
|
||||||
floresn_[compIdxs[ii]].first = rstName[ii];
|
floresn_[compIdxs[ii]].name = rstName[ii];
|
||||||
floresn_[compIdxs[ii]].second.first.resize(numOutputNnc, -1);
|
floresn_[compIdxs[ii]].indices.resize(numOutputNnc, -1);
|
||||||
floresn_[compIdxs[ii]].second.second.resize(numOutputNnc, 0.0);
|
floresn_[compIdxs[ii]].values.resize(numOutputNnc, 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#ifndef EWOMS_ECL_GENERIC_OUTPUT_BLACK_OIL_MODULE_HH
|
#ifndef EWOMS_ECL_GENERIC_OUTPUT_BLACK_OIL_MODULE_HH
|
||||||
#define EWOMS_ECL_GENERIC_OUTPUT_BLACK_OIL_MODULE_HH
|
#define EWOMS_ECL_GENERIC_OUTPUT_BLACK_OIL_MODULE_HH
|
||||||
|
|
||||||
|
#include "opm/simulators/flow/FlowsData.hpp"
|
||||||
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||||
#include <opm/output/data/Wells.hpp>
|
#include <opm/output/data/Wells.hpp>
|
||||||
#include <opm/output/eclipse/Inplace.hpp>
|
#include <opm/output/eclipse/Inplace.hpp>
|
||||||
@ -194,7 +195,7 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& getFlowsn() const
|
const std::array<FlowsData<double>, 3>& getFlowsn() const
|
||||||
{
|
{
|
||||||
return this->flowsn_;
|
return this->flowsn_;
|
||||||
}
|
}
|
||||||
@ -219,7 +220,7 @@ public:
|
|||||||
return anyFlows_;
|
return anyFlows_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>& getFloresn() const
|
const std::array<FlowsData<double>, 3>& getFloresn() const
|
||||||
{
|
{
|
||||||
return this->floresn_;
|
return this->floresn_;
|
||||||
}
|
}
|
||||||
@ -493,8 +494,8 @@ protected:
|
|||||||
std::array<std::array<ScalarBuffer, numPhases>, 6> flows_;
|
std::array<std::array<ScalarBuffer, numPhases>, 6> flows_;
|
||||||
std::array<std::array<ScalarBuffer, numPhases>, 6> flores_;
|
std::array<std::array<ScalarBuffer, numPhases>, 6> flores_;
|
||||||
|
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, ScalarBuffer>>, 3> floresn_;
|
std::array<FlowsData<double>, 3> floresn_;
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, ScalarBuffer>>, 3> flowsn_;
|
std::array<FlowsData<double>, 3> flowsn_;
|
||||||
|
|
||||||
std::map<std::size_t, Scalar> oilConnectionPressures_;
|
std::map<std::size_t, Scalar> oilConnectionPressures_;
|
||||||
std::map<std::size_t, Scalar> waterConnectionSaturations_;
|
std::map<std::size_t, Scalar> waterConnectionSaturations_;
|
||||||
|
@ -117,24 +117,24 @@ protected:
|
|||||||
const TransmissibilityType& globalTrans() const;
|
const TransmissibilityType& globalTrans() const;
|
||||||
unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const;
|
unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const;
|
||||||
|
|
||||||
void doWriteOutput(const int reportStepNum,
|
void doWriteOutput(const int reportStepNum,
|
||||||
const bool isSubStep,
|
const bool isSubStep,
|
||||||
data::Solution&& localCellData,
|
data::Solution&& localCellData,
|
||||||
data::Wells&& localWellData,
|
data::Wells&& localWellData,
|
||||||
data::GroupAndNetworkValues&& localGroupAndNetworkData,
|
data::GroupAndNetworkValues&& localGroupAndNetworkData,
|
||||||
data::Aquifers&& localAquiferData,
|
data::Aquifers&& localAquiferData,
|
||||||
WellTestState&& localWTestState,
|
WellTestState&& localWTestState,
|
||||||
const Action::State& actionState,
|
const Action::State& actionState,
|
||||||
const UDQState& udqState,
|
const UDQState& udqState,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const std::vector<Scalar>& thresholdPressure,
|
const std::vector<Scalar>& thresholdPressure,
|
||||||
Scalar curTime,
|
Scalar curTime,
|
||||||
Scalar nextStepSize,
|
Scalar nextStepSize,
|
||||||
bool doublePrecision,
|
bool doublePrecision,
|
||||||
bool isFlowsn,
|
bool isFlowsn,
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>&& flowsn,
|
std::array<FlowsData<double>,3>&& flowsn,
|
||||||
bool isFloresn,
|
bool isFloresn,
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>&& floresn);
|
std::array<FlowsData<double>, 3>&& floresn);
|
||||||
|
|
||||||
void evalSummary(int reportStepNum,
|
void evalSummary(int reportStepNum,
|
||||||
Scalar curTime,
|
Scalar curTime,
|
||||||
|
@ -505,24 +505,24 @@ exportNncStructure_(const std::unordered_map<int,int>& cartesianToActive,
|
|||||||
|
|
||||||
template<class Grid, class EquilGrid, class GridView, class ElementMapper, class Scalar>
|
template<class Grid, class EquilGrid, class GridView, class ElementMapper, class Scalar>
|
||||||
void EclGenericWriter<Grid,EquilGrid,GridView,ElementMapper,Scalar>::
|
void EclGenericWriter<Grid,EquilGrid,GridView,ElementMapper,Scalar>::
|
||||||
doWriteOutput(const int reportStepNum,
|
doWriteOutput(const int reportStepNum,
|
||||||
const bool isSubStep,
|
const bool isSubStep,
|
||||||
data::Solution&& localCellData,
|
data::Solution&& localCellData,
|
||||||
data::Wells&& localWellData,
|
data::Wells&& localWellData,
|
||||||
data::GroupAndNetworkValues&& localGroupAndNetworkData,
|
data::GroupAndNetworkValues&& localGroupAndNetworkData,
|
||||||
data::Aquifers&& localAquiferData,
|
data::Aquifers&& localAquiferData,
|
||||||
WellTestState&& localWTestState,
|
WellTestState&& localWTestState,
|
||||||
const Action::State& actionState,
|
const Action::State& actionState,
|
||||||
const UDQState& udqState,
|
const UDQState& udqState,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const std::vector<Scalar>& thresholdPressure,
|
const std::vector<Scalar>& thresholdPressure,
|
||||||
Scalar curTime,
|
Scalar curTime,
|
||||||
Scalar nextStepSize,
|
Scalar nextStepSize,
|
||||||
bool doublePrecision,
|
bool doublePrecision,
|
||||||
bool isFlowsn,
|
bool isFlowsn,
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>&& flowsn,
|
std::array<FlowsData<double>, 3>&& flowsn,
|
||||||
bool isFloresn,
|
bool isFloresn,
|
||||||
std::array<std::pair<std::string, std::pair<std::vector<int>, std::vector<double>>>, 3>&& floresn)
|
std::array<FlowsData<double>, 3>&& floresn)
|
||||||
{
|
{
|
||||||
const auto isParallel = this->collectToIORank_.isParallel();
|
const auto isParallel = this->collectToIORank_.isParallel();
|
||||||
const bool needsReordering = this->collectToIORank_.doesNeedReordering();
|
const bool needsReordering = this->collectToIORank_.doesNeedReordering();
|
||||||
@ -556,22 +556,22 @@ doWriteOutput(const int reportStepNum,
|
|||||||
if (isFlowsn) {
|
if (isFlowsn) {
|
||||||
const auto flowsn_global = isParallel ? this->collectToIORank_.globalFlowsn() : std::move(flowsn);
|
const auto flowsn_global = isParallel ? this->collectToIORank_.globalFlowsn() : std::move(flowsn);
|
||||||
for (const auto& flows : flowsn_global) {
|
for (const auto& flows : flowsn_global) {
|
||||||
if (flows.first.empty())
|
if (flows.name.empty())
|
||||||
continue;
|
continue;
|
||||||
if (flows.first == "FLOGASN+") {
|
if (flows.name == "FLOGASN+") {
|
||||||
restartValue.addExtra(flows.first, UnitSystem::measure::gas_surface_rate, flows.second.second);
|
restartValue.addExtra(flows.name, UnitSystem::measure::gas_surface_rate, flows.values);
|
||||||
}
|
} else {
|
||||||
else {
|
restartValue.addExtra(flows.name, UnitSystem::measure::liquid_surface_rate, flows.values);
|
||||||
restartValue.addExtra(flows.first, UnitSystem::measure::liquid_surface_rate, flows.second.second);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isFloresn) {
|
if (isFloresn) {
|
||||||
const auto floresn_global = isParallel ? this->collectToIORank_.globalFloresn() : std::move(floresn);
|
const auto floresn_global = isParallel ? this->collectToIORank_.globalFloresn() : std::move(floresn);
|
||||||
for (const auto& flores : floresn_global) {
|
for (const auto& flores : floresn_global) {
|
||||||
if (flores.first.empty())
|
if (flores.name.empty()) {
|
||||||
continue;
|
continue;
|
||||||
restartValue.addExtra(flores.first, UnitSystem::measure::rate, flores.second.second);
|
}
|
||||||
|
restartValue.addExtra(flores.name, UnitSystem::measure::rate, flores.values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,19 +688,19 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flowsInfo.faceId == -2) {
|
if (flowsInfo.faceId == -2) {
|
||||||
if (!this->flowsn_[gasCompIdx].second.first.empty()) {
|
if (!this->flowsn_[gasCompIdx].indices.empty()) {
|
||||||
this->flowsn_[gasCompIdx].second.first[flowsInfo.nncId] = flowsInfo.nncId;
|
this->flowsn_[gasCompIdx].indices[flowsInfo.nncId] = flowsInfo.nncId;
|
||||||
this->flowsn_[gasCompIdx].second.second[flowsInfo.nncId]
|
this->flowsn_[gasCompIdx].values[flowsInfo.nncId]
|
||||||
= flowsInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(gasCompIdx)];
|
= flowsInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(gasCompIdx)];
|
||||||
}
|
}
|
||||||
if (!this->flowsn_[oilCompIdx].second.first.empty()) {
|
if (!this->flowsn_[oilCompIdx].indices.empty()) {
|
||||||
this->flowsn_[oilCompIdx].second.first[flowsInfo.nncId] = flowsInfo.nncId;
|
this->flowsn_[oilCompIdx].indices[flowsInfo.nncId] = flowsInfo.nncId;
|
||||||
this->flowsn_[oilCompIdx].second.second[flowsInfo.nncId]
|
this->flowsn_[oilCompIdx].values[flowsInfo.nncId]
|
||||||
= flowsInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(oilCompIdx)];
|
= flowsInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(oilCompIdx)];
|
||||||
}
|
}
|
||||||
if (!this->flowsn_[waterCompIdx].second.first.empty()) {
|
if (!this->flowsn_[waterCompIdx].indices.empty()) {
|
||||||
this->flowsn_[waterCompIdx].second.first[flowsInfo.nncId] = flowsInfo.nncId;
|
this->flowsn_[waterCompIdx].indices[flowsInfo.nncId] = flowsInfo.nncId;
|
||||||
this->flowsn_[waterCompIdx].second.second[flowsInfo.nncId]
|
this->flowsn_[waterCompIdx].values[flowsInfo.nncId]
|
||||||
= flowsInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(waterCompIdx)];
|
= flowsInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(waterCompIdx)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -728,19 +728,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (floresInfo.faceId == -2) {
|
if (floresInfo.faceId == -2) {
|
||||||
if (!this->floresn_[gasCompIdx].second.first.empty()) {
|
if (!this->floresn_[gasCompIdx].indices.empty()) {
|
||||||
this->floresn_[gasCompIdx].second.first[floresInfo.nncId] = floresInfo.nncId;
|
this->floresn_[gasCompIdx].indices[floresInfo.nncId] = floresInfo.nncId;
|
||||||
this->floresn_[gasCompIdx].second.second[floresInfo.nncId]
|
this->floresn_[gasCompIdx].values[floresInfo.nncId]
|
||||||
= floresInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(gasCompIdx)];
|
= floresInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(gasCompIdx)];
|
||||||
}
|
}
|
||||||
if (!this->floresn_[oilCompIdx].second.first.empty()) {
|
if (!this->floresn_[oilCompIdx].indices.empty()) {
|
||||||
this->floresn_[oilCompIdx].second.first[floresInfo.nncId] = floresInfo.nncId;
|
this->floresn_[oilCompIdx].indices[floresInfo.nncId] = floresInfo.nncId;
|
||||||
this->floresn_[oilCompIdx].second.second[floresInfo.nncId]
|
this->floresn_[oilCompIdx].values[floresInfo.nncId]
|
||||||
= floresInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(oilCompIdx)];
|
= floresInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(oilCompIdx)];
|
||||||
}
|
}
|
||||||
if (!this->floresn_[waterCompIdx].second.first.empty()) {
|
if (!this->floresn_[waterCompIdx].indices.empty()) {
|
||||||
this->floresn_[waterCompIdx].second.first[floresInfo.nncId] = floresInfo.nncId;
|
this->floresn_[waterCompIdx].indices[floresInfo.nncId] = floresInfo.nncId;
|
||||||
this->floresn_[waterCompIdx].second.second[floresInfo.nncId]
|
this->floresn_[waterCompIdx].values[floresInfo.nncId]
|
||||||
= floresInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(waterCompIdx)];
|
= floresInfo.flow[conti0EqIdx + Indices::canonicalToActiveComponentIndex(waterCompIdx)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
47
opm/simulators/flow/FlowsData.hpp
Normal file
47
opm/simulators/flow/FlowsData.hpp
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2023 SINTEF Digital
|
||||||
|
|
||||||
|
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 3 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef OPM_FLOWS_DATA_HEADER_INCLUDED
|
||||||
|
#define OPM_FLOWS_DATA_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
|
||||||
|
//! \brief Simple container for FLOWS data.
|
||||||
|
template<class Scalar>
|
||||||
|
struct FlowsData
|
||||||
|
{
|
||||||
|
//! \brief Resize data vectors.
|
||||||
|
void resize(const std::size_t size)
|
||||||
|
{
|
||||||
|
indices.resize(size);
|
||||||
|
values.resize(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string name; //!< Associated name
|
||||||
|
std::vector<int> indices; //!< Cell indices for values
|
||||||
|
std::vector<Scalar> values; //!< Values
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Opm
|
||||||
|
|
||||||
|
#endif // OPM_FLOWS_DATA_HEADER_INCLUDED
|
Loading…
Reference in New Issue
Block a user