diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index 03003396a..74aa79a91 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -791,6 +791,16 @@ namespace detail { } } +#if 0 + std::cout << " state.bhp " << std::endl; + std::cout << state.bhp.value() << std::endl; + std::cout << " perf_press " << std::endl; + std::cout << perf_press << std::endl; + std::cout << " avg_press " << std::endl; + std::cout << avg_press << std::endl; +#endif + + // Use cell values for the temperature as the wells don't knows its temperature yet. const ADB perf_temp = subset(state.temperature, well_cells); diff --git a/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp b/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp index b781e6246..1f59d41a7 100644 --- a/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp +++ b/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp @@ -321,6 +321,15 @@ namespace Opm { start_segment += nseg; } +#if 0 + std::cout << " state.segp " << std::endl; + std::cout << state.segp.value() << std::endl; + std::cout << " perf_press " << std::endl; + std::cout << perf_press << std::endl; + std::cout << " avg_press " << std::endl; + std::cout << avg_press << std::endl; +#endif + // Use cell values for the temperature as the wells don't knows its temperature yet. const ADB perf_temp = subset(state.temperature, well_cells); diff --git a/opm/autodiff/WellStateMultiSegment.hpp b/opm/autodiff/WellStateMultiSegment.hpp index 029d37eed..05a7fc561 100644 --- a/opm/autodiff/WellStateMultiSegment.hpp +++ b/opm/autodiff/WellStateMultiSegment.hpp @@ -213,7 +213,7 @@ namespace Opm for (int p = 0; p < np; ++p) { perfPhaseRates()[np * (i + start_perforation) + p] = wellrates_[np * w + p] / double(number_of_perforations); } - perfpress_[i + start_perforation] = state.pressure()[wells[w]->wellCells()[i + start_perforation]]; + perfpress_[i + start_perforation] = state.pressure()[wells[w]->wellCells()[i]]; } // 5. Segment rates and pressures @@ -222,7 +222,8 @@ namespace Opm // when under bhp control. // the seg_rates will related to the sum of the perforation rates, and also trying to keep consistent with the // well rates. Most importantly, the segment rates of the top segment is the same with the well rates - for (int i = 0; i < number_of_segments; ++i) { + segpress_[start_segment] = bhp_[w]; + for (int i = 1; i < number_of_segments; ++i) { /* for (int p = 0; p < np; ++p) { segphaserates_[np * (i + start_segment) + p] = 0.; } */