mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fixed several compiler warnings
This commit is contained in:
parent
a002781998
commit
9458fcc498
@ -876,6 +876,7 @@ assemble_completion_to_well(int i, int w, int c, int nc, int np,
|
|||||||
else {
|
else {
|
||||||
switch (well_controls_get_current_type(ctrl)) {
|
switch (well_controls_get_current_type(ctrl)) {
|
||||||
case BHP :
|
case BHP :
|
||||||
|
case THP : // THP is implemented as a BHP target
|
||||||
welleq_coeff_bhp(np, pw - well_controls_get_current_target( ctrl ),
|
welleq_coeff_bhp(np, pw - well_controls_get_current_target( ctrl ),
|
||||||
h, &res, &w2c, &w2w);
|
h, &res, &w2c, &w2w);
|
||||||
break;
|
break;
|
||||||
|
@ -374,6 +374,7 @@ assemble_well_contrib(int nc ,
|
|||||||
|
|
||||||
switch (well_controls_get_current_type(ctrls)) {
|
switch (well_controls_get_current_type(ctrls)) {
|
||||||
case BHP:
|
case BHP:
|
||||||
|
case THP : // THP is implemented as a BHP target
|
||||||
*all_rate = 0;
|
*all_rate = 0;
|
||||||
assemble_bhp_well (nc, w, W, mt, wdp, h);
|
assemble_bhp_well (nc, w, W, mt, wdp, h);
|
||||||
break;
|
break;
|
||||||
|
@ -124,9 +124,9 @@ namespace Opm
|
|||||||
// pressure in first perforation cell.
|
// pressure in first perforation cell.
|
||||||
switch (well_controls_get_current_type(ctrl)) {
|
switch (well_controls_get_current_type(ctrl)) {
|
||||||
case BHP:
|
case BHP:
|
||||||
|
//Already taken care of above in 2.
|
||||||
break;
|
break;
|
||||||
case THP:
|
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.
|
//Already taken care of above in 2.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -26,6 +26,12 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
static double invalid_alq = -1e100;
|
||||||
|
static double invalid_vfp = -2147483647;
|
||||||
|
} //Namespace
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -762,7 +768,7 @@ namespace Opm
|
|||||||
if (group_control_index_ < 0) {
|
if (group_control_index_ < 0) {
|
||||||
// The well only had its own controls, no group controls.
|
// The well only had its own controls, no group controls.
|
||||||
append_well_controls(SURFACE_RATE, target,
|
append_well_controls(SURFACE_RATE, target,
|
||||||
-std::numeric_limits<int>::max(), -std::numeric_limits<int>::max(),
|
invalid_alq, invalid_vfp,
|
||||||
distr, self_index_, wells_);
|
distr, self_index_, wells_);
|
||||||
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
|
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
|
||||||
} else {
|
} else {
|
||||||
@ -819,7 +825,7 @@ namespace Opm
|
|||||||
|
|
||||||
if (group_control_index_ < 0) {
|
if (group_control_index_ < 0) {
|
||||||
// The well only had its own controls, no group controls.
|
// 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;
|
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
|
||||||
} else {
|
} else {
|
||||||
// We will now modify the last control, that
|
// We will now modify the last control, that
|
||||||
@ -931,7 +937,7 @@ namespace Opm
|
|||||||
|
|
||||||
if (group_control_index_ < 0) {
|
if (group_control_index_ < 0) {
|
||||||
// The well only had its own controls, no group controls.
|
// 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;
|
group_control_index_ = well_controls_get_num(wells_->ctrls[self_index_]) - 1;
|
||||||
} else {
|
} else {
|
||||||
// We will now modify the last control, that
|
// We will now modify the last control, that
|
||||||
|
@ -39,6 +39,11 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
static double invalid_alq = -1e100;
|
||||||
|
static double invalid_vfp = -2147483647;
|
||||||
|
} //Namespace
|
||||||
|
|
||||||
// Helper structs and functions for the implementation.
|
// Helper structs and functions for the implementation.
|
||||||
namespace WellsManagerDetail
|
namespace WellsManagerDetail
|
||||||
@ -452,8 +457,8 @@ namespace Opm
|
|||||||
|
|
||||||
ok = append_well_controls(SURFACE_RATE,
|
ok = append_well_controls(SURFACE_RATE,
|
||||||
injectionProperties.surfaceInjectionRate,
|
injectionProperties.surfaceInjectionRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -474,8 +479,8 @@ namespace Opm
|
|||||||
|
|
||||||
ok = append_well_controls(RESERVOIR_RATE,
|
ok = append_well_controls(RESERVOIR_RATE,
|
||||||
injectionProperties.reservoirInjectionRate,
|
injectionProperties.reservoirInjectionRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -485,8 +490,8 @@ namespace Opm
|
|||||||
control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
|
control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
ok = append_well_controls(BHP,
|
ok = append_well_controls(BHP,
|
||||||
injectionProperties.BHPLimit,
|
injectionProperties.BHPLimit,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
NULL,
|
NULL,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -498,7 +503,7 @@ namespace Opm
|
|||||||
const int vfp_number = injectionProperties.VFPTableNumber;
|
const int vfp_number = injectionProperties.VFPTableNumber;
|
||||||
ok = append_well_controls(THP,
|
ok = append_well_controls(THP,
|
||||||
thp_limit,
|
thp_limit,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
vfp_number,
|
vfp_number,
|
||||||
NULL,
|
NULL,
|
||||||
well_index,
|
well_index,
|
||||||
@ -563,10 +568,10 @@ namespace Opm
|
|||||||
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
||||||
ok = append_well_controls(SURFACE_RATE,
|
ok = append_well_controls(SURFACE_RATE,
|
||||||
-productionProperties.OilRate,
|
-productionProperties.OilRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,8 +584,8 @@ namespace Opm
|
|||||||
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
||||||
ok = append_well_controls(SURFACE_RATE,
|
ok = append_well_controls(SURFACE_RATE,
|
||||||
-productionProperties.WaterRate,
|
-productionProperties.WaterRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -595,8 +600,8 @@ namespace Opm
|
|||||||
distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||||
ok = append_well_controls(SURFACE_RATE,
|
ok = append_well_controls(SURFACE_RATE,
|
||||||
-productionProperties.GasRate,
|
-productionProperties.GasRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -614,9 +619,9 @@ namespace Opm
|
|||||||
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
||||||
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
||||||
ok = append_well_controls(SURFACE_RATE,
|
ok = append_well_controls(SURFACE_RATE,
|
||||||
-productionProperties.LiquidRate ,
|
-productionProperties.LiquidRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -626,9 +631,9 @@ namespace Opm
|
|||||||
control_pos[WellsManagerDetail::ProductionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]);
|
control_pos[WellsManagerDetail::ProductionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
double distr[3] = { 1.0, 1.0, 1.0 };
|
double distr[3] = { 1.0, 1.0, 1.0 };
|
||||||
ok = append_well_controls(RESERVOIR_RATE,
|
ok = append_well_controls(RESERVOIR_RATE,
|
||||||
-productionProperties.ResVRate ,
|
-productionProperties.ResVRate,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
distr,
|
distr,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
@ -656,8 +661,8 @@ namespace Opm
|
|||||||
control_pos[WellsManagerDetail::ProductionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
|
control_pos[WellsManagerDetail::ProductionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
ok = append_well_controls(BHP,
|
ok = append_well_controls(BHP,
|
||||||
bhp_limit,
|
bhp_limit,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_alq,
|
||||||
-std::numeric_limits<int>::max(),
|
invalid_vfp,
|
||||||
NULL,
|
NULL,
|
||||||
well_index,
|
well_index,
|
||||||
w_);
|
w_);
|
||||||
|
@ -35,6 +35,12 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
static double invalid_alq = -1e100;
|
||||||
|
static double invalid_vfp = -2147483647;
|
||||||
|
} //Namespace
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(Construction)
|
BOOST_AUTO_TEST_CASE(Construction)
|
||||||
{
|
{
|
||||||
const int nphases = 2;
|
const int nphases = 2;
|
||||||
@ -98,11 +104,11 @@ BOOST_AUTO_TEST_CASE(Controls)
|
|||||||
if (ok) {
|
if (ok) {
|
||||||
const double distr[] = { 1.0, 0.0 };
|
const double distr[] = { 1.0, 0.0 };
|
||||||
const bool ok1 = append_well_controls(BHP, 1,
|
const bool ok1 = append_well_controls(BHP, 1,
|
||||||
-1e100, -1e100,
|
invalid_alq, invalid_vfp,
|
||||||
&distr[0],
|
&distr[0],
|
||||||
0, W.get());
|
0, W.get());
|
||||||
const bool ok2 = append_well_controls(SURFACE_RATE, 1,
|
const bool ok2 = append_well_controls(SURFACE_RATE, 1,
|
||||||
-1e100, -1e100,
|
invalid_alq, invalid_vfp,
|
||||||
&distr[0],
|
&distr[0],
|
||||||
0, W.get());
|
0, W.get());
|
||||||
|
|
||||||
@ -155,11 +161,11 @@ BOOST_AUTO_TEST_CASE(Copy)
|
|||||||
for (int w = 0; ok && (w < W1->number_of_wells); ++w) {
|
for (int w = 0; ok && (w < W1->number_of_wells); ++w) {
|
||||||
const double distr[] = { 1.0, 0.0 };
|
const double distr[] = { 1.0, 0.0 };
|
||||||
const bool okc1 = append_well_controls(BHP, 1,
|
const bool okc1 = append_well_controls(BHP, 1,
|
||||||
-1e100, -1e100,
|
invalid_alq, invalid_vfp,
|
||||||
&distr[0], w,
|
&distr[0], w,
|
||||||
W1.get());
|
W1.get());
|
||||||
const bool okc2 = append_well_controls(SURFACE_RATE, 1,
|
const bool okc2 = append_well_controls(SURFACE_RATE, 1,
|
||||||
-1e100, -1e100,
|
invalid_alq, invalid_vfp,
|
||||||
&distr[0], w,
|
&distr[0], w,
|
||||||
W1.get());
|
W1.get());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user