Merge pull request #1450 from GitPaean/update_VFP_related

adapting to the change related to VFP from the parser.
This commit is contained in:
Atgeirr Flø Rasmussen 2018-04-12 11:20:21 +02:00 committed by GitHub
commit 63dabb4777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 38 additions and 30 deletions

View File

@ -116,8 +116,8 @@ typedef Eigen::Array<double,
, geo_ (geo) , geo_ (geo)
, rock_comp_props_(rock_comp_props) , rock_comp_props_(rock_comp_props)
, vfp_properties_( , vfp_properties_(
eclState->getTableManager().getVFPInjTables(), schedule->getVFPInjTables(well_model.currentStep()),
eclState->getTableManager().getVFPProdTables()) schedule->getVFPProdTables(well_model.currentStep() ) )
, linsolver_ (linsolver) , linsolver_ (linsolver)
, active_(detail::activePhases(fluid.phaseUsage())) , active_(detail::activePhases(fluid.phaseUsage()))
, canph_ (detail::active2Canonical(fluid.phaseUsage())) , canph_ (detail::active2Canonical(fluid.phaseUsage()))

View File

@ -170,9 +170,6 @@ namespace Opm {
using WellInterfacePtr = std::unique_ptr<WellInterface<TypeTag> >; using WellInterfacePtr = std::unique_ptr<WellInterface<TypeTag> >;
// a vector of all the wells. // a vector of all the wells.
// eventually, the wells_ above should be gone.
// the name is just temporary
// later, might make share_ptr const later.
std::vector<WellInterfacePtr > well_container_; std::vector<WellInterfacePtr > well_container_;
using ConvergenceReport = typename WellInterface<TypeTag>::ConvergenceReport; using ConvergenceReport = typename WellInterface<TypeTag>::ConvergenceReport;

View File

@ -128,10 +128,14 @@ namespace Opm {
} }
} }
// compute VFP properties // update VFP properties
vfp_properties_.reset (new VFPProperties ( vfp_properties_.reset (new VFPProperties (
eclState.getTableManager().getVFPInjTables(), schedule().getVFPInjTables(timeStepIdx),
eclState.getTableManager().getVFPProdTables()) ); schedule().getVFPProdTables(timeStepIdx)) );
for (auto& well : well_container_) {
well->setVFPProperties(vfp_properties_.get());
}
// update the previous well state. This is used to restart failed steps. // update the previous well state. This is used to restart failed steps.
previous_well_state_ = well_state_; previous_well_state_ = well_state_;

View File

@ -201,7 +201,7 @@ namespace Opm
// Run a multiple steps of the solver depending on the time step control. // Run a multiple steps of the solver depending on the time step control.
solver_timer.start(); solver_timer.start();
const WellModel well_model(wells, &(wells_manager.wellCollection())); const WellModel well_model(wells, &(wells_manager.wellCollection()), timer.currentStepNum());
std::unique_ptr<Solver> solver = asImpl().createSolver(well_model); std::unique_ptr<Solver> solver = asImpl().createSolver(well_model);

View File

