fixing warnings related to mutlie segment wells.

This commit is contained in:
Kai Bao 2015-10-06 16:53:22 +02:00
parent 09f8da0324
commit cf766b5c3e
5 changed files with 26 additions and 29 deletions

View File

@ -80,8 +80,8 @@ namespace Opm {
, well_perforation_densities_adb_(ADB::null())
, well_perforation_pressure_diffs_adb_(ADB::null())
, well_perforation_pressure_cell_diffs_adb_(ADB::null())
, well_perforation_cell_densities_adb_(ADB::null())
, well_perforations_segment_pressure_diffs_(ADB::null())
, well_perforation_cell_densities_adb_(ADB::null())
, well_segment_densities_(ADB::null())
, wells_multisegment_(wells_multisegment)
{
@ -746,7 +746,8 @@ namespace Opm {
std::vector<ADB> cmix_s(np, ADB::constant(V::Zero(nperf)));
if (aliveWells[w] > 0.) {
for (int phase = 0; phase < np; ++phase) {
const int pos = pu.phase_pos[phase];
// const int pos = pu.phase_pos[phase];
// TODO: make sure wheter phase or pos be required here.
cmix_s[phase] = well->wellOps().s2p * (wbq[phase] / wbqt);
}
} else {
@ -799,7 +800,7 @@ namespace Opm {
// Update the perforation phase rates (used to calculate the pressure drop in the wellbore).
// TODO: now it is so necesary to have a gobal wellsMultiSegment class to store some global information.
const int np = numPhases();
const int nw = wellsMultiSegment().size();
// const int nw = wellsMultiSegment().size();
const int nperf = xw.perfPress().size();
V cq = superset(cq_s[0].value(), Span(nperf, np, 0), nperf*np);
@ -894,7 +895,7 @@ namespace Opm {
// switch control to first broken constraint.
const int np = wellsMultiSegment()[0]->numberOfPhases();
const int nw = wellsMultiSegment().size();
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
// const Opm::PhaseUsage& pu = fluid_.phaseUsage();
for (int w = 0; w < nw; ++w) {
const WellControls* wc = wellsMultiSegment()[w]->wellControls();
// The current control in the well state overrides
@ -938,8 +939,8 @@ namespace Opm {
current = xw.currentControls()[w];
}
//Get gravity for THP hydrostatic corrrection
const double gravity = detail::getGravity(geo_.gravity(), UgGridHelpers::dimensions(grid_));
// Get gravity for THP hydrostatic corrrection
// const double gravity = detail::getGravity(geo_.gravity(), UgGridHelpers::dimensions(grid_));
// Updating well state and primary variables.
// Target values are used as initial conditions for BHP, THP, and SURFACE_RATE
@ -1236,7 +1237,6 @@ namespace Opm {
using namespace Opm::AutoDiffGrid;
const int np = fluid_.numPhases();
const int nc = numCells(grid_);
const int nw = wellsMultiSegment().size();
const V null;
assert(null.size() == 0);
const V zero = V::Zero(nc);

View File

@ -137,7 +137,6 @@ namespace Opm
std::cout << " number of perforations : " << well->numberOfPerforations() << std::endl;
std::cout << " beginning outputing segment informations " << std::endl;
int nseg = well->numberOfSegments();
for (int s = 0; s < well->numberOfSegments(); ++s) {
std::cout << " segment number : " << s << std::endl;
int n_perf_segment = well->segmentPerforations()[s].size();
@ -186,6 +185,7 @@ namespace Opm
}
std::cin.ignore();
}
// DEBUGGING OUTPUT is DONE
well_state.init(wells_multisegment, state, prev_well_state);

View File

@ -58,7 +58,7 @@ namespace Opm
// what is the point to do this?
// we change the ID to location now for easier use later.
for (size_t i = 0; i < m_number_of_segments_; ++i) {
for (int i = 0; i < m_number_of_segments_; ++i) {
// now the segment for top segment is 0, then its outlet segment will be -1
// it is also the flag to indicate the top segment
m_outlet_segment_[i] = segment_set->numberToLocation((*segment_set)[i]->outletSegment());
@ -109,7 +109,7 @@ namespace Opm
std::vector<double> temp_perf_depth;
temp_perf_depth.resize(m_number_of_perforations_);
for (size_t i = 0; i < completion_set->size(); ++i) {
for (int i = 0; i < (int)completion_set->size(); ++i) {
int i_segment = completion_set->get(i)->getSegmentNumber();
// convert the original segment id to be the current segment id,
// which is the location in the array.
@ -126,8 +126,8 @@ namespace Opm
m_perf_depth_.resize(m_number_of_perforations_);
int perf_count = 0;
for (size_t is = 0; is < m_number_of_segments_; ++is) {
for (size_t iperf = 0; iperf < m_segment_perforations_[is].size(); ++iperf) {
for (int is = 0; is < m_number_of_segments_; ++is) {
for (int iperf = 0; iperf < (int)m_segment_perforations_[is].size(); ++iperf) {
int perf_number = m_segment_perforations_[is][iperf];
m_well_cell_[perf_count] = temp_well_cell[perf_number];
m_well_index_[perf_count] = temp_well_index[perf_number];
@ -140,7 +140,7 @@ namespace Opm
assert(perf_count == m_number_of_perforations_);
// update m_inlet_segments_
for (size_t is = 0; is < m_number_of_segments_; ++is) {
for (int is = 0; is < m_number_of_segments_; ++is) {
const int index_outlet = m_outlet_segment_[is];
m_inlet_segments_[index_outlet].push_back(is);
}
@ -214,7 +214,7 @@ namespace Opm
m_perf_depth_.resize(m_number_of_perforations_, 0.);
m_segment_perforations_[0].resize(m_number_of_perforations_);
for (size_t i = 0; i < m_number_of_perforations_; ++i) {
for (int i = 0; i < m_number_of_perforations_; ++i) {
m_segment_perforations_[0][i] = i;
m_perf_depth_[i] = completion_set->get(i)->getCenterDepth();
}
@ -342,11 +342,11 @@ namespace Opm
return m_well_controls_;
}
const size_t WellMultiSegment::numberOfPerforations() const {
const int WellMultiSegment::numberOfPerforations() const {
return m_number_of_perforations_;
}
const size_t WellMultiSegment::numberOfSegments() const {
const int WellMultiSegment::numberOfSegments() const {
return m_number_of_segments_;
}
@ -354,7 +354,7 @@ namespace Opm
return m_comp_frac_;
}
const size_t WellMultiSegment::numberOfPhases() const {
const int WellMultiSegment::numberOfPhases() const {
return m_number_of_phases_;
}

View File

@ -55,13 +55,13 @@ namespace Opm
const std::string& name() const;
const bool isMultiSegmented() const;
const size_t numberOfPerforations() const;
const size_t numberOfSegments() const;
const int numberOfPerforations() const;
const int numberOfSegments() const;
const struct WellControls* wellControls() const;
const std::vector<double>& compFrac() const;
const size_t numberOfPhases() const;
const int numberOfPhases() const;
const enum WellType wellType() const;
const std::vector<double>& wellIndex() const;
@ -109,7 +109,7 @@ namespace Opm
// INJECTOR or PRODUCER
enum WellType m_well_type_;
// number of phases
size_t m_number_of_phases_;
int m_number_of_phases_;
// component fractions for each well
std::vector<double> m_comp_frac_;
// controls for this well
@ -121,9 +121,9 @@ namespace Opm
// multi-phase flow model
WellSegment::MultiPhaseModelEnum m_multiphase_model_;
// number of perforation for this well
size_t m_number_of_perforations_;
int m_number_of_perforations_;
// number of segments for this well
size_t m_number_of_segments_;
int m_number_of_segments_;
// well index for each completion
std::vector<double> m_well_index_;
// depth for each completion // form the keyword COMPSEGS?

View File

@ -106,8 +106,7 @@ namespace Opm
}
for (int iw = 0; iw < nw; ++iw) {
assert((wells[i]->wellType() == INJECTOR) || (wells[i]->wellType() == PRODUCER));
const WellControls* ctrl = wells[iw]->wellControls();
assert((wells[iw]->wellType() == INJECTOR) || (wells[iw]->wellType() == PRODUCER));
}
int start_segment = 0;
@ -363,8 +362,6 @@ namespace Opm
if (int debug = 0) {
std::cout << " output all the well state informations after initialization " << std::endl;
const int np = numberOfPhases();
const int nw = numberOfWells();
const int nperf_total = numberOfPerforations();
const int nseg_total = numberOfSegments();
@ -417,9 +414,9 @@ namespace Opm
std::cout << " well number : " << wellmapInfo.well_number << " start segment " << wellmapInfo.start_segment
<< " number of segment : " << wellmapInfo.number_of_segments << std::endl;
std::cout << " start perforation : " << wellmapInfo.start_perforation << " number of perforations : " << wellmapInfo.number_of_perforations << std::endl;
const int nseg = wellmapInfo.number_of_segments;
const int nseg_well = wellmapInfo.number_of_segments;
std::cout << " start performation ofr each segment and number of perforation that each segment has" << std::endl;
for (int i = 0; i < nseg; ++i) {
for (int i = 0; i < nseg_well; ++i) {
std::cout << " segment " << i << " start perforation " << wellmapInfo.start_perforation_segment[i]
<< " number of perforations " << wellmapInfo.number_of_perforations_segment[i] << std::endl;
}