mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
convert users of the ASSERT and the ASSERT2 macros to standard assert()
This commit is contained in:
@@ -488,7 +488,7 @@ namespace Opm
|
|||||||
// only inject pure fluids.
|
// only inject pure fluids.
|
||||||
props_.matrix(1, &perf_p, comp_frac, &c, wpA, NULL);
|
props_.matrix(1, &perf_p, comp_frac, &c, wpA, NULL);
|
||||||
props_.viscosity(1, &perf_p, comp_frac, &c, &mu[0], NULL);
|
props_.viscosity(1, &perf_p, comp_frac, &c, &mu[0], NULL);
|
||||||
ASSERT(std::fabs(std::accumulate(comp_frac, comp_frac + np, 0.0) - 1.0) < 1e-6);
|
assert(std::fabs(std::accumulate(comp_frac, comp_frac + np, 0.0) - 1.0) < 1e-6);
|
||||||
props_.relperm (1, comp_frac, &c, wpM , NULL);
|
props_.relperm (1, comp_frac, &c, wpM , NULL);
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
for (int phase = 0; phase < np; ++phase) {
|
||||||
wpM[phase] /= mu[phase];
|
wpM[phase] /= mu[phase];
|
||||||
|
|||||||
@@ -182,9 +182,9 @@ namespace Opm
|
|||||||
ix /= dims[dim];
|
ix /= dims[dim];
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT2 (ix == 0,
|
// Make sure that lexicographic index is consistent with
|
||||||
"Lexicographic index is not consistent "
|
// grid dimensions.
|
||||||
"with grid dimensions.");
|
assert(ix == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -202,12 +202,12 @@ namespace Opm
|
|||||||
OPM_THROW(std::runtime_error, "Faces not tagged - cannot extract " << sideString(side) << " faces.");
|
OPM_THROW(std::runtime_error, "Faces not tagged - cannot extract " << sideString(side) << " faces.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT2 (grid.dimensions <= 3,
|
// make sure that grid has three dimensions or less.
|
||||||
"Grid must have three dimensions or less.");
|
assert(grid.dimensions <= 3);
|
||||||
|
|
||||||
ASSERT2 (side < 2 * grid.dimensions,
|
// Make sure boundary condition side is consistent with
|
||||||
"Boundary condition side not consistent with "
|
// number of physical grid dimensions.
|
||||||
"number of physical grid dimensions.");
|
assert(side < 2 * grid.dimensions);
|
||||||
|
|
||||||
// Get all boundary faces with the correct tag and with
|
// Get all boundary faces with the correct tag and with
|
||||||
// min/max i/j/k (depending on side).
|
// min/max i/j/k (depending on side).
|
||||||
|
|||||||
@@ -186,14 +186,14 @@ namespace Opm
|
|||||||
linsolver_.solve(h_->A, h_->b, h_->x);
|
linsolver_.solve(h_->A, h_->b, h_->x);
|
||||||
|
|
||||||
// Obtain solution.
|
// Obtain solution.
|
||||||
ASSERT(int(state.pressure().size()) == grid_.number_of_cells);
|
assert(int(state.pressure().size()) == grid_.number_of_cells);
|
||||||
ASSERT(int(state.faceflux().size()) == grid_.number_of_faces);
|
assert(int(state.faceflux().size()) == grid_.number_of_faces);
|
||||||
ifs_tpfa_solution soln = { NULL, NULL, NULL, NULL };
|
ifs_tpfa_solution soln = { NULL, NULL, NULL, NULL };
|
||||||
soln.cell_press = &state.pressure()[0];
|
soln.cell_press = &state.pressure()[0];
|
||||||
soln.face_flux = &state.faceflux()[0];
|
soln.face_flux = &state.faceflux()[0];
|
||||||
if (wells_ != NULL) {
|
if (wells_ != NULL) {
|
||||||
ASSERT(int(well_state.bhp().size()) == wells_->number_of_wells);
|
assert(int(well_state.bhp().size()) == wells_->number_of_wells);
|
||||||
ASSERT(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
|
assert(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
|
||||||
soln.well_flux = &well_state.perfRates()[0];
|
soln.well_flux = &well_state.perfRates()[0];
|
||||||
soln.well_press = &well_state.bhp()[0];
|
soln.well_press = &well_state.bhp()[0];
|
||||||
}
|
}
|
||||||
@@ -473,8 +473,8 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
// Make sure h_->x contains the direct solution vector.
|
// Make sure h_->x contains the direct solution vector.
|
||||||
ASSERT(int(state.pressure().size()) == grid_.number_of_cells);
|
assert(int(state.pressure().size()) == grid_.number_of_cells);
|
||||||
ASSERT(int(state.faceflux().size()) == grid_.number_of_faces);
|
assert(int(state.faceflux().size()) == grid_.number_of_faces);
|
||||||
std::copy(state.pressure().begin(), state.pressure().end(), h_->x);
|
std::copy(state.pressure().begin(), state.pressure().end(), h_->x);
|
||||||
std::copy(well_state.bhp().begin(), well_state.bhp().end(), h_->x + grid_.number_of_cells);
|
std::copy(well_state.bhp().begin(), well_state.bhp().end(), h_->x + grid_.number_of_cells);
|
||||||
|
|
||||||
@@ -483,8 +483,8 @@ namespace Opm
|
|||||||
soln.cell_press = &state.pressure()[0];
|
soln.cell_press = &state.pressure()[0];
|
||||||
soln.face_flux = &state.faceflux()[0];
|
soln.face_flux = &state.faceflux()[0];
|
||||||
if (wells_ != NULL) {
|
if (wells_ != NULL) {
|
||||||
ASSERT(int(well_state.bhp().size()) == wells_->number_of_wells);
|
assert(int(well_state.bhp().size()) == wells_->number_of_wells);
|
||||||
ASSERT(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
|
assert(int(well_state.perfRates().size()) == wells_->well_connpos[ wells_->number_of_wells ]);
|
||||||
soln.well_flux = &well_state.perfRates()[0];
|
soln.well_flux = &well_state.perfRates()[0];
|
||||||
soln.well_press = &well_state.bhp()[0];
|
soln.well_press = &well_state.bhp()[0];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace Opm
|
|||||||
double* dAdp) const
|
double* dAdp) const
|
||||||
{
|
{
|
||||||
const int np = numPhases();
|
const int np = numPhases();
|
||||||
ASSERT(np <= 2);
|
assert(np <= 2);
|
||||||
double B[2]; // Must be enough since component classes do not handle more than 2.
|
double B[2]; // Must be enough since component classes do not handle more than 2.
|
||||||
pvt_.B(1, 0, 0, B);
|
pvt_.B(1, 0, 0, B);
|
||||||
// Compute A matrix
|
// Compute A matrix
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace Opm
|
|||||||
pu.phase_pos[BlackoilPhases::Liquid] = 1;
|
pu.phase_pos[BlackoilPhases::Liquid] = 1;
|
||||||
pu.phase_pos[BlackoilPhases::Vapour] = 1; // Unused.
|
pu.phase_pos[BlackoilPhases::Vapour] = 1; // Unused.
|
||||||
} else {
|
} else {
|
||||||
ASSERT(pu.num_phases == 3);
|
assert(pu.num_phases == 3);
|
||||||
pu.phase_used[BlackoilPhases::Aqua] = true;
|
pu.phase_used[BlackoilPhases::Aqua] = true;
|
||||||
pu.phase_used[BlackoilPhases::Liquid] = true;
|
pu.phase_used[BlackoilPhases::Liquid] = true;
|
||||||
pu.phase_used[BlackoilPhases::Vapour] = true;
|
pu.phase_used[BlackoilPhases::Vapour] = true;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace Opm
|
|||||||
const int num_global_cells = grid.cartdims[0]*grid.cartdims[1]*grid.cartdims[2];
|
const int num_global_cells = grid.cartdims[0]*grid.cartdims[1]*grid.cartdims[2];
|
||||||
const int nc = grid.number_of_cells;
|
const int nc = grid.number_of_cells;
|
||||||
|
|
||||||
ASSERT (num_global_cells > 0);
|
assert(num_global_cells > 0);
|
||||||
|
|
||||||
permeability_.assign(dim * dim * nc, 0.0);
|
permeability_.assign(dim * dim * nc, 0.0);
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ namespace Opm
|
|||||||
if (kind == Invalid) {
|
if (kind == Invalid) {
|
||||||
OPM_THROW(std::runtime_error, "Invalid set of permeability fields given.");
|
OPM_THROW(std::runtime_error, "Invalid set of permeability fields given.");
|
||||||
}
|
}
|
||||||
ASSERT (tensor.size() == 1);
|
assert(tensor.size() == 1);
|
||||||
for (int i = 0; i < 9; ++i) { kmap[i] = 0; }
|
for (int i = 0; i < 9; ++i) { kmap[i] = 0; }
|
||||||
|
|
||||||
enum { xx, xy, xz, // 0, 1, 2
|
enum { xx, xy, xz, // 0, 1, 2
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ namespace Opm
|
|||||||
double* kr,
|
double* kr,
|
||||||
double* dkrds) const
|
double* dkrds) const
|
||||||
{
|
{
|
||||||
ASSERT (cells != 0);
|
assert(cells != 0);
|
||||||
|
|
||||||
const int np = phase_usage_.num_phases;
|
const int np = phase_usage_.num_phases;
|
||||||
if (dkrds) {
|
if (dkrds) {
|
||||||
@@ -203,7 +203,7 @@ namespace Opm
|
|||||||
double* pc,
|
double* pc,
|
||||||
double* dpcds) const
|
double* dpcds) const
|
||||||
{
|
{
|
||||||
ASSERT (cells != 0);
|
assert(cells != 0);
|
||||||
|
|
||||||
const int np = phase_usage_.num_phases;
|
const int np = phase_usage_.num_phases;
|
||||||
if (dpcds) {
|
if (dpcds) {
|
||||||
@@ -233,7 +233,7 @@ namespace Opm
|
|||||||
double* smin,
|
double* smin,
|
||||||
double* smax) const
|
double* smax) const
|
||||||
{
|
{
|
||||||
ASSERT (cells != 0);
|
assert(cells != 0);
|
||||||
|
|
||||||
const int np = phase_usage_.num_phases;
|
const int np = phase_usage_.num_phases;
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace Opm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const int n = cells.size();
|
const int n = cells.size();
|
||||||
ASSERT(n > 0);
|
assert(n > 0);
|
||||||
std::vector<double> smin(num_phases_*n);
|
std::vector<double> smin(num_phases_*n);
|
||||||
std::vector<double> smax(num_phases_*n);
|
std::vector<double> smax(num_phases_*n);
|
||||||
props.satRange(n, &cells[0], &smin[0], &smax[0]);
|
props.satRange(n, &cells[0], &smin[0], &smax[0]);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ namespace Opm
|
|||||||
Density(const BlackoilPropertiesInterface& props) : props_(props) {}
|
Density(const BlackoilPropertiesInterface& props) : props_(props) {}
|
||||||
double operator()(const double pressure, const int phase)
|
double operator()(const double pressure, const int phase)
|
||||||
{
|
{
|
||||||
ASSERT(props_.numPhases() == 2);
|
assert(props_.numPhases() == 2);
|
||||||
const double surfvol[2][2] = { { 1.0, 0.0 },
|
const double surfvol[2][2] = { { 1.0, 0.0 },
|
||||||
{ 0.0, 1.0 } };
|
{ 0.0, 1.0 } };
|
||||||
// We do not handle multi-region PVT/EQUIL at this point.
|
// We do not handle multi-region PVT/EQUIL at this point.
|
||||||
@@ -183,7 +183,7 @@ namespace Opm
|
|||||||
const double datum_p,
|
const double datum_p,
|
||||||
State& state)
|
State& state)
|
||||||
{
|
{
|
||||||
ASSERT(props.numPhases() == 2);
|
assert(props.numPhases() == 2);
|
||||||
|
|
||||||
// Obtain max and min z for which we will need to compute p.
|
// Obtain max and min z for which we will need to compute p.
|
||||||
const int num_cells = grid.number_of_cells;
|
const int num_cells = grid.number_of_cells;
|
||||||
|
|||||||
@@ -651,7 +651,7 @@ namespace Opm
|
|||||||
limiter = 0.0;
|
limiter = 0.0;
|
||||||
basis_func_->addConstant(min_upstream_tof - tof_c, tof + num_basis*cell);
|
basis_func_->addConstant(min_upstream_tof - tof_c, tof + num_basis*cell);
|
||||||
}
|
}
|
||||||
ASSERT(limiter >= 0.0);
|
assert(limiter >= 0.0);
|
||||||
|
|
||||||
// Actually do the limiting (if applicable).
|
// Actually do the limiting (if applicable).
|
||||||
if (limiter < 1.0) {
|
if (limiter < 1.0) {
|
||||||
@@ -674,7 +674,7 @@ namespace Opm
|
|||||||
// any limiting applied to its upstream cells.
|
// any limiting applied to its upstream cells.
|
||||||
const std::vector<int>& seq = ReorderSolverInterface::sequence();
|
const std::vector<int>& seq = ReorderSolverInterface::sequence();
|
||||||
const int nc = seq.size();
|
const int nc = seq.size();
|
||||||
ASSERT(nc == grid_.number_of_cells);
|
assert(nc == grid_.number_of_cells);
|
||||||
for (int i = 0; i < nc; ++i) {
|
for (int i = 0; i < nc; ++i) {
|
||||||
const int cell = seq[i];
|
const int cell = seq[i];
|
||||||
applyLimiter(cell, tof_coeff_);
|
applyLimiter(cell, tof_coeff_);
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ namespace Opm
|
|||||||
// Identify the adjacent faces of the upwind cell.
|
// Identify the adjacent faces of the upwind cell.
|
||||||
const int* face_nodes_beg = grid_.face_nodes + grid_.face_nodepos[face];
|
const int* face_nodes_beg = grid_.face_nodes + grid_.face_nodepos[face];
|
||||||
const int* face_nodes_end = grid_.face_nodes + grid_.face_nodepos[face + 1];
|
const int* face_nodes_end = grid_.face_nodes + grid_.face_nodepos[face + 1];
|
||||||
ASSERT(face_nodes_end - face_nodes_beg == 2 || grid_.dimensions != 2);
|
assert(face_nodes_end - face_nodes_beg == 2 || grid_.dimensions != 2);
|
||||||
adj_faces_.clear();
|
adj_faces_.clear();
|
||||||
for (int hf = grid_.cell_facepos[upwind_cell]; hf < grid_.cell_facepos[upwind_cell + 1]; ++hf) {
|
for (int hf = grid_.cell_facepos[upwind_cell]; hf < grid_.cell_facepos[upwind_cell + 1]; ++hf) {
|
||||||
const int f = grid_.cell_faces[hf];
|
const int f = grid_.cell_faces[hf];
|
||||||
@@ -358,7 +358,7 @@ namespace Opm
|
|||||||
const int num_adj = adj_faces_.size();
|
const int num_adj = adj_faces_.size();
|
||||||
// The assertion below only holds if the grid is edge-conformal.
|
// The assertion below only holds if the grid is edge-conformal.
|
||||||
// No longer testing, since method no longer requires it.
|
// No longer testing, since method no longer requires it.
|
||||||
// ASSERT(num_adj == face_nodes_end - face_nodes_beg);
|
// assert(num_adj == face_nodes_end - face_nodes_beg);
|
||||||
const double flux_face = std::fabs(darcyflux_[face]);
|
const double flux_face = std::fabs(darcyflux_[face]);
|
||||||
face_term = 0.0;
|
face_term = 0.0;
|
||||||
cell_term_factor = 0.0;
|
cell_term_factor = 0.0;
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ namespace Opm
|
|||||||
const int nc = grid_.number_of_cells;
|
const int nc = grid_.number_of_cells;
|
||||||
const int nf = grid_.number_of_faces;
|
const int nf = grid_.number_of_faces;
|
||||||
const int np = props_.numPhases();
|
const int np = props_.numPhases();
|
||||||
ASSERT(np == 2);
|
assert(np == 2);
|
||||||
const int dim = grid_.dimensions;
|
const int dim = grid_.dimensions;
|
||||||
density_.resize(nc*np);
|
density_.resize(nc*np);
|
||||||
props_.density(grid_.number_of_cells, &A_[0], &density_[0]);
|
props_.density(grid_.number_of_cells, &A_[0], &density_[0]);
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ namespace Opm
|
|||||||
const std::vector<int>::size_type nc = cells.size();
|
const std::vector<int>::size_type nc = cells.size();
|
||||||
const std::size_t np = props.numPhases();
|
const std::size_t np = props.numPhases();
|
||||||
|
|
||||||
ASSERT (s.size() == nc * np);
|
assert(s.size() == nc * np);
|
||||||
|
|
||||||
std::vector<double>(nc * np, 0.0).swap(pmobc );
|
std::vector<double>(nc * np, 0.0).swap(pmobc );
|
||||||
double* dpmobc = 0;
|
double* dpmobc = 0;
|
||||||
@@ -382,7 +382,7 @@ namespace Opm
|
|||||||
<< perf_rate/Opm::unit::day << " m^3/day." << std::endl;
|
<< perf_rate/Opm::unit::day << " m^3/day." << std::endl;
|
||||||
perf_rate = 0.0;
|
perf_rate = 0.0;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(std::fabs(comp_frac[0] + comp_frac[1] - 1.0) < 1e-6);
|
assert(std::fabs(comp_frac[0] + comp_frac[1] - 1.0) < 1e-6);
|
||||||
perf_rate *= comp_frac[0];
|
perf_rate *= comp_frac[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -555,7 +555,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
const int np = wells.number_of_phases;
|
const int np = wells.number_of_phases;
|
||||||
const int nw = wells.number_of_wells;
|
const int nw = wells.number_of_wells;
|
||||||
ASSERT(int(flow_rates_per_well_cell.size()) == wells.well_connpos[nw]);
|
assert(int(flow_rates_per_well_cell.size()) == wells.well_connpos[nw]);
|
||||||
phase_flow_per_well.resize(nw * np);
|
phase_flow_per_well.resize(nw * np);
|
||||||
for (int wix = 0; wix < nw; ++wix) {
|
for (int wix = 0; wix < nw; ++wix) {
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
for (int phase = 0; phase < np; ++phase) {
|
||||||
@@ -598,7 +598,7 @@ namespace Opm
|
|||||||
const std::vector<double>& well_perfrates)
|
const std::vector<double>& well_perfrates)
|
||||||
{
|
{
|
||||||
int nw = well_bhp.size();
|
int nw = well_bhp.size();
|
||||||
ASSERT(nw == wells.number_of_wells);
|
assert(nw == wells.number_of_wells);
|
||||||
int np = props.numPhases();
|
int np = props.numPhases();
|
||||||
const int max_np = 3;
|
const int max_np = 3;
|
||||||
if (np > max_np) {
|
if (np > max_np) {
|
||||||
@@ -657,7 +657,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
// TODO: refactor, since this is almost identical to the other push().
|
// TODO: refactor, since this is almost identical to the other push().
|
||||||
int nw = well_bhp.size();
|
int nw = well_bhp.size();
|
||||||
ASSERT(nw == wells.number_of_wells);
|
assert(nw == wells.number_of_wells);
|
||||||
int np = props.numPhases();
|
int np = props.numPhases();
|
||||||
const int max_np = 3;
|
const int max_np = 3;
|
||||||
if (np > max_np) {
|
if (np > max_np) {
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ namespace Opm
|
|||||||
const int nc = props.numCells();
|
const int nc = props.numCells();
|
||||||
const int np = props.numPhases();
|
const int np = props.numPhases();
|
||||||
|
|
||||||
ASSERT (int(s.size()) == nc * np);
|
assert(int(s.size()) == nc * np);
|
||||||
|
|
||||||
std::vector<double> mu(nc*np);
|
std::vector<double> mu(nc*np);
|
||||||
props.viscosity(nc, &p[0], &z[0], &cells[0], &mu[0], 0);
|
props.viscosity(nc, &p[0], &z[0], &cells[0], &mu[0], 0);
|
||||||
@@ -318,7 +318,7 @@ namespace Opm
|
|||||||
<< perf_rate/Opm::unit::day << " m^3/day." << std::endl;
|
<< perf_rate/Opm::unit::day << " m^3/day." << std::endl;
|
||||||
perf_rate = 0.0;
|
perf_rate = 0.0;
|
||||||
} else {
|
} else {
|
||||||
ASSERT(std::fabs(comp_frac[0] + comp_frac[1] - 1.0) < 1e-6);
|
assert(std::fabs(comp_frac[0] + comp_frac[1] - 1.0) < 1e-6);
|
||||||
perf_rate *= comp_frac[0]; // Water reservoir volume rate.
|
perf_rate *= comp_frac[0]; // Water reservoir volume rate.
|
||||||
props.matrix(1, &well_state.perfPress()[perf], comp_frac, &perf_cell, &A[0], 0);
|
props.matrix(1, &well_state.perfPress()[perf], comp_frac, &perf_cell, &A[0], 0);
|
||||||
perf_rate *= A[0]; // Water surface volume rate.
|
perf_rate *= A[0]; // Water surface volume rate.
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ namespace Opm
|
|||||||
if (parent == NULL) {
|
if (parent == NULL) {
|
||||||
OPM_THROW(std::runtime_error, "Parent with name = " << parent_name << " not found.");
|
OPM_THROW(std::runtime_error, "Parent with name = " << parent_name << " not found.");
|
||||||
}
|
}
|
||||||
ASSERT(!parent->isLeafNode());
|
assert(!parent->isLeafNode());
|
||||||
static_cast<WellsGroup*>(parent)->addChild(child_node);
|
static_cast<WellsGroup*>(parent)->addChild(child_node);
|
||||||
if (child_node->isLeafNode()) {
|
if (child_node->isLeafNode()) {
|
||||||
leaf_nodes_.push_back(static_cast<WellNode*>(child_node.get()));
|
leaf_nodes_.push_back(static_cast<WellNode*>(child_node.get()));
|
||||||
|
|||||||
@@ -788,7 +788,7 @@ namespace Opm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wells_->type[self_index_] != INJECTOR) {
|
if (wells_->type[self_index_] != INJECTOR) {
|
||||||
ASSERT(target == 0.0);
|
assert(target == 0.0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -865,7 +865,7 @@ namespace Opm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wells_->type[self_index_] != PRODUCER) {
|
if (wells_->type[self_index_] != PRODUCER) {
|
||||||
ASSERT(target == 0.0);
|
assert(target == 0.0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// We're a producer, so we need to negate the input
|
// We're a producer, so we need to negate the input
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ namespace Opm
|
|||||||
|
|
||||||
// Set up reference depths that were defaulted. Count perfs.
|
// Set up reference depths that were defaulted. Count perfs.
|
||||||
int num_perfs = 0;
|
int num_perfs = 0;
|
||||||
ASSERT(grid.dimensions == 3);
|
assert(grid.dimensions == 3);
|
||||||
for (int w = 0; w < num_wells; ++w) {
|
for (int w = 0; w < num_wells; ++w) {
|
||||||
num_perfs += wellperf_data[w].size();
|
num_perfs += wellperf_data[w].size();
|
||||||
if (well_data[w].reference_bhp_depth < 0.0) {
|
if (well_data[w].reference_bhp_depth < 0.0) {
|
||||||
@@ -493,7 +493,7 @@ namespace Opm
|
|||||||
for (int wix = 0; wix < num_wells; ++wix) {
|
for (int wix = 0; wix < num_wells; ++wix) {
|
||||||
if (well_names[wix].compare(0,len, name) == 0) { //equal
|
if (well_names[wix].compare(0,len, name) == 0) { //equal
|
||||||
well_found = true;
|
well_found = true;
|
||||||
ASSERT(well_data[wix].type == w_->type[wix]);
|
assert(well_data[wix].type == w_->type[wix]);
|
||||||
if (well_data[wix].type != INJECTOR) {
|
if (well_data[wix].type != INJECTOR) {
|
||||||
OPM_THROW(std::runtime_error, "Found WCONINJE entry for a non-injector well: " << well_names[wix]);
|
OPM_THROW(std::runtime_error, "Found WCONINJE entry for a non-injector well: " << well_names[wix]);
|
||||||
}
|
}
|
||||||
@@ -604,7 +604,7 @@ namespace Opm
|
|||||||
for (int wix = 0; wix < num_wells; ++wix) {
|
for (int wix = 0; wix < num_wells; ++wix) {
|
||||||
if (well_names[wix].compare(0,len, name) == 0) { //equal
|
if (well_names[wix].compare(0,len, name) == 0) { //equal
|
||||||
well_found = true;
|
well_found = true;
|
||||||
ASSERT(well_data[wix].type == w_->type[wix]);
|
assert(well_data[wix].type == w_->type[wix]);
|
||||||
if (well_data[wix].type != PRODUCER) {
|
if (well_data[wix].type != PRODUCER) {
|
||||||
OPM_THROW(std::runtime_error, "Found WCONPROD entry for a non-producer well: " << well_names[wix]);
|
OPM_THROW(std::runtime_error, "Found WCONPROD entry for a non-producer well: " << well_names[wix]);
|
||||||
}
|
}
|
||||||
@@ -758,13 +758,13 @@ namespace Opm
|
|||||||
if (cur_ctrl >= 0) {
|
if (cur_ctrl >= 0) {
|
||||||
cur_ctrl = ~cur_ctrl;
|
cur_ctrl = ~cur_ctrl;
|
||||||
}
|
}
|
||||||
ASSERT(w_->ctrls[index]->current < 0);
|
assert(w_->ctrls[index]->current < 0);
|
||||||
} else if (line.openshutflag_ == "OPEN") {
|
} else if (line.openshutflag_ == "OPEN") {
|
||||||
int& cur_ctrl = w_->ctrls[index]->current;
|
int& cur_ctrl = w_->ctrls[index]->current;
|
||||||
if (cur_ctrl < 0) {
|
if (cur_ctrl < 0) {
|
||||||
cur_ctrl = ~cur_ctrl;
|
cur_ctrl = ~cur_ctrl;
|
||||||
}
|
}
|
||||||
ASSERT(w_->ctrls[index]->current >= 0);
|
assert(w_->ctrls[index]->current >= 0);
|
||||||
} else {
|
} else {
|
||||||
OPM_THROW(std::runtime_error, "Unknown Open/close keyword: \"" << line.openshutflag_<< "\". Allowed values: OPEN, SHUT.");
|
OPM_THROW(std::runtime_error, "Unknown Open/close keyword: \"" << line.openshutflag_<< "\". Allowed values: OPEN, SHUT.");
|
||||||
}
|
}
|
||||||
@@ -797,7 +797,7 @@ namespace Opm
|
|||||||
std::string name = lines[i].well_;
|
std::string name = lines[i].well_;
|
||||||
const int wix = well_names_to_index[name];
|
const int wix = well_names_to_index[name];
|
||||||
WellNode& wellnode = *well_collection_.getLeafNodes()[wix];
|
WellNode& wellnode = *well_collection_.getLeafNodes()[wix];
|
||||||
ASSERT(wellnode.name() == name);
|
assert(wellnode.name() == name);
|
||||||
if (well_data[wix].type == PRODUCER) {
|
if (well_data[wix].type == PRODUCER) {
|
||||||
wellnode.prodSpec().guide_rate_ = lines[i].guide_rate_;
|
wellnode.prodSpec().guide_rate_ = lines[i].guide_rate_;
|
||||||
if (lines[i].phase_ == "OIL") {
|
if (lines[i].phase_ == "OIL") {
|
||||||
|
|||||||
Reference in New Issue
Block a user