More integration of VFP tables

This commit is contained in:
babrodtk 2015-07-08 17:40:47 +02:00
parent f320b04c4d
commit 83f6b02941
2 changed files with 26 additions and 7 deletions

View File

@ -60,7 +60,8 @@ namespace Opm
// 2. Assign bhp equal to bhp control, if
// applicable, otherwise assign equal to
// first perforation cell pressure.
// thp set to thp control
// Similarly set thp to thp control, or
// -1e100 if not applicable
switch (well_controls_get_current_type(ctrl)) {
case BHP:
bhp_[w] = well_controls_get_current_target( ctrl );
@ -72,6 +73,7 @@ namespace Opm
{
const int first_cell = wells->well_cells[wells->well_connpos[w]];
bhp_[w] = state.pressure()[first_cell];
thp_[w] = -1e100;
}
}
} else {
@ -100,12 +102,24 @@ namespace Opm
// little above or below (depending on if
// the well is an injector or producer)
// pressure in first perforation cell.
if (well_controls_get_current_type(ctrl) == BHP) {
bhp_[w] = well_controls_get_current_target( ctrl );
} else {
const int first_cell = wells->well_cells[wells->well_connpos[w]];
const double safety_factor = (wells->type[w] == INJECTOR) ? 1.01 : 0.99;
bhp_[w] = safety_factor*state.pressure()[first_cell];
switch (well_controls_get_current_type(ctrl)) {
case BHP:
bhp_[w] = well_controls_get_current_target( ctrl );
thp_[w] = -1e100;
break;
case THP:
bhp_[w] = -1e100;
thp_[w] = well_controls_get_current_target( ctrl );
break;
default:
{
const int first_cell = wells->well_cells[wells->well_connpos[w]];
const double safety_factor = (wells->type[w] == INJECTOR) ? 1.01 : 0.99;
bhp_[w] = safety_factor*state.pressure()[first_cell];
thp_[w] = -1e100;
}
}
}
}

View File

@ -678,6 +678,11 @@ namespace Opm
break;
}
case THP: {
//TODO: Implement support
OPM_THROW(std::invalid_argument, "THP not implemented in WellNode::conditionsMet.");
}
case RESERVOIR_RATE: {
double my_rate = 0.0;
const double * ctrls_distr = well_controls_iget_distr( ctrls , ctrl_index );