mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
convert THROW to OPM_THROW
This commit is contained in:
@@ -90,7 +90,7 @@ main(int argc, char** argv)
|
||||
std::istream_iterator<double> end;
|
||||
porevol.assign(beg, end); // Now contains poro.
|
||||
if (int(porevol.size()) != grid.number_of_cells) {
|
||||
THROW("Size of porosity field differs from number of cells.");
|
||||
OPM_THROW(std::runtime_error, "Size of porosity field differs from number of cells.");
|
||||
}
|
||||
for (int i = 0; i < grid.number_of_cells; ++i) {
|
||||
porevol[i] *= grid.cell_volumes[i];
|
||||
@@ -105,7 +105,7 @@ main(int argc, char** argv)
|
||||
std::istream_iterator<double> end;
|
||||
flux.assign(beg, end);
|
||||
if (int(flux.size()) != grid.number_of_faces) {
|
||||
THROW("Size of flux field differs from number of faces.");
|
||||
OPM_THROW(std::runtime_error, "Size of flux field differs from number of faces.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ main(int argc, char** argv)
|
||||
std::istream_iterator<double> end;
|
||||
src.assign(beg, end);
|
||||
if (int(src.size()) != grid.number_of_cells) {
|
||||
THROW("Size of source term field differs from number of cells.");
|
||||
OPM_THROW(std::runtime_error, "Size of source term field differs from number of cells.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ main(int argc, char** argv)
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
THROW("Creating directories failed: " << fpath);
|
||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||
}
|
||||
param.writeParam(output_dir + "/simulation.param");
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Opm
|
||||
#elif HAVE_DUNE_ISTL
|
||||
solver_.reset(new LinearSolverIstl);
|
||||
#else
|
||||
THROW("No linear solver available, you must have UMFPACK or dune-istl installed to use LinearSolverFactory.");
|
||||
OPM_THROW(std::runtime_error, "No linear solver available, you must have UMFPACK or dune-istl installed to use LinearSolverFactory.");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -71,11 +71,11 @@ namespace Opm
|
||||
}
|
||||
|
||||
else {
|
||||
THROW("Linear solver " << ls << " is unknown.");
|
||||
OPM_THROW(std::runtime_error, "Linear solver " << ls << " is unknown.");
|
||||
}
|
||||
|
||||
if (! solver_) {
|
||||
THROW("Linear solver " << ls << " is not enabled in "
|
||||
OPM_THROW(std::runtime_error, "Linear solver " << ls << " is not enabled in "
|
||||
"this configuration.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Opm
|
||||
singular_(false)
|
||||
{
|
||||
if (wells_ && (wells_->number_of_phases != props.numPhases())) {
|
||||
THROW("Inconsistent number of phases specified (wells vs. props): "
|
||||
OPM_THROW(std::runtime_error, "Inconsistent number of phases specified (wells vs. props): "
|
||||
<< wells_->number_of_phases << " != " << props.numPhases());
|
||||
}
|
||||
const int num_dofs = grid.number_of_cells + (wells ? wells->number_of_wells : 0);
|
||||
@@ -179,7 +179,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
if ((iter == maxiter_) && (res_norm > residual_tol_) && (inc_norm > change_tol_)) {
|
||||
THROW("CompressibleTpfa::solve() failed to converge in " << maxiter_ << " iterations.");
|
||||
OPM_THROW(std::runtime_error, "CompressibleTpfa::solve() failed to converge in " << maxiter_ << " iterations.");
|
||||
}
|
||||
|
||||
std::cout << "Solved pressure in " << iter << " iterations." << std::endl;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Opm
|
||||
{
|
||||
bc_ = flow_conditions_construct(0);
|
||||
if (!bc_) {
|
||||
THROW("Failed to construct FlowBoundaryConditions struct.");
|
||||
OPM_THROW(std::runtime_error, "Failed to construct FlowBoundaryConditions struct.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Opm
|
||||
{
|
||||
int ok = flow_conditions_append(type, face, value, bc_);
|
||||
if (!ok) {
|
||||
THROW("Failed to append boundary condition for face " << face);
|
||||
OPM_THROW(std::runtime_error, "Failed to append boundary condition for face " << face);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Opm
|
||||
findSideFaces(grid, side, faces);
|
||||
int ok = flow_conditions_append_multi(BC_PRESSURE, faces.size(), &faces[0], pressure, bc_);
|
||||
if (!ok) {
|
||||
THROW("Failed to append pressure boundary conditions for side " << sideString(side));
|
||||
OPM_THROW(std::runtime_error, "Failed to append pressure boundary conditions for side " << sideString(side));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Opm
|
||||
const double face_flux = flux * grid.face_areas[faces[fi]] / tot_area;
|
||||
int ok = flow_conditions_append(BC_FLUX_TOTVOL, faces[fi], face_flux, bc_);
|
||||
if (!ok) {
|
||||
THROW("Failed to append flux boundary conditions for face " << faces[fi] << " on side " << sideString(side));
|
||||
OPM_THROW(std::runtime_error, "Failed to append flux boundary conditions for face " << faces[fi] << " on side " << sideString(side));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ namespace Opm
|
||||
case FlowBCManager::Ymax: return "Ymax";
|
||||
case FlowBCManager::Zmin: return "Zmin";
|
||||
case FlowBCManager::Zmax: return "Zmax";
|
||||
default: THROW("Unknown side tag " << s);
|
||||
default: OPM_THROW(std::runtime_error, "Unknown side tag " << s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace Opm
|
||||
std::vector<int>& faces)
|
||||
{
|
||||
if (grid.cell_facetag == 0) {
|
||||
THROW("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,
|
||||
@@ -227,7 +227,7 @@ namespace Opm
|
||||
// Face is on boundary.
|
||||
faces.push_back(f);
|
||||
} else {
|
||||
THROW("Face not on boundary, even with correct tag and boundary cell. This should not occur.");
|
||||
OPM_THROW(std::runtime_error, "Face not on boundary, even with correct tag and boundary cell. This should not occur.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace Opm
|
||||
UnstructuredGrid* gg = const_cast<UnstructuredGrid*>(&grid_);
|
||||
int ok = ifs_tpfa_assemble(gg, &forces_, &trans_[0], &gpress_omegaweighted_[0], h_);
|
||||
if (!ok) {
|
||||
THROW("Failed assembling pressure system.");
|
||||
OPM_THROW(std::runtime_error, "Failed assembling pressure system.");
|
||||
}
|
||||
|
||||
// Solve.
|
||||
@@ -269,7 +269,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
if ((iter == maxiter_) && (res_norm > residual_tol_) && (inc_norm > change_tol_)) {
|
||||
THROW("IncompTpfa::solve() failed to converge in " << maxiter_ << " iterations.");
|
||||
OPM_THROW(std::runtime_error, "IncompTpfa::solve() failed to converge in " << maxiter_ << " iterations.");
|
||||
}
|
||||
|
||||
std::cout << "Solved pressure in " << iter << " iterations." << std::endl;
|
||||
@@ -287,7 +287,7 @@ namespace Opm
|
||||
void IncompTpfa::computeStaticData()
|
||||
{
|
||||
if (wells_ && (wells_->number_of_phases != props_.numPhases())) {
|
||||
THROW("Inconsistent number of phases specified (wells vs. props): "
|
||||
OPM_THROW(std::runtime_error, "Inconsistent number of phases specified (wells vs. props): "
|
||||
<< wells_->number_of_phases << " != " << props_.numPhases());
|
||||
}
|
||||
const int num_dofs = grid_.number_of_cells + (wells_ ? wells_->number_of_wells : 0);
|
||||
@@ -406,7 +406,7 @@ namespace Opm
|
||||
&porevol_[0], &rock_comp_[0], dt, pressures,
|
||||
&initial_porevol_[0], h_);
|
||||
if (!ok) {
|
||||
THROW("Failed assembling pressure system.");
|
||||
OPM_THROW(std::runtime_error, "Failed assembling pressure system.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Opm
|
||||
pvt_.init(param);
|
||||
satprops_.init(param);
|
||||
if (pvt_.numPhases() != satprops_.numPhases()) {
|
||||
THROW("BlackoilPropertiesBasic::BlackoilPropertiesBasic() - Inconsistent number of phases in pvt data ("
|
||||
OPM_THROW(std::runtime_error, "BlackoilPropertiesBasic::BlackoilPropertiesBasic() - Inconsistent number of phases in pvt data ("
|
||||
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace Opm
|
||||
double* dmudp) const
|
||||
{
|
||||
if (dmudp) {
|
||||
THROW("BlackoilPropertiesBasic::viscosity() -- derivatives of viscosity not yet implemented.");
|
||||
OPM_THROW(std::runtime_error, "BlackoilPropertiesBasic::viscosity() -- derivatives of viscosity not yet implemented.");
|
||||
} else {
|
||||
pvt_.mu(n, p, z, mu);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Opm
|
||||
ptr->init(deck, grid, 200);
|
||||
|
||||
if (pvt_.numPhases() != satprops_->numPhases()) {
|
||||
THROW("BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||
OPM_THROW(std::runtime_error, "BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_->numPhases() << ").");
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace Opm
|
||||
const int sat_samples = param.getDefault("sat_tab_size", 200);
|
||||
std::string threephase_model = param.getDefault<std::string>("threephase_model", "simple");
|
||||
if (deck.hasField("ENDSCALE") && threephase_model != "simple") {
|
||||
THROW("Sorry, end point scaling currently available for the 'simple' model only.");
|
||||
OPM_THROW(std::runtime_error, "Sorry, end point scaling currently available for the 'simple' model only.");
|
||||
}
|
||||
if (sat_samples > 1) {
|
||||
if (threephase_model == "stone2") {
|
||||
@@ -78,7 +78,7 @@ namespace Opm
|
||||
satprops_.reset(ptr);
|
||||
ptr->init(deck, grid, sat_samples);
|
||||
} else {
|
||||
THROW("Unknown threephase_model: " << threephase_model);
|
||||
OPM_THROW(std::runtime_error, "Unknown threephase_model: " << threephase_model);
|
||||
}
|
||||
} else {
|
||||
if (threephase_model == "stone2") {
|
||||
@@ -97,12 +97,12 @@ namespace Opm
|
||||
satprops_.reset(ptr);
|
||||
ptr->init(deck, grid, sat_samples);
|
||||
} else {
|
||||
THROW("Unknown threephase_model: " << threephase_model);
|
||||
OPM_THROW(std::runtime_error, "Unknown threephase_model: " << threephase_model);
|
||||
}
|
||||
}
|
||||
|
||||
if (pvt_.numPhases() != satprops_->numPhases()) {
|
||||
THROW("BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||
OPM_THROW(std::runtime_error, "BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_->numPhases() << ").");
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ namespace Opm
|
||||
double* dmudp) const
|
||||
{
|
||||
if (dmudp) {
|
||||
THROW("BlackoilPropertiesFromDeck::viscosity() -- derivatives of viscosity not yet implemented.");
|
||||
OPM_THROW(std::runtime_error, "BlackoilPropertiesFromDeck::viscosity() -- derivatives of viscosity not yet implemented.");
|
||||
} else {
|
||||
pvt_.mu(n, p, z, mu);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Opm
|
||||
pvt_.init(param);
|
||||
satprops_.init(param);
|
||||
if (pvt_.numPhases() != satprops_.numPhases()) {
|
||||
THROW("IncompPropertiesBasic::IncompPropertiesBasic() - Inconsistent number of phases in pvt data ("
|
||||
OPM_THROW(std::runtime_error, "IncompPropertiesBasic::IncompPropertiesBasic() - Inconsistent number of phases in pvt data ("
|
||||
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");
|
||||
}
|
||||
viscosity_.resize(pvt_.numPhases());
|
||||
@@ -60,7 +60,7 @@ namespace Opm
|
||||
pvt_.init(num_phases, rho, mu);
|
||||
satprops_.init(num_phases, relpermfunc);
|
||||
if (pvt_.numPhases() != satprops_.numPhases()) {
|
||||
THROW("IncompPropertiesBasic::IncompPropertiesBasic() - Inconsistent number of phases in pvt data ("
|
||||
OPM_THROW(std::runtime_error, "IncompPropertiesBasic::IncompPropertiesBasic() - Inconsistent number of phases in pvt data ("
|
||||
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");
|
||||
}
|
||||
viscosity_.resize(pvt_.numPhases());
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Opm
|
||||
pvt_.init(deck);
|
||||
satprops_.init(deck, grid, 200);
|
||||
if (pvt_.numPhases() != satprops_.numPhases()) {
|
||||
THROW("IncompPropertiesFromDeck::IncompPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||
OPM_THROW(std::runtime_error, "IncompPropertiesFromDeck::IncompPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
|
||||
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ namespace Opm
|
||||
|
||||
// Only 2 or 3 phase systems handled.
|
||||
if (pu.num_phases < 2 || pu.num_phases > 3) {
|
||||
THROW("Cannot handle cases with " << pu.num_phases << " phases.");
|
||||
OPM_THROW(std::runtime_error, "Cannot handle cases with " << pu.num_phases << " phases.");
|
||||
}
|
||||
|
||||
// We need oil systems, since we do not support the keywords needed for
|
||||
// water-gas systems.
|
||||
if (!pu.phase_used[BlackoilPhases::Liquid]) {
|
||||
THROW("Cannot handle cases with no OIL, i.e. water-gas systems.");
|
||||
OPM_THROW(std::runtime_error, "Cannot handle cases with no OIL, i.e. water-gas systems.");
|
||||
}
|
||||
|
||||
return pu;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Opm
|
||||
{
|
||||
int num_phases = param.getDefault("num_phases", 2);
|
||||
if (num_phases > 3 || num_phases < 1) {
|
||||
THROW("PvtPropertiesBasic::init() illegal num_phases: " << num_phases);
|
||||
OPM_THROW(std::runtime_error, "PvtPropertiesBasic::init() illegal num_phases: " << num_phases);
|
||||
}
|
||||
density_.resize(num_phases);
|
||||
viscosity_.resize(num_phases);
|
||||
@@ -65,7 +65,7 @@ namespace Opm
|
||||
const std::vector<double>& visc)
|
||||
{
|
||||
if (num_phases > 3 || num_phases < 1) {
|
||||
THROW("PvtPropertiesBasic::init() illegal num_phases: " << num_phases);
|
||||
OPM_THROW(std::runtime_error, "PvtPropertiesBasic::init() illegal num_phases: " << num_phases);
|
||||
}
|
||||
// We currently do not allow the user to set B.
|
||||
formation_volume_factor_.clear();
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Opm
|
||||
if (phase_usage.phase_used[PhaseUsage::Vapour] ||
|
||||
!phase_usage.phase_used[PhaseUsage::Aqua] ||
|
||||
!phase_usage.phase_used[PhaseUsage::Liquid]) {
|
||||
THROW("PvtPropertiesIncompFromDeck::init() -- must have gas and oil phases (only) in deck input.\n");
|
||||
OPM_THROW(std::runtime_error, "PvtPropertiesIncompFromDeck::init() -- must have gas and oil phases (only) in deck input.\n");
|
||||
}
|
||||
|
||||
// Surface densities. Accounting for different orders in eclipse and our code.
|
||||
@@ -55,7 +55,7 @@ namespace Opm
|
||||
surface_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] = d[ECL_water];
|
||||
surface_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] = d[ECL_oil];
|
||||
} else {
|
||||
THROW("Input is missing DENSITY\n");
|
||||
OPM_THROW(std::runtime_error, "Input is missing DENSITY\n");
|
||||
}
|
||||
|
||||
// Make reservoir densities the same as surface densities initially.
|
||||
@@ -73,7 +73,7 @@ namespace Opm
|
||||
} else {
|
||||
// Eclipse 100 default.
|
||||
// viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = 0.5*Opm::prefix::centi*Opm::unit::Poise;
|
||||
THROW("Input is missing PVTW\n");
|
||||
OPM_THROW(std::runtime_error, "Input is missing PVTW\n");
|
||||
}
|
||||
|
||||
// Oil viscosity.
|
||||
@@ -85,7 +85,7 @@ namespace Opm
|
||||
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] /= pvcdo[1];
|
||||
viscosity_[phase_usage.phase_pos[PhaseUsage::Liquid]] = pvcdo[3];
|
||||
} else {
|
||||
THROW("Input is missing PVCDO\n");
|
||||
OPM_THROW(std::runtime_error, "Input is missing PVCDO\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Opm
|
||||
if (deck.hasField("ROCKTAB")) {
|
||||
const table_t& rt = deck.getROCKTAB().rocktab_;
|
||||
if (rt.size() != 1) {
|
||||
THROW("Can only handle a single region in ROCKTAB.");
|
||||
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB.");
|
||||
}
|
||||
const int n = rt[0][0].size();
|
||||
p_.resize(n);
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Opm
|
||||
std::array<int,9> kmap;
|
||||
PermeabilityKind pkind = fillTensor(parser, tensor, kmap);
|
||||
if (pkind == Invalid) {
|
||||
THROW("Invalid permeability field.");
|
||||
OPM_THROW(std::runtime_error, "Invalid permeability field.");
|
||||
}
|
||||
|
||||
// Assign permeability values only if such values are
|
||||
@@ -271,7 +271,7 @@ namespace Opm
|
||||
{
|
||||
PermeabilityKind kind = classifyPermeability(parser);
|
||||
if (kind == Invalid) {
|
||||
THROW("Invalid set of permeability fields given.");
|
||||
OPM_THROW(std::runtime_error, "Invalid set of permeability fields given.");
|
||||
}
|
||||
ASSERT (tensor.size() == 1);
|
||||
for (int i = 0; i < 9; ++i) { kmap[i] = 0; }
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Opm
|
||||
{
|
||||
int num_phases = param.getDefault("num_phases", 2);
|
||||
if (num_phases > 2 || num_phases < 1) {
|
||||
THROW("SaturationPropsBasic::init() illegal num_phases: " << num_phases);
|
||||
OPM_THROW(std::runtime_error, "SaturationPropsBasic::init() illegal num_phases: " << num_phases);
|
||||
}
|
||||
num_phases_ = num_phases;
|
||||
//std::string rpf = param.getDefault("relperm_func", std::string("Unset"));
|
||||
@@ -120,14 +120,14 @@ namespace Opm
|
||||
if (rpf == "Constant") {
|
||||
relperm_func_ = Constant;
|
||||
if(num_phases!=1){
|
||||
THROW("Constant relperm with more than one phase???");
|
||||
OPM_THROW(std::runtime_error, "Constant relperm with more than one phase???");
|
||||
}
|
||||
} else if (rpf == "Linear") {
|
||||
relperm_func_ = Linear;
|
||||
} else if (rpf == "Quadratic") {
|
||||
relperm_func_ = Quadratic;
|
||||
} else {
|
||||
THROW("SaturationPropsBasic::init() illegal relperm_func: " << rpf);
|
||||
OPM_THROW(std::runtime_error, "SaturationPropsBasic::init() illegal relperm_func: " << rpf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Opm
|
||||
break;
|
||||
}
|
||||
default:
|
||||
THROW("SaturationPropsBasic::relperm() unhandled relperm func type: " << relperm_func_);
|
||||
OPM_THROW(std::runtime_error, "SaturationPropsBasic::relperm() unhandled relperm func type: " << relperm_func_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Opm
|
||||
// Extract input data.
|
||||
// Oil phase should be active.
|
||||
if (!phase_usage_.phase_used[Liquid]) {
|
||||
THROW("SaturationPropsFromDeck::init() -- oil phase must be active.");
|
||||
OPM_THROW(std::runtime_error, "SaturationPropsFromDeck::init() -- oil phase must be active.");
|
||||
}
|
||||
|
||||
// Obtain SATNUM, if it exists, and create cell_to_func_.
|
||||
@@ -77,19 +77,19 @@ namespace Opm
|
||||
const SWOF::table_t& swof_table = deck.getSWOF().swof_;
|
||||
num_tables = swof_table.size();
|
||||
if (num_tables < satfuncs_expected) {
|
||||
THROW("Found " << num_tables << " SWOF tables, SATNUM specifies at least " << satfuncs_expected);
|
||||
OPM_THROW(std::runtime_error, "Found " << num_tables << " SWOF tables, SATNUM specifies at least " << satfuncs_expected);
|
||||
}
|
||||
}
|
||||
if (phase_usage_.phase_used[Vapour]) {
|
||||
const SGOF::table_t& sgof_table = deck.getSGOF().sgof_;
|
||||
int num_sgof_tables = sgof_table.size();
|
||||
if (num_sgof_tables < satfuncs_expected) {
|
||||
THROW("Found " << num_tables << " SGOF tables, SATNUM specifies at least " << satfuncs_expected);
|
||||
OPM_THROW(std::runtime_error, "Found " << num_tables << " SGOF tables, SATNUM specifies at least " << satfuncs_expected);
|
||||
}
|
||||
if (num_tables == Uninitialized) {
|
||||
num_tables = num_sgof_tables;
|
||||
} else if (num_tables != num_sgof_tables) {
|
||||
THROW("Inconsistent number of tables in SWOF and SGOF.");
|
||||
OPM_THROW(std::runtime_error, "Inconsistent number of tables in SWOF and SGOF.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,13 +104,13 @@ namespace Opm
|
||||
do_3pt_ = false;
|
||||
if (deck.hasField("ENDSCALE")) {
|
||||
if (!phase_usage_.phase_used[Aqua] || !phase_usage_.phase_used[Liquid] || phase_usage_.phase_used[Vapour]) {
|
||||
THROW("Currently endpoint-scaling limited to oil-water systems without gas.");
|
||||
OPM_THROW(std::runtime_error, "Currently endpoint-scaling limited to oil-water systems without gas.");
|
||||
}
|
||||
if (deck.getENDSCALE().dir_switch_ != std::string("NODIR")) {
|
||||
THROW("SaturationPropsFromDeck::init() -- ENDSCALE: Currently only 'NODIR' accepted.");
|
||||
OPM_THROW(std::runtime_error, "SaturationPropsFromDeck::init() -- ENDSCALE: Currently only 'NODIR' accepted.");
|
||||
}
|
||||
if (deck.getENDSCALE().revers_switch_ != std::string("REVERS")) {
|
||||
THROW("SaturationPropsFromDeck::init() -- ENDSCALE: Currently only 'REVERS' accepted.");
|
||||
OPM_THROW(std::runtime_error, "SaturationPropsFromDeck::init() -- ENDSCALE: Currently only 'REVERS' accepted.");
|
||||
}
|
||||
if (deck.hasField("SCALECRS")) {
|
||||
if (deck.getSCALECRS().scalecrs_ == std::string("YES")) {
|
||||
@@ -299,7 +299,7 @@ namespace Opm
|
||||
scaleparam[i] = funcForCell(i).sowcr_;
|
||||
}
|
||||
}else {
|
||||
THROW(" -- unknown keyword: '" << keyword << "'");
|
||||
OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'");
|
||||
}
|
||||
if (!useKeyword && itab > 0) {
|
||||
table = deck.getENPTVD().table_;
|
||||
@@ -334,7 +334,7 @@ namespace Opm
|
||||
scaleparam[i] = funcForCell(i).krorw_;
|
||||
}
|
||||
} else {
|
||||
THROW(" -- unknown keyword: '" << keyword << "'");
|
||||
OPM_THROW(std::runtime_error, " -- unknown keyword: '" << keyword << "'");
|
||||
}
|
||||
if (!useKeyword && itab > 0) {
|
||||
table = deck.getENKRVD().table_;
|
||||
@@ -449,7 +449,7 @@ namespace Opm
|
||||
|
||||
// Evaluation of relperms
|
||||
if (dkrds) {
|
||||
THROW("Relperm derivatives not yet available in combination with end point scaling ...");
|
||||
OPM_THROW(std::runtime_error, "Relperm derivatives not yet available in combination with end point scaling ...");
|
||||
funcForCell(cell).evalKrDeriv(ss, kr, dkrds);
|
||||
} else {
|
||||
// Assume: sw_cr -> krw=0 sw_max -> krw=<max water relperm>
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace Opm
|
||||
{
|
||||
const int num_phases = props.numPhases();
|
||||
if (num_phases != 2) {
|
||||
THROW("initStateTwophaseBasic(): currently handling only two-phase scenarios.");
|
||||
OPM_THROW(std::runtime_error, "initStateTwophaseBasic(): currently handling only two-phase scenarios.");
|
||||
}
|
||||
state.init(grid, num_phases);
|
||||
const int num_cells = props.numCells();
|
||||
@@ -409,7 +409,7 @@ namespace Opm
|
||||
// TODO: Refactor to exploit similarity with IncompProp* case.
|
||||
const int num_phases = props.numPhases();
|
||||
if (num_phases != 2) {
|
||||
THROW("initStateTwophaseBasic(): currently handling only two-phase scenarios.");
|
||||
OPM_THROW(std::runtime_error, "initStateTwophaseBasic(): currently handling only two-phase scenarios.");
|
||||
}
|
||||
state.init(grid, num_phases);
|
||||
const int num_cells = props.numCells();
|
||||
@@ -475,21 +475,21 @@ namespace Opm
|
||||
const int num_phases = props.numPhases();
|
||||
const PhaseUsage pu = phaseUsageFromDeck(deck);
|
||||
if (num_phases != pu.num_phases) {
|
||||
THROW("initStateFromDeck(): user specified property object with " << num_phases << " phases, "
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): user specified property object with " << num_phases << " phases, "
|
||||
"found " << pu.num_phases << " phases in deck.");
|
||||
}
|
||||
state.init(grid, num_phases);
|
||||
if (deck.hasField("EQUIL")) {
|
||||
if (num_phases != 2) {
|
||||
THROW("initStateFromDeck(): EQUIL-based init currently handling only two-phase scenarios.");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only two-phase scenarios.");
|
||||
}
|
||||
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
||||
THROW("initStateFromDeck(): EQUIL-based init currently handling only oil-water scenario (no gas).");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): EQUIL-based init currently handling only oil-water scenario (no gas).");
|
||||
}
|
||||
// Set saturations depending on oil-water contact.
|
||||
const EQUIL& equil= deck.getEQUIL();
|
||||
if (equil.equil.size() != 1) {
|
||||
THROW("initStateFromDeck(): No region support yet.");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): No region support yet.");
|
||||
}
|
||||
const double woc = equil.equil[0].water_oil_contact_depth_;
|
||||
initWaterOilContact(grid, props, woc, WaterBelow, state);
|
||||
@@ -507,7 +507,7 @@ namespace Opm
|
||||
if (!pu.phase_used[BlackoilPhases::Aqua]) {
|
||||
// oil-gas: we require SGAS
|
||||
if (!deck.hasField("SGAS")) {
|
||||
THROW("initStateFromDeck(): missing SGAS keyword in 2-phase init");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SGAS keyword in 2-phase init");
|
||||
}
|
||||
const std::vector<double>& sg_deck = deck.getFloatingPointValue("SGAS");
|
||||
const int gpos = pu.phase_pos[BlackoilPhases::Vapour];
|
||||
@@ -521,7 +521,7 @@ namespace Opm
|
||||
} else {
|
||||
// water-oil or water-gas: we require SWAT
|
||||
if (!deck.hasField("SWAT")) {
|
||||
THROW("initStateFromDeck(): missing SWAT keyword in 2-phase init");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SWAT keyword in 2-phase init");
|
||||
}
|
||||
const std::vector<double>& sw_deck = deck.getFloatingPointValue("SWAT");
|
||||
const int wpos = pu.phase_pos[BlackoilPhases::Aqua];
|
||||
@@ -536,7 +536,7 @@ namespace Opm
|
||||
} else if (num_phases == 3) {
|
||||
const bool has_swat_sgas = deck.hasField("SWAT") && deck.hasField("SGAS");
|
||||
if (!has_swat_sgas) {
|
||||
THROW("initStateFromDeck(): missing SGAS or SWAT keyword in 3-phase init.");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): missing SGAS or SWAT keyword in 3-phase init.");
|
||||
}
|
||||
const int wpos = pu.phase_pos[BlackoilPhases::Aqua];
|
||||
const int gpos = pu.phase_pos[BlackoilPhases::Vapour];
|
||||
@@ -551,10 +551,10 @@ namespace Opm
|
||||
p[c] = p_deck[c_deck];
|
||||
}
|
||||
} else {
|
||||
THROW("initStateFromDeck(): init with SWAT etc. only available with 2 or 3 phases.");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): init with SWAT etc. only available with 2 or 3 phases.");
|
||||
}
|
||||
} else {
|
||||
THROW("initStateFromDeck(): we must either have EQUIL, or PRESSURE and SWAT/SOIL/SGAS.");
|
||||
OPM_THROW(std::runtime_error, "initStateFromDeck(): we must either have EQUIL, or PRESSURE and SWAT/SOIL/SGAS.");
|
||||
}
|
||||
|
||||
// Finally, init face pressures.
|
||||
@@ -619,7 +619,7 @@ namespace Opm
|
||||
state.gasoilratio()[c] = rs_deck[c_deck];
|
||||
}
|
||||
} else {
|
||||
THROW("Temporarily, we require the RS field.");
|
||||
OPM_THROW(std::runtime_error, "Temporarily, we require the RS field.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,10 +63,10 @@ namespace Opm
|
||||
degree_(degree_arg)
|
||||
{
|
||||
if (grid_.dimensions > 3) {
|
||||
THROW("Grid dimension must be 1, 2 or 3.");
|
||||
OPM_THROW(std::runtime_error, "Grid dimension must be 1, 2 or 3.");
|
||||
}
|
||||
if (degree_ > 1 || degree_ < 0) {
|
||||
THROW("Degree must be 0 or 1.");
|
||||
OPM_THROW(std::runtime_error, "Degree must be 0 or 1.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Opm
|
||||
case 3:
|
||||
return (degree_ + 3)*(degree_ + 2)*(degree_ + 1)/6;
|
||||
default:
|
||||
THROW("Dimensions must be 1, 2 or 3.");
|
||||
OPM_THROW(std::runtime_error, "Dimensions must be 1, 2 or 3.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Opm
|
||||
f_x[0] = 1;
|
||||
break;
|
||||
default:
|
||||
THROW("Maximum degree is 1 for now.");
|
||||
OPM_THROW(std::runtime_error, "Maximum degree is 1 for now.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,10 +194,10 @@ namespace Opm
|
||||
degree_(degree_arg)
|
||||
{
|
||||
if (grid_.dimensions > 3) {
|
||||
THROW("Grid dimension must be 1, 2 or 3.");
|
||||
OPM_THROW(std::runtime_error, "Grid dimension must be 1, 2 or 3.");
|
||||
}
|
||||
if (degree_ > 1 || degree_ < 0) {
|
||||
THROW("Degree must be 0 or 1.");
|
||||
OPM_THROW(std::runtime_error, "Degree must be 0 or 1.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace Opm
|
||||
case 3:
|
||||
return (degree_ + 1)*(degree_ + 1)*(degree_ + 1);
|
||||
default:
|
||||
THROW("Dimensions must be 1, 2 or 3.");
|
||||
OPM_THROW(std::runtime_error, "Dimensions must be 1, 2 or 3.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace Opm
|
||||
}
|
||||
break;
|
||||
default:
|
||||
THROW("Maximum degree is 1 for now.");
|
||||
OPM_THROW(std::runtime_error, "Maximum degree is 1 for now.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace Opm
|
||||
}
|
||||
break;
|
||||
default:
|
||||
THROW("Maximum degree is 1 for now.");
|
||||
OPM_THROW(std::runtime_error, "Maximum degree is 1 for now.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Opm
|
||||
} else if (limiter_method_str == "MinUpwindAverage") {
|
||||
limiter_method_ = MinUpwindAverage;
|
||||
} else {
|
||||
THROW("Unknown limiter method: " << limiter_method_str);
|
||||
OPM_THROW(std::runtime_error, "Unknown limiter method: " << limiter_method_str);
|
||||
}
|
||||
const std::string limiter_usage_str = param.getDefault<std::string>("limiter_usage", "DuringComputations");
|
||||
if (limiter_usage_str == "DuringComputations") {
|
||||
@@ -80,7 +80,7 @@ namespace Opm
|
||||
} else if (limiter_usage_str == "AsSimultaneousPostProcess") {
|
||||
limiter_usage_ = AsSimultaneousPostProcess;
|
||||
} else {
|
||||
THROW("Unknown limiter usage spec: " << limiter_usage_str);
|
||||
OPM_THROW(std::runtime_error, "Unknown limiter usage spec: " << limiter_usage_str);
|
||||
}
|
||||
}
|
||||
// A note about the use_cvi_ member variable:
|
||||
@@ -112,7 +112,7 @@ namespace Opm
|
||||
// Sanity check for sources.
|
||||
const double cum_src = std::accumulate(source, source + grid_.number_of_cells, 0.0);
|
||||
if (std::fabs(cum_src) > *std::max_element(source, source + grid_.number_of_cells)*1e-2) {
|
||||
// THROW("Sources do not sum to zero: " << cum_src);
|
||||
// OPM_THROW(std::runtime_error, "Sources do not sum to zero: " << cum_src);
|
||||
MESSAGE("Warning: sources do not sum to zero: " << cum_src);
|
||||
}
|
||||
#endif
|
||||
@@ -144,7 +144,7 @@ namespace Opm
|
||||
// Do nothing.
|
||||
break;
|
||||
default:
|
||||
THROW("Unknown limiter usage choice: " << limiter_usage_);
|
||||
OPM_THROW(std::runtime_error, "Unknown limiter usage choice: " << limiter_usage_);
|
||||
}
|
||||
if (num_multicell_ > 0) {
|
||||
std::cout << num_multicell_ << " multicell blocks with max size "
|
||||
@@ -190,7 +190,7 @@ namespace Opm
|
||||
// Sanity check for sources.
|
||||
const double cum_src = std::accumulate(source, source + grid_.number_of_cells, 0.0);
|
||||
if (std::fabs(cum_src) > *std::max_element(source, source + grid_.number_of_cells)*1e-2) {
|
||||
// THROW("Sources do not sum to zero: " << cum_src);
|
||||
// OPM_THROW(std::runtime_error, "Sources do not sum to zero: " << cum_src);
|
||||
MESSAGE("Warning: sources do not sum to zero: " << cum_src);
|
||||
}
|
||||
#endif
|
||||
@@ -240,7 +240,7 @@ namespace Opm
|
||||
// Do nothing.
|
||||
break;
|
||||
default:
|
||||
THROW("Unknown limiter usage choice: " << limiter_usage_);
|
||||
OPM_THROW(std::runtime_error, "Unknown limiter usage choice: " << limiter_usage_);
|
||||
}
|
||||
if (num_multicell_ > 0) {
|
||||
std::cout << num_multicell_ << " multicell blocks with max size "
|
||||
@@ -467,7 +467,7 @@ namespace Opm
|
||||
for (int row = 0; row < n; ++row) {
|
||||
std::cerr << " " << orig_rhs_[row] << '\n';
|
||||
}
|
||||
THROW("Lapack error: " << info << " encountered in cell " << cell);
|
||||
OPM_THROW(std::runtime_error, "Lapack error: " << info << " encountered in cell " << cell);
|
||||
}
|
||||
|
||||
// The solution ends up in rhs_, so we must copy it.
|
||||
@@ -571,7 +571,7 @@ namespace Opm
|
||||
applyMinUpwindLimiter(cell, false, tof);
|
||||
break;
|
||||
default:
|
||||
THROW("Limiter type not implemented: " << limiter_method_);
|
||||
OPM_THROW(std::runtime_error, "Limiter type not implemented: " << limiter_method_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ namespace Opm
|
||||
void TofDiscGalReorder::applyMinUpwindLimiter(const int cell, const bool face_min, double* tof)
|
||||
{
|
||||
if (basis_func_->degree() != 1) {
|
||||
THROW("This limiter only makes sense for our DG1 implementation.");
|
||||
OPM_THROW(std::runtime_error, "This limiter only makes sense for our DG1 implementation.");
|
||||
}
|
||||
|
||||
// Limiter principles:
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Opm
|
||||
// Sanity check for sources.
|
||||
const double cum_src = std::accumulate(source, source + grid_.number_of_cells, 0.0);
|
||||
if (std::fabs(cum_src) > *std::max_element(source, source + grid_.number_of_cells)*1e-2) {
|
||||
THROW("Sources do not sum to zero: " << cum_src);
|
||||
OPM_THROW(std::runtime_error, "Sources do not sum to zero: " << cum_src);
|
||||
}
|
||||
#endif
|
||||
tof.resize(grid_.number_of_cells);
|
||||
@@ -121,7 +121,7 @@ namespace Opm
|
||||
// Sanity check for sources.
|
||||
const double cum_src = std::accumulate(source, source + grid_.number_of_cells, 0.0);
|
||||
if (std::fabs(cum_src) > *std::max_element(source, source + grid_.number_of_cells)*1e-2) {
|
||||
THROW("Sources do not sum to zero: " << cum_src);
|
||||
OPM_THROW(std::runtime_error, "Sources do not sum to zero: " << cum_src);
|
||||
}
|
||||
#endif
|
||||
tof.resize(grid_.number_of_cells);
|
||||
@@ -148,7 +148,7 @@ namespace Opm
|
||||
if (use_multidim_upwind_) {
|
||||
face_tof_.resize(grid_.number_of_faces);
|
||||
std::fill(face_tof_.begin(), face_tof_.end(), 0.0);
|
||||
THROW("Multidimensional upwind not yet implemented for tracer.");
|
||||
OPM_THROW(std::runtime_error, "Multidimensional upwind not yet implemented for tracer.");
|
||||
}
|
||||
num_multicell_ = 0;
|
||||
max_size_multicell_ = 0;
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Opm
|
||||
ja_downw_(grid.number_of_faces, -1)
|
||||
{
|
||||
if (props.numPhases() != 2) {
|
||||
THROW("Property object must have 2 phases");
|
||||
OPM_THROW(std::runtime_error, "Property object must have 2 phases");
|
||||
}
|
||||
int np = props.numPhases();
|
||||
int num_cells = props.numCells();
|
||||
@@ -100,7 +100,7 @@ namespace Opm
|
||||
|
||||
// Check immiscibility requirement (only done for first cell).
|
||||
if (A_[1] != 0.0 || A_[2] != 0.0) {
|
||||
THROW("TransportModelCompressibleTwophase requires a property object without miscibility.");
|
||||
OPM_THROW(std::runtime_error, "TransportModelCompressibleTwophase requires a property object without miscibility.");
|
||||
}
|
||||
|
||||
std::vector<int> seq(grid_.number_of_cells);
|
||||
@@ -296,7 +296,7 @@ namespace Opm
|
||||
|
||||
// Done with iterations, check if we succeeded.
|
||||
if (update_count > 0) {
|
||||
THROW("In solveMultiCell(), we did not converge after "
|
||||
OPM_THROW(std::runtime_error, "In solveMultiCell(), we did not converge after "
|
||||
<< num_iters << " iterations. Remaining update count = " << update_count);
|
||||
}
|
||||
std::cout << "Solved " << num_cells << " cell multicell problem in "
|
||||
@@ -498,7 +498,7 @@ namespace Opm
|
||||
} while (max_s_change > tol_ && ++num_iters < maxit_);
|
||||
|
||||
if (max_s_change > tol_) {
|
||||
THROW("In solveGravityColumn(), we did not converge after "
|
||||
OPM_THROW(std::runtime_error, "In solveGravityColumn(), we did not converge after "
|
||||
<< num_iters << " iterations. Delta s = " << max_s_change);
|
||||
}
|
||||
return num_iters + 1;
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Opm
|
||||
#endif
|
||||
{
|
||||
if (props.numPhases() != 2) {
|
||||
THROW("Property object must have 2 phases");
|
||||
OPM_THROW(std::runtime_error, "Property object must have 2 phases");
|
||||
}
|
||||
visc_ = props.viscosity();
|
||||
int num_cells = props.numCells();
|
||||
@@ -409,7 +409,7 @@ namespace Opm
|
||||
|
||||
// Done with iterations, check if we succeeded.
|
||||
if (update_count > 0) {
|
||||
THROW("In solveMultiCell(), we did not converge after "
|
||||
OPM_THROW(std::runtime_error, "In solveMultiCell(), we did not converge after "
|
||||
<< num_iters << " iterations. Remaining update count = " << update_count);
|
||||
}
|
||||
std::cout << "Solved " << num_cells << " cell multicell problem in "
|
||||
@@ -445,7 +445,7 @@ namespace Opm
|
||||
// << " in cell " << max_change_cell << std::endl;
|
||||
} while (max_s_change > tol && ++num_iters < max_iters);
|
||||
if (max_s_change > tol) {
|
||||
THROW("In solveMultiCell(), we did not converge after "
|
||||
OPM_THROW(std::runtime_error, "In solveMultiCell(), we did not converge after "
|
||||
<< num_iters << " iterations. Delta s = " << max_s_change);
|
||||
}
|
||||
std::cout << "Solved " << num_cells << " cell multicell problem in "
|
||||
@@ -629,7 +629,7 @@ namespace Opm
|
||||
} while (max_s_change > tol_ && ++num_iters < maxit_);
|
||||
|
||||
if (max_s_change > tol_) {
|
||||
THROW("In solveGravityColumn(), we did not converge after "
|
||||
OPM_THROW(std::runtime_error, "In solveGravityColumn(), we did not converge after "
|
||||
<< num_iters << " iterations. Delta s = " << max_s_change);
|
||||
}
|
||||
return num_iters + 1;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Opm
|
||||
const int num_cells = pv.size();
|
||||
const int np = s.size()/pv.size();
|
||||
if (int(s.size()) != num_cells*np) {
|
||||
THROW("Sizes of s and pv vectors do not match.");
|
||||
OPM_THROW(std::runtime_error, "Sizes of s and pv vectors do not match.");
|
||||
}
|
||||
std::fill(sat_vol, sat_vol + np, 0.0);
|
||||
for (int c = 0; c < num_cells; ++c) {
|
||||
@@ -131,7 +131,7 @@ namespace Opm
|
||||
const int num_cells = pv.size();
|
||||
const int np = s.size()/pv.size();
|
||||
if (int(s.size()) != num_cells*np) {
|
||||
THROW("Sizes of s and pv vectors do not match.");
|
||||
OPM_THROW(std::runtime_error, "Sizes of s and pv vectors do not match.");
|
||||
}
|
||||
double tot_pv = 0.0;
|
||||
// Note that we abuse the output array to accumulate the
|
||||
@@ -172,7 +172,7 @@ namespace Opm
|
||||
const int num_cells = src.size();
|
||||
const int np = s.size()/src.size();
|
||||
if (int(s.size()) != num_cells*np) {
|
||||
THROW("Sizes of s and src vectors do not match.");
|
||||
OPM_THROW(std::runtime_error, "Sizes of s and src vectors do not match.");
|
||||
}
|
||||
std::fill(injected, injected + np, 0.0);
|
||||
std::fill(produced, produced + np, 0.0);
|
||||
@@ -366,7 +366,7 @@ namespace Opm
|
||||
const int nw = wells->number_of_wells;
|
||||
const int np = wells->number_of_phases;
|
||||
if (np != 2) {
|
||||
THROW("computeTransportSource() requires a 2 phase case.");
|
||||
OPM_THROW(std::runtime_error, "computeTransportSource() requires a 2 phase case.");
|
||||
}
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
const double* comp_frac = wells->comp_frac + np*w;
|
||||
@@ -453,7 +453,7 @@ namespace Opm
|
||||
{
|
||||
const int np = wells.number_of_phases;
|
||||
if (np != 2) {
|
||||
THROW("wellsToSrc() requires a 2 phase case.");
|
||||
OPM_THROW(std::runtime_error, "wellsToSrc() requires a 2 phase case.");
|
||||
}
|
||||
src.resize(num_cells);
|
||||
for (int w = 0; w < wells.number_of_wells; ++w) {
|
||||
@@ -462,14 +462,14 @@ namespace Opm
|
||||
MESSAGE("In wellsToSrc(): well has more than one control, all but current control will be ignored.");
|
||||
}
|
||||
if (wells.ctrls[w]->type[cur] != RESERVOIR_RATE) {
|
||||
THROW("In wellsToSrc(): well is something other than RESERVOIR_RATE.");
|
||||
OPM_THROW(std::runtime_error, "In wellsToSrc(): well is something other than RESERVOIR_RATE.");
|
||||
}
|
||||
if (wells.well_connpos[w+1] - wells.well_connpos[w] != 1) {
|
||||
THROW("In wellsToSrc(): well has multiple perforations.");
|
||||
OPM_THROW(std::runtime_error, "In wellsToSrc(): well has multiple perforations.");
|
||||
}
|
||||
for (int p = 0; p < np; ++p) {
|
||||
if (wells.ctrls[w]->distr[np*cur + p] != 1.0) {
|
||||
THROW("In wellsToSrc(): well not controlled on total rate.");
|
||||
OPM_THROW(std::runtime_error, "In wellsToSrc(): well not controlled on total rate.");
|
||||
}
|
||||
}
|
||||
double flow = wells.ctrls[w]->target[cur];
|
||||
@@ -602,7 +602,7 @@ namespace Opm
|
||||
int np = props.numPhases();
|
||||
const int max_np = 3;
|
||||
if (np > max_np) {
|
||||
THROW("WellReport for now assumes #phases <= " << max_np);
|
||||
OPM_THROW(std::runtime_error, "WellReport for now assumes #phases <= " << max_np);
|
||||
}
|
||||
const double* visc = props.viscosity();
|
||||
std::vector<double> data_now;
|
||||
@@ -661,7 +661,7 @@ namespace Opm
|
||||
int np = props.numPhases();
|
||||
const int max_np = 3;
|
||||
if (np > max_np) {
|
||||
THROW("WellReport for now assumes #phases <= " << max_np);
|
||||
OPM_THROW(std::runtime_error, "WellReport for now assumes #phases <= " << max_np);
|
||||
}
|
||||
std::vector<double> data_now;
|
||||
data_now.reserve(1 + 3*nw);
|
||||
|
||||
@@ -61,11 +61,11 @@ namespace Opm
|
||||
{
|
||||
const int num_cells = transport_src.size();
|
||||
if (props.numCells() != num_cells) {
|
||||
THROW("Size of transport_src vector does not match number of cells in props.");
|
||||
OPM_THROW(std::runtime_error, "Size of transport_src vector does not match number of cells in props.");
|
||||
}
|
||||
const int np = props.numPhases();
|
||||
if (int(state.saturation().size()) != num_cells*np) {
|
||||
THROW("Sizes of state vectors do not match number of cells.");
|
||||
OPM_THROW(std::runtime_error, "Sizes of state vectors do not match number of cells.");
|
||||
}
|
||||
const std::vector<double>& press = state.pressure();
|
||||
const std::vector<double>& s = state.saturation();
|
||||
@@ -301,7 +301,7 @@ namespace Opm
|
||||
const int nw = wells->number_of_wells;
|
||||
const int np = wells->number_of_phases;
|
||||
if (np != 2) {
|
||||
THROW("computeTransportSource() requires a 2 phase case.");
|
||||
OPM_THROW(std::runtime_error, "computeTransportSource() requires a 2 phase case.");
|
||||
}
|
||||
std::vector<double> A(np*np);
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Opm
|
||||
|
||||
WellsGroup* parent_as_group = static_cast<WellsGroup*> (parent);
|
||||
if (!parent_as_group) {
|
||||
THROW("Trying to add child to group named " << parent_name << ", but it's not a group.");
|
||||
OPM_THROW(std::runtime_error, "Trying to add child to group named " << parent_name << ", but it's not a group.");
|
||||
}
|
||||
parent_as_group->addChild(child);
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Opm
|
||||
{
|
||||
WellsGroupInterface* parent = findNode(parent_name);
|
||||
if (parent == NULL) {
|
||||
THROW("Parent with name = " << parent_name << " not found.");
|
||||
OPM_THROW(std::runtime_error, "Parent with name = " << parent_name << " not found.");
|
||||
}
|
||||
ASSERT(!parent->isLeafNode());
|
||||
static_cast<WellsGroup*>(parent)->addChild(child_node);
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Opm
|
||||
return tot_rate;
|
||||
}
|
||||
default:
|
||||
THROW("No rate associated with production control mode" << mode);
|
||||
OPM_THROW(std::runtime_error, "No rate associated with production control mode" << mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace Opm
|
||||
rates = res_rates;
|
||||
break;
|
||||
default:
|
||||
THROW("No rate associated with injection control mode" << mode);
|
||||
OPM_THROW(std::runtime_error, "No rate associated with injection control mode" << mode);
|
||||
}
|
||||
double tot_rate = 0.0;
|
||||
for (int phase = 0; phase < phaseUsage().num_phases; ++phase) {
|
||||
@@ -191,10 +191,10 @@ namespace Opm
|
||||
target = prodSpec().liquid_max_rate_;
|
||||
break;
|
||||
case ProductionSpecification::GRUP:
|
||||
THROW("Can't query target production rate for GRUP control keyword");
|
||||
OPM_THROW(std::runtime_error, "Can't query target production rate for GRUP control keyword");
|
||||
break;
|
||||
default:
|
||||
THROW("Unsupported control mode to query target " << mode);
|
||||
OPM_THROW(std::runtime_error, "Unsupported control mode to query target " << mode);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -212,10 +212,10 @@ namespace Opm
|
||||
target = injSpec().reservoir_flow_max_rate_;
|
||||
break;
|
||||
case InjectionSpecification::GRUP:
|
||||
THROW("Can't query target production rate for GRUP control keyword");
|
||||
OPM_THROW(std::runtime_error, "Can't query target production rate for GRUP control keyword");
|
||||
break;
|
||||
default:
|
||||
THROW("Unsupported control mode to query target " << mode);
|
||||
OPM_THROW(std::runtime_error, "Unsupported control mode to query target " << mode);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ namespace Opm
|
||||
{
|
||||
const double my_guide_rate = productionGuideRate(true);
|
||||
if (my_guide_rate == 0) {
|
||||
THROW("Can't apply group control for group " << name() << " as the sum of guide rates for all group controlled wells is zero.");
|
||||
OPM_THROW(std::runtime_error, "Can't apply group control for group " << name() << " as the sum of guide rates for all group controlled wells is zero.");
|
||||
}
|
||||
for (size_t i = 0; i < children_.size(); ++i ) {
|
||||
// Apply for all children.
|
||||
@@ -470,7 +470,7 @@ namespace Opm
|
||||
}
|
||||
break;
|
||||
default:
|
||||
THROW("Unhandled group production control type " << prod_mode);
|
||||
OPM_THROW(std::runtime_error, "Unhandled group production control type " << prod_mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ namespace Opm
|
||||
}
|
||||
return;
|
||||
default:
|
||||
THROW("Unhandled group injection control mode " << inj_mode);
|
||||
OPM_THROW(std::runtime_error, "Unhandled group injection control mode " << inj_mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -802,7 +802,7 @@ namespace Opm
|
||||
wct = RESERVOIR_RATE;
|
||||
break;
|
||||
default:
|
||||
THROW("Group injection control mode not handled: " << control_mode);
|
||||
OPM_THROW(std::runtime_error, "Group injection control mode not handled: " << control_mode);
|
||||
}
|
||||
|
||||
if (group_control_index_ < 0) {
|
||||
@@ -879,21 +879,21 @@ namespace Opm
|
||||
case ProductionSpecification::ORAT:
|
||||
wct = SURFACE_RATE;
|
||||
if (!phase_used[BlackoilPhases::Liquid]) {
|
||||
THROW("Oil phase not active and ORAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Oil phase not active and ORAT control specified.");
|
||||
}
|
||||
distr[phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
||||
break;
|
||||
case ProductionSpecification::WRAT:
|
||||
wct = SURFACE_RATE;
|
||||
if (!phase_used[BlackoilPhases::Aqua]) {
|
||||
THROW("Water phase not active and WRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Water phase not active and WRAT control specified.");
|
||||
}
|
||||
distr[phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
||||
break;
|
||||
case ProductionSpecification::GRAT:
|
||||
wct = SURFACE_RATE;
|
||||
if (!phase_used[BlackoilPhases::Vapour]) {
|
||||
THROW("Gas phase not active and GRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Gas phase not active and GRAT control specified.");
|
||||
}
|
||||
distr[phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||
break;
|
||||
@@ -901,10 +901,10 @@ namespace Opm
|
||||
std::cout << "applying rate" << std::endl;
|
||||
wct = SURFACE_RATE;
|
||||
if (!phase_used[BlackoilPhases::Liquid]) {
|
||||
THROW("Oil phase not active and LRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Oil phase not active and LRAT control specified.");
|
||||
}
|
||||
if (!phase_used[BlackoilPhases::Aqua]) {
|
||||
THROW("Water phase not active and LRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Water phase not active and LRAT control specified.");
|
||||
}
|
||||
distr[phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
||||
distr[phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
||||
@@ -914,7 +914,7 @@ namespace Opm
|
||||
wct = RESERVOIR_RATE;
|
||||
break;
|
||||
default:
|
||||
THROW("Group production control mode not handled: " << control_mode);
|
||||
OPM_THROW(std::runtime_error, "Group production control mode not handled: " << control_mode);
|
||||
}
|
||||
|
||||
if (group_control_index_ < 0) {
|
||||
@@ -980,7 +980,7 @@ namespace Opm
|
||||
if (type[0] == 'G') {
|
||||
return InjectionSpecification::GAS;
|
||||
}
|
||||
THROW("Unknown type " << type << ", could not convert to SurfaceComponent");
|
||||
OPM_THROW(std::runtime_error, "Unknown type " << type << ", could not convert to SurfaceComponent");
|
||||
}
|
||||
|
||||
|
||||
@@ -1000,7 +1000,7 @@ namespace Opm
|
||||
HANDLE_ICM(VREP);
|
||||
HANDLE_ICM(GRUP);
|
||||
HANDLE_ICM(FLD);
|
||||
THROW("Unknown type " << type << ", could not convert to InjectionSpecification::ControlMode.");
|
||||
OPM_THROW(std::runtime_error, "Unknown type " << type << ", could not convert to InjectionSpecification::ControlMode.");
|
||||
}
|
||||
#undef HANDLE_ICM
|
||||
|
||||
@@ -1023,7 +1023,7 @@ namespace Opm
|
||||
HANDLE_PCM(THP);
|
||||
HANDLE_PCM(GRUP);
|
||||
HANDLE_PCM(FLD);
|
||||
THROW("Unknown type " << type << ", could not convert to ProductionSpecification::ControlMode.");
|
||||
OPM_THROW(std::runtime_error, "Unknown type " << type << ", could not convert to ProductionSpecification::ControlMode.");
|
||||
}
|
||||
#undef HANDLE_PCM
|
||||
|
||||
@@ -1040,7 +1040,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
THROW("Unknown type " << type << ", could not convert to ControlMode.");
|
||||
OPM_THROW(std::runtime_error, "Unknown type " << type << ", could not convert to ControlMode.");
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace
|
||||
return p->second;
|
||||
}
|
||||
else {
|
||||
THROW("Unknown well control mode = "
|
||||
OPM_THROW(std::runtime_error, "Unknown well control mode = "
|
||||
<< control << " in input file");
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ namespace
|
||||
return p->second;
|
||||
}
|
||||
else {
|
||||
THROW("Unknown well control mode = "
|
||||
OPM_THROW(std::runtime_error, "Unknown well control mode = "
|
||||
<< control << " in input file");
|
||||
}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ namespace Opm
|
||||
: w_(0)
|
||||
{
|
||||
if (grid.dimensions != 3) {
|
||||
THROW("We cannot initialize wells from a deck unless the corresponding grid is 3-dimensional.");
|
||||
OPM_THROW(std::runtime_error, "We cannot initialize wells from a deck unless the corresponding grid is 3-dimensional.");
|
||||
}
|
||||
// NOTE: Implementation copied and modified from dune-porsol's class BlackoilWells.
|
||||
std::vector<std::string> keywords;
|
||||
@@ -253,7 +253,7 @@ namespace Opm
|
||||
return;
|
||||
}
|
||||
if (!(deck.hasField("WCONINJE") || deck.hasField("WCONPROD")) ) {
|
||||
THROW("Needed field is missing in file");
|
||||
OPM_THROW(std::runtime_error, "Needed field is missing in file");
|
||||
}
|
||||
|
||||
// Obtain phase usage data.
|
||||
@@ -373,7 +373,7 @@ namespace Opm
|
||||
std::map<int, int>::const_iterator cgit =
|
||||
cartesian_to_compressed.find(cart_grid_indx);
|
||||
if (cgit == cartesian_to_compressed.end()) {
|
||||
THROW("Cell with i,j,k indices " << ix << ' ' << jy << ' '
|
||||
OPM_THROW(std::runtime_error, "Cell with i,j,k indices " << ix << ' ' << jy << ' '
|
||||
<< kz << " not found in grid (well = " << name << ')');
|
||||
}
|
||||
int cell = cgit->second;
|
||||
@@ -399,7 +399,7 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
THROW("Undefined well name: " << compdat.compdat[kw].well_
|
||||
OPM_THROW(std::runtime_error, "Undefined well name: " << compdat.compdat[kw].well_
|
||||
<< " in COMPDAT");
|
||||
}
|
||||
}
|
||||
@@ -424,7 +424,7 @@ namespace Opm
|
||||
// Create the well data structures.
|
||||
w_ = create_wells(pu.num_phases, num_wells, num_perfs);
|
||||
if (!w_) {
|
||||
THROW("Failed creating Wells struct.");
|
||||
OPM_THROW(std::runtime_error, "Failed creating Wells struct.");
|
||||
}
|
||||
|
||||
// Classify wells
|
||||
@@ -436,7 +436,7 @@ namespace Opm
|
||||
const int well_index = it->second;
|
||||
well_data[well_index].type = INJECTOR;
|
||||
} else {
|
||||
THROW("Unseen well name: " << lines[i].well_ << " first seen in WCONINJE");
|
||||
OPM_THROW(std::runtime_error, "Unseen well name: " << lines[i].well_ << " first seen in WCONINJE");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,7 +448,7 @@ namespace Opm
|
||||
const int well_index = it->second;
|
||||
well_data[well_index].type = PRODUCER;
|
||||
} else {
|
||||
THROW("Unseen well name: " << lines[i].well_ << " first seen in WCONPROD");
|
||||
OPM_THROW(std::runtime_error, "Unseen well name: " << lines[i].well_ << " first seen in WCONPROD");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -469,7 +469,7 @@ namespace Opm
|
||||
int ok = add_well(well_data[w].type, well_data[w].reference_bhp_depth, w_num_perf,
|
||||
comp_frac, &perf_cells[0], &perf_prodind[0], well_names[w].c_str(), w_);
|
||||
if (!ok) {
|
||||
THROW("Failed adding well " << well_names[w] << " to Wells data structure.");
|
||||
OPM_THROW(std::runtime_error, "Failed adding well " << well_names[w] << " to Wells data structure.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ namespace Opm
|
||||
well_found = true;
|
||||
ASSERT(well_data[wix].type == w_->type[wix]);
|
||||
if (well_data[wix].type != INJECTOR) {
|
||||
THROW("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]);
|
||||
}
|
||||
|
||||
// Add all controls that are present in well.
|
||||
@@ -514,7 +514,7 @@ namespace Opm
|
||||
} else if (wci_line.injector_type_ == "GAS") {
|
||||
distr[pu.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||
} else {
|
||||
THROW("Injector type " << wci_line.injector_type_ << " not supported."
|
||||
OPM_THROW(std::runtime_error, "Injector type " << wci_line.injector_type_ << " not supported."
|
||||
"WellsManager only supports WATER, OIL and GAS injector types.");
|
||||
}
|
||||
ok = append_well_controls(SURFACE_RATE, wci_line.surface_flow_max_rate_,
|
||||
@@ -530,7 +530,7 @@ namespace Opm
|
||||
} else if (wci_line.injector_type_ == "GAS") {
|
||||
distr[pu.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||
} else {
|
||||
THROW("Injector type " << wci_line.injector_type_ << " not supported."
|
||||
OPM_THROW(std::runtime_error, "Injector type " << wci_line.injector_type_ << " not supported."
|
||||
"WellsManager only supports WATER, OIL and GAS injector types.");
|
||||
}
|
||||
ok = append_well_controls(RESERVOIR_RATE, wci_line.reservoir_flow_max_rate_,
|
||||
@@ -542,15 +542,15 @@ namespace Opm
|
||||
NULL, wix, w_);
|
||||
}
|
||||
if (ok && wci_line.THP_limit_ > 0.0) {
|
||||
THROW("We cannot handle THP limit for well " << well_names[wix]);
|
||||
OPM_THROW(std::runtime_error, "We cannot handle THP limit for well " << well_names[wix]);
|
||||
}
|
||||
if (!ok) {
|
||||
THROW("Failure occured appending controls for well " << well_names[wix]);
|
||||
OPM_THROW(std::runtime_error, "Failure occured appending controls for well " << well_names[wix]);
|
||||
}
|
||||
InjectionControl::Mode mode = InjectionControl::mode(wci_line.control_mode_);
|
||||
int cpos = control_pos[mode];
|
||||
if (cpos == -1 && mode != InjectionControl::GRUP) {
|
||||
THROW("Control for " << wci_line.control_mode_ << " not specified in well " << well_names[wix]);
|
||||
OPM_THROW(std::runtime_error, "Control for " << wci_line.control_mode_ << " not specified in well " << well_names[wix]);
|
||||
}
|
||||
// We need to check if the well is shut or not
|
||||
if (wci_line.open_shut_flag_ == "SHUT") {
|
||||
@@ -562,17 +562,17 @@ namespace Opm
|
||||
double cf[3] = { 0.0, 0.0, 0.0 };
|
||||
if (wci_line.injector_type_[0] == 'W') {
|
||||
if (!pu.phase_used[BlackoilPhases::Aqua]) {
|
||||
THROW("Water phase not used, yet found water-injecting well.");
|
||||
OPM_THROW(std::runtime_error, "Water phase not used, yet found water-injecting well.");
|
||||
}
|
||||
cf[pu.phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
||||
} else if (wci_line.injector_type_[0] == 'O') {
|
||||
if (!pu.phase_used[BlackoilPhases::Liquid]) {
|
||||
THROW("Oil phase not used, yet found oil-injecting well.");
|
||||
OPM_THROW(std::runtime_error, "Oil phase not used, yet found oil-injecting well.");
|
||||
}
|
||||
cf[pu.phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
||||
} else if (wci_line.injector_type_[0] == 'G') {
|
||||
if (!pu.phase_used[BlackoilPhases::Vapour]) {
|
||||
THROW("Gas phase not used, yet found gas-injecting well.");
|
||||
OPM_THROW(std::runtime_error, "Gas phase not used, yet found gas-injecting well.");
|
||||
}
|
||||
cf[pu.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||
}
|
||||
@@ -580,7 +580,7 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
if (!well_found) {
|
||||
THROW("Undefined well name: " << wci_line.well_
|
||||
OPM_THROW(std::runtime_error, "Undefined well name: " << wci_line.well_
|
||||
<< " in WCONINJE");
|
||||
}
|
||||
}
|
||||
@@ -606,7 +606,7 @@ namespace Opm
|
||||
well_found = true;
|
||||
ASSERT(well_data[wix].type == w_->type[wix]);
|
||||
if (well_data[wix].type != PRODUCER) {
|
||||
THROW("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]);
|
||||
}
|
||||
// Add all controls that are present in well.
|
||||
// First we must clear existing controls, in case the
|
||||
@@ -616,7 +616,7 @@ namespace Opm
|
||||
int ok = 1;
|
||||
if (ok && wcp_line.oil_max_rate_ >= 0.0) {
|
||||
if (!pu.phase_used[BlackoilPhases::Liquid]) {
|
||||
THROW("Oil phase not active and ORAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Oil phase not active and ORAT control specified.");
|
||||
}
|
||||
control_pos[ProductionControl::ORAT] = w_->ctrls[wix]->num;
|
||||
double distr[3] = { 0.0, 0.0, 0.0 };
|
||||
@@ -626,7 +626,7 @@ namespace Opm
|
||||
}
|
||||
if (ok && wcp_line.water_max_rate_ >= 0.0) {
|
||||
if (!pu.phase_used[BlackoilPhases::Aqua]) {
|
||||
THROW("Water phase not active and WRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Water phase not active and WRAT control specified.");
|
||||
}
|
||||
control_pos[ProductionControl::WRAT] = w_->ctrls[wix]->num;
|
||||
double distr[3] = { 0.0, 0.0, 0.0 };
|
||||
@@ -636,7 +636,7 @@ namespace Opm
|
||||
}
|
||||
if (ok && wcp_line.gas_max_rate_ >= 0.0) {
|
||||
if (!pu.phase_used[BlackoilPhases::Vapour]) {
|
||||
THROW("Gas phase not active and GRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Gas phase not active and GRAT control specified.");
|
||||
}
|
||||
control_pos[ProductionControl::GRAT] = w_->ctrls[wix]->num;
|
||||
double distr[3] = { 0.0, 0.0, 0.0 };
|
||||
@@ -646,10 +646,10 @@ namespace Opm
|
||||
}
|
||||
if (ok && wcp_line.liquid_max_rate_ >= 0.0) {
|
||||
if (!pu.phase_used[BlackoilPhases::Aqua]) {
|
||||
THROW("Water phase not active and LRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Water phase not active and LRAT control specified.");
|
||||
}
|
||||
if (!pu.phase_used[BlackoilPhases::Liquid]) {
|
||||
THROW("Oil phase not active and LRAT control specified.");
|
||||
OPM_THROW(std::runtime_error, "Oil phase not active and LRAT control specified.");
|
||||
}
|
||||
control_pos[ProductionControl::LRAT] = w_->ctrls[wix]->num;
|
||||
double distr[3] = { 0.0, 0.0, 0.0 };
|
||||
@@ -670,15 +670,15 @@ namespace Opm
|
||||
NULL, wix, w_);
|
||||
}
|
||||
if (ok && wcp_line.THP_limit_ > 0.0) {
|
||||
THROW("We cannot handle THP limit for well " << well_names[wix]);
|
||||
OPM_THROW(std::runtime_error, "We cannot handle THP limit for well " << well_names[wix]);
|
||||
}
|
||||
if (!ok) {
|
||||
THROW("Failure occured appending controls for well " << well_names[wix]);
|
||||
OPM_THROW(std::runtime_error, "Failure occured appending controls for well " << well_names[wix]);
|
||||
}
|
||||
ProductionControl::Mode mode = ProductionControl::mode(wcp_line.control_mode_);
|
||||
int cpos = control_pos[mode];
|
||||
if (cpos == -1 && mode != ProductionControl::GRUP) {
|
||||
THROW("Control mode type " << mode << " not present in well " << well_names[wix]);
|
||||
OPM_THROW(std::runtime_error, "Control mode type " << mode << " not present in well " << well_names[wix]);
|
||||
}
|
||||
// If it's shut, we complement the cpos
|
||||
if (wcp_line.open_shut_flag_ == "SHUT") {
|
||||
@@ -688,7 +688,7 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
if (!well_found) {
|
||||
THROW("Undefined well name: " << wcp_line.well_
|
||||
OPM_THROW(std::runtime_error, "Undefined well name: " << wcp_line.well_
|
||||
<< " in WCONPROD");
|
||||
}
|
||||
}
|
||||
@@ -696,7 +696,7 @@ namespace Opm
|
||||
|
||||
// Get WELTARG data
|
||||
if (deck.hasField("WELTARG")) {
|
||||
THROW("We currently do not handle WELTARG.");
|
||||
OPM_THROW(std::runtime_error, "We currently do not handle WELTARG.");
|
||||
/*
|
||||
const WELTARG& weltargs = deck.getWELTARG();
|
||||
const int num_weltargs = weltargs.weltarg.size();
|
||||
@@ -715,7 +715,7 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
if (!well_found) {
|
||||
THROW("Undefined well name: " << weltargs.weltarg[kw].well_
|
||||
OPM_THROW(std::runtime_error, "Undefined well name: " << weltargs.weltarg[kw].well_
|
||||
<< " in WELTARG");
|
||||
}
|
||||
}
|
||||
@@ -750,7 +750,7 @@ namespace Opm
|
||||
std::string wellname = line.well_;
|
||||
std::map<std::string, int>::const_iterator it = well_names_to_index.find(wellname);
|
||||
if (it == well_names_to_index.end()) {
|
||||
THROW("Trying to open/shut well with name: \"" << wellname<<"\" but it's not registered under WELSPECS.");
|
||||
OPM_THROW(std::runtime_error, "Trying to open/shut well with name: \"" << wellname<<"\" but it's not registered under WELSPECS.");
|
||||
}
|
||||
const int index = it->second;
|
||||
if (line.openshutflag_ == "SHUT") {
|
||||
@@ -766,7 +766,7 @@ namespace Opm
|
||||
}
|
||||
ASSERT(w_->ctrls[index]->current >= 0);
|
||||
} else {
|
||||
THROW("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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -803,7 +803,7 @@ namespace Opm
|
||||
if (lines[i].phase_ == "OIL") {
|
||||
wellnode.prodSpec().guide_rate_type_ = ProductionSpecification::OIL;
|
||||
} else {
|
||||
THROW("Guide rate type " << lines[i].phase_ << " specified for producer "
|
||||
OPM_THROW(std::runtime_error, "Guide rate type " << lines[i].phase_ << " specified for producer "
|
||||
<< name << " in WGRUPCON, cannot handle.");
|
||||
}
|
||||
} else if (well_data[wix].type == INJECTOR) {
|
||||
@@ -811,11 +811,11 @@ namespace Opm
|
||||
if (lines[i].phase_ == "RAT") {
|
||||
wellnode.injSpec().guide_rate_type_ = InjectionSpecification::RAT;
|
||||
} else {
|
||||
THROW("Guide rate type " << lines[i].phase_ << " specified for injector "
|
||||
OPM_THROW(std::runtime_error, "Guide rate type " << lines[i].phase_ << " specified for injector "
|
||||
<< name << " in WGRUPCON, cannot handle.");
|
||||
}
|
||||
} else {
|
||||
THROW("Unknown well type " << well_data[wix].type << " for well " << name);
|
||||
OPM_THROW(std::runtime_error, "Unknown well type " << well_data[wix].type << " for well " << name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user