@ -2123,7 +2123,7 @@ namespace Opm
const auto row_index = colC.index(); const auto row_index = colC.index();
auto& row = mat[row_index]; auto& row = mat[row_index];
auto col = row.begin(); auto col = row.begin();
for ( auto colB = duneB_[0].begin(), endB = duneB_[0].end(); colB != endB; ++colB ) for ( auto colB = duneB_[0].begin(), endB = duneB_[0].end(); colB != endB; ++colB )
{ {
const auto col_index = colB.index(); const auto col_index = colB.index();

View File

@ -71,7 +71,7 @@ namespace Opm {
Eigen::Dynamic, Eigen::Dynamic,
Eigen::RowMajor>; Eigen::RowMajor>;
// --------- Public methods --------- // --------- Public methods ---------
StandardWells(const Wells* wells_arg, WellCollection* well_collection); StandardWells(const Wells* wells_arg, WellCollection* well_collection, const int current_step);
void init(const BlackoilPropsAdFromDeck* fluid_arg, void init(const BlackoilPropsAdFromDeck* fluid_arg,
const std::vector<bool>* active_arg, const std::vector<bool>* active_arg,
@ -203,6 +203,8 @@ namespace Opm {
template<class WellState> template<class WellState>
const WellState& wellState(const WellState& well_state) const { return well_state; } const WellState& wellState(const WellState& well_state) const { return well_state; }
int currentStep() const;
protected: protected:
bool wells_active_; bool wells_active_;
@ -211,6 +213,8 @@ namespace Opm {
// It will probably need to be updated during running time. // It will probably need to be updated during running time.
WellCollection* well_collection_; WellCollection* well_collection_;
const int current_step_;
// The efficiency factor for each connection // The efficiency factor for each connection
// It is specified based on wells and groups // It is specified based on wells and groups
// By default, they should all be one. // By default, they should all be one.

View File

@ -71,11 +71,12 @@ namespace Opm
StandardWells::StandardWells(const Wells* wells_arg, WellCollection* well_collection) StandardWells::StandardWells(const Wells* wells_arg, WellCollection* well_collection, const int current_step)
: wells_active_(wells_arg!=nullptr) : wells_active_(wells_arg!=nullptr)
, wells_(wells_arg) , wells_(wells_arg)
, wops_(wells_arg) , wops_(wells_arg)
, well_collection_(well_collection) , well_collection_(well_collection)
, current_step_(current_step)
, well_perforation_efficiency_factors_(Vector::Ones(wells_!=nullptr ? wells_->well_connpos[wells_->number_of_wells] : 0)) , well_perforation_efficiency_factors_(Vector::Ones(wells_!=nullptr ? wells_->well_connpos[wells_->number_of_wells] : 0))
, fluid_(nullptr) , fluid_(nullptr)
, active_(nullptr) , active_(nullptr)
@ -1544,6 +1545,15 @@ namespace Opm
int StandardWells::currentStep() const
{
return current_step_;
}
template <class WellState> template <class WellState>
void void
StandardWells:: StandardWells::

View File

@ -22,8 +22,8 @@
#define OPM_AUTODIFF_VFPHELPERS_HPP_ #define OPM_AUTODIFF_VFPHELPERS_HPP_
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/VFPInjTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp>
#include <opm/autodiff/AutoDiffHelpers.hpp> #include <opm/autodiff/AutoDiffHelpers.hpp>
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/material/densead/Evaluation.hpp> #include <opm/material/densead/Evaluation.hpp>

View File

@ -24,7 +24,6 @@
#include "config.h" #include "config.h"
#include <opm/autodiff/VFPInjProperties.hpp> #include <opm/autodiff/VFPInjProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp>
#include <opm/core/props/BlackoilPhases.hpp> #include <opm/core/props/BlackoilPhases.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/common/ErrorMacros.hpp>
#include <opm/autodiff/AutoDiffBlock.hpp> #include <opm/autodiff/AutoDiffBlock.hpp>
@ -64,7 +63,7 @@ VFPInjProperties::VFPInjProperties(const VFPInjTable* table){
VFPInjProperties::VFPInjProperties(const std::map<int, VFPInjTable>& tables) { VFPInjProperties::VFPInjProperties(const std::map<int, VFPInjTable>& tables) {
for (const auto& table : tables) { for (const auto& table : tables) {
m_tables[table.first] = &table.second; m_tables[table.first] = &(table.second);
} }
} }

View File

@ -20,7 +20,7 @@
#ifndef OPM_AUTODIFF_VFPINJPROPERTIES_HPP_ #ifndef OPM_AUTODIFF_VFPINJPROPERTIES_HPP_
#define OPM_AUTODIFF_VFPINJPROPERTIES_HPP_ #define OPM_AUTODIFF_VFPINJPROPERTIES_HPP_
#include <opm/parser/eclipse/EclipseState/Tables/VFPInjTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp>
#include <opm/core/wells.h> #include <opm/core/wells.h>
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/material/densead/Evaluation.hpp> #include <opm/material/densead/Evaluation.hpp>

View File

@ -20,7 +20,6 @@
#include "config.h" #include "config.h"
#include <opm/autodiff/VFPProdProperties.hpp> #include <opm/autodiff/VFPProdProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp>
#include <opm/core/props/BlackoilPhases.hpp> #include <opm/core/props/BlackoilPhases.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/common/ErrorMacros.hpp>
#include <opm/autodiff/AutoDiffBlock.hpp> #include <opm/autodiff/AutoDiffBlock.hpp>
@ -51,7 +50,7 @@ VFPProdProperties::VFPProdProperties(const VFPProdTable* table){
VFPProdProperties::VFPProdProperties(const std::map<int, VFPProdTable>& tables) { VFPProdProperties::VFPProdProperties(const std::map<int, VFPProdTable>& tables) {
for (const auto& table : tables) { for (const auto& table : tables) {
m_tables[table.first] = &table.second; m_tables[table.first] = &(table.second);
} }
} }

View File

@ -20,7 +20,7 @@
#ifndef OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_ #ifndef OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_
#define OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_ #define OPM_AUTODIFF_VFPPRODPROPERTIES_HPP_
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
#include <opm/core/wells.h> #include <opm/core/wells.h>
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/material/densead/Evaluation.hpp> #include <opm/material/densead/Evaluation.hpp>

View File

@ -20,8 +20,8 @@
#ifndef OPM_AUTODIFF_VFPPROPERTIES_HPP_ #ifndef OPM_AUTODIFF_VFPPROPERTIES_HPP_
#define OPM_AUTODIFF_VFPPROPERTIES_HPP_ #define OPM_AUTODIFF_VFPPROPERTIES_HPP_
#include <opm/parser/eclipse/EclipseState/Tables/VFPInjTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
#include <map> #include <map>

View File

@ -39,7 +39,7 @@
#include <opm/parser/eclipse/Parser/Parser.hpp> #include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp> #include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp> #include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/autodiff/VFPProperties.hpp> #include <opm/autodiff/VFPProperties.hpp>
@ -372,9 +372,6 @@ struct TrivialFixture {
} }
inline void initTable() {
}
inline void initProperties() { inline void initProperties() {
//Initialize table //Initialize table
table.init(table_ids[0], table.init(table_ids[0],
@ -1047,8 +1044,7 @@ VFPPROD \n\
BOOST_REQUIRE(deck.hasKeyword("VFPPROD")); BOOST_REQUIRE(deck.hasKeyword("VFPPROD"));
BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1); BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1);
Opm::VFPProdTable table; Opm::VFPProdTable table(deck.getKeyword("VFPPROD", 0), units);
table.init(deck.getKeyword("VFPPROD", 0), units);
Opm::VFPProdProperties properties(&table); Opm::VFPProdProperties properties(&table);
@ -1110,8 +1106,7 @@ BOOST_AUTO_TEST_CASE(ParseInterpolateRealisticVFPPROD)
BOOST_REQUIRE(deck.hasKeyword("VFPPROD")); BOOST_REQUIRE(deck.hasKeyword("VFPPROD"));
BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1); BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1);
Opm::VFPProdTable table; Opm::VFPProdTable table(deck.getKeyword("VFPPROD", 0), units);
table.init(deck.getKeyword("VFPPROD", 0), units);
Opm::VFPProdProperties properties(&table); Opm::VFPProdProperties properties(&table);