double ECLSummaryReader::GetWellVar(QString well_name, QString var_name, int time_index)
{
    if (!hasWellVar(well_name, var_name))
        throw SummaryVariableDoesNotExistException("Well variable " + std::string(well_name.toLatin1().constData()) + ":"
                                                   + std::string(var_name.toLatin1().constData()) + " does not exist.");
    if (!HasReportStep(time_index))
        throw SummaryTimeStepDoesNotExistException("Time step does not exist");
    return ecl_sum_get_well_var(ecl_sum_, time_index, well_name.toLatin1().constData(), var_name.toLatin1().constData());
}
Example #2
0
File: ecl_sum.c Project: flikka/ert
bool ecl_sum_is_oil_producer( const ecl_sum_type * ecl_sum , const char * well) {
  const char * WOPT_KEY = "WOPT";
  bool oil_producer = false;

  if (ecl_sum_has_well_var( ecl_sum , well , WOPT_KEY)) {
    int last_step = ecl_sum_get_data_length( ecl_sum ) - 1;
    double wopt = ecl_sum_get_well_var( ecl_sum , last_step , well , WOPT_KEY);

    if (wopt > 0)
      oil_producer = true;
  }

  return oil_producer;
}