mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 15:10:09 -05:00
move assignment of RFT data into RFTContainer
This commit is contained in:
1 parent
641787aca8
commit
8b0c00c8cb
3 files changed
+30
-10
No files matched your search
@@ -630,15 +630,10 @@ public:
|
||||
|
||||
// Adding Well RFT data
|
||||
const auto cartesianIdx = elemCtx.simulator().vanguard().cartesianIndex(globalDofIdx);
|
||||
if (this->rftC_.oilConnectionPressures_.count(cartesianIdx) > 0) {
|
||||
this->rftC_.oilConnectionPressures_[cartesianIdx] = getValue(fs.pressure(oilPhaseIdx));
|
||||
}
|
||||
if (this->rftC_.waterConnectionSaturations_.count(cartesianIdx) > 0) {
|
||||
this->rftC_.waterConnectionSaturations_[cartesianIdx] = getValue(fs.saturation(waterPhaseIdx));
|
||||
}
|
||||
if (this->rftC_.gasConnectionSaturations_.count(cartesianIdx) > 0) {
|
||||
this->rftC_.gasConnectionSaturations_[cartesianIdx] = getValue(fs.saturation(gasPhaseIdx));
|
||||
}
|
||||
this->rftC_.assign(cartesianIdx,
|
||||
[&fs]() { return getValue(fs.pressure(oilPhaseIdx)); },
|
||||
[&fs]() { return getValue(fs.saturation(waterPhaseIdx)); },
|
||||
[&fs]() { return getValue(fs.saturation(gasPhaseIdx)); });
|
||||
|
||||
// tracers
|
||||
const auto& tracerModel = simulator_.problem().tracerModel();
|
||||
|
||||
@@ -129,7 +129,6 @@ addToWells(data::Wells& wellDatas,
|
||||
gasConnectionSaturations_.clear();
|
||||
}
|
||||
|
||||
|
||||
template<class FluidSystem>
|
||||
void RFTContainer<FluidSystem>::
|
||||
allocate(const std::size_t reportStepNum)
|
||||
@@ -168,6 +167,26 @@ allocate(const std::size_t reportStepNum)
|
||||
}
|
||||
}
|
||||
|
||||
template<class FluidSystem>
|
||||
void RFTContainer<FluidSystem>::
|
||||
assign(const unsigned cartesianIndex,
|
||||
const AssignmentFunc& oil,
|
||||
const AssignmentFunc& water,
|
||||
const AssignmentFunc& gas)
|
||||
{
|
||||
auto cond_assign = [](auto& map, unsigned idx, const auto& func)
|
||||
{
|
||||
auto it = map.find(idx);
|
||||
if (it != map.end()) {
|
||||
it->second = func();
|
||||
}
|
||||
};
|
||||
|
||||
cond_assign(oilConnectionPressures_, cartesianIndex, oil);
|
||||
cond_assign(waterConnectionSaturations_, cartesianIndex, water);
|
||||
cond_assign(gasConnectionSaturations_, cartesianIndex, gas);
|
||||
}
|
||||
|
||||
template<class T> using FS = BlackOilFluidSystem<T,BlackOilDefaultIndexTraits>;
|
||||
|
||||
#define INSTANTIATE_TYPE(T) \
|
||||
|
||||
@@ -50,6 +50,7 @@ class RFTContainer {
|
||||
static constexpr auto waterPhaseIdx = FluidSystem::waterPhaseIdx;
|
||||
|
||||
public:
|
||||
using AssignmentFunc = std::function<Scalar()>;
|
||||
using WellQueryFunc = std::function<bool(const std::string&)>;
|
||||
|
||||
RFTContainer(const EclipseState& eclState,
|
||||
@@ -66,6 +67,11 @@ public:
|
||||
|
||||
void allocate(const std::size_t reportStepNum);
|
||||
|
||||
void assign(const unsigned cartesianIndex,
|
||||
const AssignmentFunc& oil,
|
||||
const AssignmentFunc& water,
|
||||
const AssignmentFunc& gas);
|
||||
|
||||
const EclipseState& eclState_;
|
||||
const Schedule& schedule_;
|
||||
WellQueryFunc wellQuery_;
|
||||
|
||||
Reference in new issue
Block a user