diff --git a/opm/autodiff/BlackoilMultiSegmentModel.hpp b/opm/autodiff/BlackoilMultiSegmentModel.hpp index faaf756a2..e34d3b602 100644 --- a/opm/autodiff/BlackoilMultiSegmentModel.hpp +++ b/opm/autodiff/BlackoilMultiSegmentModel.hpp @@ -203,6 +203,10 @@ namespace Opm { std::vector top_well_segments_; + // segment volume by dt (time step) + // to handle the volume effects of the segment + V segvdt_; + // return wells object // TODO: remove this wells structure using Base::wells; diff --git a/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp b/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp index 249349535..5b5d95378 100644 --- a/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp +++ b/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp @@ -122,6 +122,18 @@ namespace Opm { top_well_segments_ = well_state.topSegmentLoc(); //TODO: handle the volume related. + // again, we need a global wells class + const int nw = wellsMultiSegment().size(); + const int nseg_total = well_state.numSegments(); + std::vector segment_volume; + segment_volume.reserve(nseg_total); + for (int w = 0; w < nw; ++w) { + WellMultiSegmentConstPtr well = wellsMultiSegment()[w]; + const std::vector& segment_volume_well = well->segmentVolume(); + segment_volume.insert(segment_volume.end(), segment_volume_well.begin(), segment_volume_well.end()); + } + assert(int(segment_volume.size()) == nseg_total); + segvdt_ = Eigen::Map(segment_volume.data(), nseg_total) / dt; }