Fixed several compiler warnings

This commit is contained in:
babrodtk 2015-08-17 08:47:33 +02:00
parent a002781998
commit 9458fcc498
6 changed files with 49 additions and 30 deletions

View File

@ -876,6 +876,7 @@ assemble_completion_to_well(int i, int w, int c, int nc, int np,
else {
switch (well_controls_get_current_type(ctrl)) {
case BHP :
case THP : // THP is implemented as a BHP target
welleq_coeff_bhp(np, pw - well_controls_get_current_target( ctrl ),
h, &res, &w2c, &w2w);
break;

View File

@ -374,6 +374,7 @@ assemble_well_contrib(int nc ,
switch (well_controls_get_current_type(ctrls)) {
case BHP:
case THP : // THP is implemented as a BHP target
*all_rate = 0;
assemble_bhp_well (nc, w, W, mt, wdp, h);
break;

View File

@ -124,9 +124,9 @@ namespace Opm
// pressure in first perforation cell.
switch (well_controls_get_current_type(ctrl)) {
case BHP:
//Already taken care of above in 2.
break;
case THP:
//bhp_[w] = thp_[w]; //< TODO: ARB Adding this produces identical results as without THP control for artificial test case
//Already taken care of above in 2.
break;

View File

@ -26,6 +26,12 @@
#include <memory>
#include <iostream>
namespace
{
static double invalid_alq = -1e100;
static double invalid_vfp = -2147483647;
} //Namespace
namespace Opm
{
@ -762,7 +768,7 @@ namespace Opm
if (group_control_index_ < 0) {
// The well only had its own controls, no group controls.
append_well_controls(SURFACE_RATE, target,
-std::numeric_limits<int>::max(), -std::numeric_limits<int>::max(),
invalid_alq, invalid_vfp,
distr, self_index_, wells_);
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
} else {
@ -819,7 +825,7 @@ namespace Opm
if (group_control_index_ < 0) {
// The well only had its own controls, no group controls.
append_well_controls(wct, target, -1e100, -1e100, distr, self_index_, wells_);
append_well_controls(wct, target, invalid_alq, invalid_vfp, distr, self_index_, wells_);
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
} else {
// We will now modify the last control, that
@ -931,7 +937,7 @@ namespace Opm
if (group_control_index_ < 0) {
// The well only had its own controls, no group controls.
append_well_controls(wct, ntarget, -1e100, -1e100, distr, self_index_, wells_);
append_well_controls(wct, ntarget, invalid_alq, invalid_vfp, distr, self_index_, wells_);
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
} else {
// We will now modify the last control, that

View File

@ -39,6 +39,11 @@
#include <utility>
#include <iostream>
namespace
{
static double invalid_alq = -1e100;
static double invalid_vfp = -2147483647;
} //Namespace
// Helper structs and functions for the implementation.
namespace WellsManagerDetail
@ -452,8 +457,8 @@ namespace Opm
ok = append_well_controls(SURFACE_RATE,
injectionProperties.surfaceInjectionRate,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
distr,
well_index,
w_);
@ -474,8 +479,8 @@ namespace Opm
ok = append_well_controls(RESERVOIR_RATE,
injectionProperties.reservoirInjectionRate,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
distr,
well_index,
w_);
@ -485,8 +490,8 @@ namespace Opm
control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
ok = append_well_controls(BHP,
injectionProperties.BHPLimit,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
NULL,
well_index,
w_);
@ -498,7 +503,7 @@ namespace Opm
const int vfp_number = injectionProperties.VFPTableNumber;
ok = append_well_controls(THP,
thp_limit,
-std::numeric_limits<int>::max(),
invalid_alq,
vfp_number,
NULL,
well_index,
@ -563,10 +568,10 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.OilRate,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
distr,
well_index,
well_index,
w_);
}
@ -579,8 +584,8 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.WaterRate,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
distr,
well_index,
w_);
@ -595,8 +600,8 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.GasRate,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
distr,
well_index,
w_);
@ -614,9 +619,9 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.LiquidRate ,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
-productionProperties.LiquidRate,
invalid_alq,
invalid_vfp,
distr,
well_index,
w_);
@ -626,9 +631,9 @@ namespace Opm
control_pos[WellsManagerDetail::ProductionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]);
double distr[3] = { 1.0, 1.0, 1.0 };
ok = append_well_controls(RESERVOIR_RATE,
-productionProperties.ResVRate ,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
-productionProperties.ResVRate,
invalid_alq,
invalid_vfp,
distr,
well_index,
w_);
@ -656,8 +661,8 @@ namespace Opm
control_pos[WellsManagerDetail::ProductionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
ok = append_well_controls(BHP,
bhp_limit,
-std::numeric_limits<int>::max(),
-std::numeric_limits<int>::max(),
invalid_alq,
invalid_vfp,
NULL,
well_index,
w_);

View File

@ -35,6 +35,12 @@
#include <vector>
#include <memory>
namespace
{
static double invalid_alq = -1e100;
static double invalid_vfp = -2147483647;
} //Namespace
BOOST_AUTO_TEST_CASE(Construction)
{
const int nphases = 2;
@ -98,11 +104,11 @@ BOOST_AUTO_TEST_CASE(Controls)
if (ok) {
const double distr[] = { 1.0, 0.0 };
const bool ok1 = append_well_controls(BHP, 1,
-1e100, -1e100,
invalid_alq, invalid_vfp,
&distr[0],
0, W.get());
const bool ok2 = append_well_controls(SURFACE_RATE, 1,
-1e100, -1e100,
invalid_alq, invalid_vfp,
&distr[0],
0, W.get());
@ -155,11 +161,11 @@ BOOST_AUTO_TEST_CASE(Copy)
for (int w = 0; ok && (w < W1->number_of_wells); ++w) {
const double distr[] = { 1.0, 0.0 };
const bool okc1 = append_well_controls(BHP, 1,
-1e100, -1e100,
invalid_alq, invalid_vfp,
&distr[0], w,
W1.get());
const bool okc2 = append_well_controls(SURFACE_RATE, 1,
-1e100, -1e100,
invalid_alq, invalid_vfp,
&distr[0], w,
W1.get());