mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 08:54:53 -05:00
Minor refactoring
This commit is contained in:
1 parent
b2335ced24
commit
62c2373a9d
5 files changed
+15
-21
No files matched your search
@@ -65,13 +65,12 @@ namespace Opm {
|
||||
const DerivedGeology& geo,
|
||||
const RockCompressibility* rock_comp_props,
|
||||
const Wells* wells,
|
||||
const VFPProperties* vfp_properties,
|
||||
const NewtonIterationBlackoilInterface& linsolver,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const bool has_disgas,
|
||||
const bool has_vapoil,
|
||||
const bool terminal_output)
|
||||
: Base(param, grid, fluid, geo, rock_comp_props, wells, vfp_properties, linsolver,
|
||||
: Base(param, grid, fluid, geo, rock_comp_props, wells, linsolver,
|
||||
eclState, has_disgas, has_vapoil, terminal_output)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <opm/autodiff/LinearisedBlackoilResidual.hpp>
|
||||
#include <opm/autodiff/NewtonIterationBlackoilInterface.hpp>
|
||||
#include <opm/autodiff/BlackoilModelEnums.hpp>
|
||||
#include <opm/autodiff/VFPProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/NNC.hpp>
|
||||
|
||||
#include <array>
|
||||
@@ -130,7 +131,6 @@ namespace Opm {
|
||||
const DerivedGeology& geo ,
|
||||
const RockCompressibility* rock_comp_props,
|
||||
const Wells* wells,
|
||||
const VFPProperties* vfp_properties,
|
||||
const NewtonIterationBlackoilInterface& linsolver,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const bool has_disgas,
|
||||
@@ -239,7 +239,7 @@ namespace Opm {
|
||||
const DerivedGeology& geo_;
|
||||
const RockCompressibility* rock_comp_props_;
|
||||
const Wells* wells_;
|
||||
const VFPProperties* vfp_properties_;
|
||||
VFPProperties vfp_properties_;
|
||||
const NewtonIterationBlackoilInterface& linsolver_;
|
||||
// For each canonical phase -> true if active
|
||||
const std::vector<bool> active_;
|
||||
|
||||
@@ -147,7 +147,6 @@ namespace detail {
|
||||
const DerivedGeology& geo ,
|
||||
const RockCompressibility* rock_comp_props,
|
||||
const Wells* wells,
|
||||
const VFPProperties* vfp_properties,
|
||||
const NewtonIterationBlackoilInterface& linsolver,
|
||||
Opm::EclipseStateConstPtr eclState,
|
||||
const bool has_disgas,
|
||||
@@ -158,7 +157,7 @@ namespace detail {
|
||||
, geo_ (geo)
|
||||
, rock_comp_props_(rock_comp_props)
|
||||
, wells_ (wells)
|
||||
, vfp_properties_(vfp_properties)
|
||||
, vfp_properties_(eclState->getVFPInjTables(), eclState->getVFPProdTables())
|
||||
, linsolver_ (linsolver)
|
||||
, active_(detail::activePhases(fluid.phaseUsage()))
|
||||
, canph_ (detail::active2Canonical(fluid.phaseUsage()))
|
||||
@@ -1208,7 +1207,7 @@ namespace detail {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( vfp_properties_->getProd()->empty() && vfp_properties_->getInj()->empty() ) {
|
||||
if ( vfp_properties_.getProd()->empty() && vfp_properties_.getInj()->empty() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1318,20 +1317,20 @@ namespace detail {
|
||||
//Gather variables for hydrostatic reconstruction
|
||||
|
||||
if (well_type == INJECTOR) {
|
||||
double vfp_ref_depth = vfp_properties_->getInj()->getTable(vfp)->getDatumDepth();
|
||||
double vfp_ref_depth = vfp_properties_.getInj()->getTable(vfp)->getDatumDepth();
|
||||
double dp = detail::computeHydrostaticCorrection(
|
||||
wells(), w, vfp_ref_depth,
|
||||
well_perforation_densities_, gravity);
|
||||
|
||||
xw.bhp()[w] = vfp_properties_->getInj()->bhp(vfp, aqua, liquid, vapour, thp) - dp;
|
||||
xw.bhp()[w] = vfp_properties_.getInj()->bhp(vfp, aqua, liquid, vapour, thp) - dp;
|
||||
}
|
||||
else if (well_type == PRODUCER) {
|
||||
double vfp_ref_depth = vfp_properties_->getProd()->getTable(vfp)->getDatumDepth();
|
||||
double vfp_ref_depth = vfp_properties_.getProd()->getTable(vfp)->getDatumDepth();
|
||||
double dp = detail::computeHydrostaticCorrection(
|
||||
wells(), w, vfp_ref_depth,
|
||||
well_perforation_densities_, gravity);
|
||||
|
||||
xw.bhp()[w] = vfp_properties_->getProd()->bhp(vfp, aqua, liquid, vapour, thp, alq) - dp;
|
||||
xw.bhp()[w] = vfp_properties_.getProd()->bhp(vfp, aqua, liquid, vapour, thp, alq) - dp;
|
||||
}
|
||||
else {
|
||||
OPM_THROW(std::logic_error, "Expected PRODUCER or INJECTOR type of well");
|
||||
@@ -1527,7 +1526,7 @@ namespace detail {
|
||||
thp_inj_target_v[w] = target;
|
||||
alq_v[w] = -1e100;
|
||||
|
||||
vfp_ref_depth_v[w] = vfp_properties_->getInj()->getTable(table_id)->getDatumDepth();
|
||||
vfp_ref_depth_v[w] = vfp_properties_.getInj()->getTable(table_id)->getDatumDepth();
|
||||
|
||||
thp_inj_elems.push_back(w);
|
||||
}
|
||||
@@ -1536,7 +1535,7 @@ namespace detail {
|
||||
thp_prod_target_v[w] = target;
|
||||
alq_v[w] = well_controls_iget_alq(wc, current);
|
||||
|
||||
vfp_ref_depth_v[w] = vfp_properties_->getProd()->getTable(table_id)->getDatumDepth();
|
||||
vfp_ref_depth_v[w] = vfp_properties_.getProd()->getTable(table_id)->getDatumDepth();
|
||||
|
||||
thp_prod_elems.push_back(w);
|
||||
}
|
||||
@@ -1574,8 +1573,8 @@ namespace detail {
|
||||
const ADB thp_inj_target = ADB::constant(thp_inj_target_v);
|
||||
const ADB thp_prod_target = ADB::constant(thp_prod_target_v);
|
||||
const ADB alq = ADB::constant(alq_v);
|
||||
const ADB bhp_from_thp_inj = vfp_properties_->getInj()->bhp(inj_table_id, aqua, liquid, vapour, thp_inj_target);
|
||||
const ADB bhp_from_thp_prod = vfp_properties_->getProd()->bhp(prod_table_id, aqua, liquid, vapour, thp_prod_target, alq);
|
||||
const ADB bhp_from_thp_inj = vfp_properties_.getInj()->bhp(inj_table_id, aqua, liquid, vapour, thp_inj_target);
|
||||
const ADB bhp_from_thp_prod = vfp_properties_.getProd()->bhp(prod_table_id, aqua, liquid, vapour, thp_prod_target, alq);
|
||||
|
||||
//Perform hydrostatic correction to computed targets
|
||||
//FIXME: Use computeHydrostaticCorrection
|
||||
@@ -1977,10 +1976,10 @@ namespace detail {
|
||||
|
||||
const WellType& well_type = wells().type[w];
|
||||
if (well_type == INJECTOR) {
|
||||
well_state.thp()[w] = vfp_properties_->getInj()->thp(table_id, aqua, liquid, vapour, bhp[w]);
|
||||
well_state.thp()[w] = vfp_properties_.getInj()->thp(table_id, aqua, liquid, vapour, bhp[w]);
|
||||
}
|
||||
else if (well_type == PRODUCER) {
|
||||
well_state.thp()[w] = vfp_properties_->getProd()->thp(table_id, aqua, liquid, vapour, bhp[w], alq);
|
||||
well_state.thp()[w] = vfp_properties_.getProd()->thp(table_id, aqua, liquid, vapour, bhp[w], alq);
|
||||
}
|
||||
else {
|
||||
OPM_THROW(std::logic_error, "Expected INJECTOR or PRODUCER well");
|
||||
|
||||
@@ -192,8 +192,6 @@ namespace Opm
|
||||
RateConverterType rateConverter_;
|
||||
// Threshold pressures.
|
||||
std::vector<double> threshold_pressures_by_face_;
|
||||
//Vertical flow performance tables
|
||||
VFPProperties vfpProperties_;
|
||||
// Whether this a parallel simulation or not
|
||||
bool is_parallel_run_;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,6 @@ namespace Opm
|
||||
output_writer_(output_writer),
|
||||
rateConverter_(props_, std::vector<int>(AutoDiffGrid::numCells(grid_), 0)),
|
||||
threshold_pressures_by_face_(threshold_pressures_by_face),
|
||||
vfpProperties_(eclipse_state->getVFPInjTables(), eclipse_state->getVFPProdTables()),
|
||||
is_parallel_run_( false )
|
||||
{
|
||||
// Misc init.
|
||||
@@ -340,7 +339,6 @@ namespace Opm
|
||||
geo_,
|
||||
rock_comp_props_,
|
||||
wells,
|
||||
&vfpProperties_,
|
||||
solver_,
|
||||
eclipse_state_,
|
||||
has_disgas_,
|
||||
|
||||
Reference in new issue
Block a user