diff --git a/opm/autodiff/AquiferCarterTracy.hpp b/opm/autodiff/AquiferCarterTracy.hpp index d1a655df9..2d4c35dcb 100644 --- a/opm/autodiff/AquiferCarterTracy.hpp +++ b/opm/autodiff/AquiferCarterTracy.hpp @@ -69,21 +69,12 @@ namespace Opm typedef DenseAd::Evaluation Eval; typedef Opm::BlackOilFluidState FluidState; - typedef typename FluidSystem::WaterPvt WaterPvt; - - typedef Ewoms::BlackOilPolymerModule PolymerModule; - static const bool has_solvent = GET_PROP_VALUE(TypeTag, EnableSolvent); - static const bool has_polymer = GET_PROP_VALUE(TypeTag, EnablePolymer); - static const int contiSolventEqIdx = BlackoilIndices::contiSolventEqIdx; - static const int contiPolymerEqIdx = BlackoilIndices::contiPolymerEqIdx; - - explicit AquiferCarterTracy( const AquiferCT::AQUCT_data& params, const Aquancon::AquanconOutput& connection, - const int numComponents, const Scalar gravity, const Simulator& ebosSimulator ) + const Scalar gravity, const Simulator& ebosSimulator ) : phi_aq_ (params.phi_aq), // C_t_ (params.C_t), // r_o_ (params.r_o), // @@ -100,22 +91,12 @@ namespace Opm aquiferID_ (params.aquiferID), inftableID_ (params.inftableID), pvttableID_ (params.pvttableID), - num_components_ (numComponents), gravity_ (gravity), ebos_simulator_ (ebosSimulator) { init_quantities(connection); } - inline const PhaseUsage& - phaseUsage() const - { - assert(phase_usage_); - - return *phase_usage_; - } - - inline void assembleAquiferEq(Simulator& ebosSimulator, const SimulatorTimerInterface& timer) { dt_ = timer.currentStepLength(); @@ -166,10 +147,6 @@ namespace Opm } } - inline const double area_fraction(const size_t i) - { - return alphai_.at(i); - } inline const std::vector cell_id() const { @@ -183,13 +160,11 @@ namespace Opm private: - const PhaseUsage* phase_usage_; const Simulator& ebos_simulator_; // Aquifer ID, and other IDs int aquiferID_, inftableID_, pvttableID_; - int num_components_; // Grid variables @@ -225,6 +200,10 @@ namespace Opm Eval W_flux_; + inline const double area_fraction(const size_t i) + { + return alphai_.at(i); + } inline void get_influence_table_values(Scalar& pitd, Scalar& pitd_prime, const Scalar& td) { @@ -309,13 +288,6 @@ namespace Opm cell_idx_ = connection.global_index; auto globalCellIdx = ugrid.globalCell(); - // for (auto globalCells : globalCellIdx){ - // std::cout << "global id = " << globalCells << std::endl; - // } - - // for (auto cellidx : cell_idx_){ - // std::cout << "aqucell id = " << cellidx << std::endl; - // } assert( cell_idx_ == connection.global_index); assert( (cell_idx_.size() == connection.influx_coeff.size()) ); @@ -332,8 +304,6 @@ namespace Opm auto faceCells = Opm::AutoDiffGrid::faceCells(ugrid); - // static_assert(decltype(faceCells)::dummy_error, "DUMP MY TYPE" ); - // Translate the C face tag into the enum used by opm-parser's TransMult class Opm::FaceDir::DirEnum faceDirection; diff --git a/opm/autodiff/BlackoilAquiferModel.hpp b/opm/autodiff/BlackoilAquiferModel.hpp index 706756ecb..485c3dca6 100644 --- a/opm/autodiff/BlackoilAquiferModel.hpp +++ b/opm/autodiff/BlackoilAquiferModel.hpp @@ -92,19 +92,9 @@ namespace Opm { void assemble( const SimulatorTimerInterface& timer, const int iterationIdx ); - // called at the beginning of a time step - void beginTimeStep(); // called at the end of a time step void timeStepSucceeded(const SimulatorTimerInterface& timer); - // called at the beginning of a report step - void beginReportStep(const int time_step); - - // called at the end of a report step - void endReportStep(); - - const SimulatorReport& lastReport() const; - inline const Simulator& simulator() const { return ebosSimulator_; @@ -119,11 +109,7 @@ namespace Opm { const ModelParameters param_; bool terminal_output_; - bool has_solvent_; - bool has_polymer_; - std::vector pvt_region_idx_; - PhaseUsage phase_usage_; - std::vector active_; + size_t global_nc_; // the number of the cells in the local grid size_t number_of_cells_; @@ -132,23 +118,12 @@ namespace Opm { std::vector aquifers_; - SimulatorReport last_report_; - - void updateConnectionIntensiveQuantities() const; - // The number of components in the model. - int numComponents() const; - int numAquifers() const; - int numPhases() const; - void assembleAquiferEq(const SimulatorTimerInterface& timer); - SimulatorReport solveAquiferEq(const SimulatorTimerInterface& timer); - - // some preparation work, mostly related to group control and RESV, // at the beginning of each time step (Not report step) void prepareTimeStep(const SimulatorTimerInterface& timer); diff --git a/opm/autodiff/BlackoilAquiferModel_impl.hpp b/opm/autodiff/BlackoilAquiferModel_impl.hpp index c75b3f53b..3087d951e 100644 --- a/opm/autodiff/BlackoilAquiferModel_impl.hpp +++ b/opm/autodiff/BlackoilAquiferModel_impl.hpp @@ -9,22 +9,11 @@ namespace Opm { : ebosSimulator_(ebosSimulator) , param_(param) , terminal_output_(terminal_output) - , has_solvent_(GET_PROP_VALUE(TypeTag, EnableSolvent)) - , has_polymer_(GET_PROP_VALUE(TypeTag, EnablePolymer)) { const auto& eclState = ebosSimulator_.vanguard().eclState(); - phase_usage_ = phaseUsageFromDeck(eclState); - - active_.resize(phase_usage_.MaxNumPhases, false); - for (int p = 0; p < phase_usage_.MaxNumPhases; ++p) { - active_[ p ] = phase_usage_.phase_used[ p ] != 0; - } const auto& gridView = ebosSimulator_.gridView(); - // calculate the number of elements of the compressed sequential grid. this needs - // to be done in two steps because the dune communicator expects a reference as - // argument for sum() number_of_cells_ = gridView.size(/*codim=*/0); global_nc_ = gridView.comm().sum(number_of_cells_); gravity_ = ebosSimulator_.problem().gravity()[2]; @@ -32,15 +21,6 @@ namespace Opm { } - - // called at the beginning of a time step - template - void - BlackoilAquiferModel:: beginTimeStep() - { - - } - // called at the end of a time step template void @@ -52,37 +32,12 @@ namespace Opm { } } - // called at the beginning of a report step - template - void - BlackoilAquiferModel:: beginReportStep(const int time_step) - { - - } - - // called at the end of a report step - template - void - BlackoilAquiferModel:: endReportStep() - { - - } - - // Get the last report step - template - const SimulatorReport& - BlackoilAquiferModel:: lastReport() const - { - return last_report_; - } - template void BlackoilAquiferModel:: assemble( const SimulatorTimerInterface& timer, const int iterationIdx ) { - last_report_ = SimulatorReport(); // We need to update the reservoir pressures connected to the aquifer updateConnectionIntensiveQuantities(); @@ -92,12 +47,7 @@ namespace Opm { prepareTimeStep(timer); } - if (param_.solve_aquifereq_initially_ && iterationIdx == 0) { - // solve the aquifer equations as a pre-processing step - last_report_ = solveAquiferEq(timer); - } assembleAquiferEq(timer); - last_report_.converged = true; } @@ -118,32 +68,6 @@ namespace Opm { } - template - SimulatorReport - BlackoilAquiferModel:: solveAquiferEq(const SimulatorTimerInterface& timer) - { - // We need to solve the equilibrium equation first to - // obtain the initial pressure of water in the aquifer - SimulatorReport report = SimulatorReport(); - return report; - } - - // Protected function: Return number of components in the model. - template - int - BlackoilAquiferModel:: numComponents() const - { - if (numPhases() == 2) { - return 2; - } - int numComp = FluidSystem::numComponents; - if (has_solvent_) { - numComp ++; - } - - return numComp; - } - // Protected function: Return number of aquifers in the model. template int @@ -152,14 +76,6 @@ namespace Opm { return aquifers_.size(); } - // Protected function: Return number of phases in the model. - template - int - BlackoilAquiferModel:: numPhases() const - { - const auto& pu = phase_usage_; - return pu.num_phases; - } // Protected function which calls the individual aquifer models template @@ -216,7 +132,7 @@ namespace Opm { for (int i = 0; i < aquifersData.size(); ++i) { aquifers.push_back( - AquiferCarterTracy (aquifersData.at(i), aquifer_connection.at(i), numComponents(), gravity_, ebosSimulator_) + AquiferCarterTracy (aquifersData.at(i), aquifer_connection.at(i), gravity_, ebosSimulator_) ); } } diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 2408bb3cd..4d91fa59d 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -209,7 +209,6 @@ namespace Opm { wasSwitched_.resize(numDof); std::fill(wasSwitched_.begin(), wasSwitched_.end(), false); - aquiferModel().beginTimeStep(); wellModel().beginTimeStep(); if (param_.update_equations_scaling_) { @@ -1127,20 +1126,6 @@ namespace Opm { const BlackoilAquiferModel& aquiferModel() const { return aquifer_model_; } - int ebosPhaseToFlowCanonicalPhaseIdx( const int phaseIdx ) const - { - if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && FluidSystem::waterPhaseIdx == phaseIdx) - return Water; - if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) && FluidSystem::oilPhaseIdx == phaseIdx) - return Oil; - if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) && FluidSystem::gasPhaseIdx == phaseIdx) - return Gas; - - assert(phaseIdx < 3); - // for other phases return the index - return phaseIdx; - } - void beginReportStep() { ebosSimulator_.problem().beginEpisode(); diff --git a/opm/autodiff/BlackoilModelParameters.cpp b/opm/autodiff/BlackoilModelParameters.cpp index 2bd302c2d..f16fc7685 100644 --- a/opm/autodiff/BlackoilModelParameters.cpp +++ b/opm/autodiff/BlackoilModelParameters.cpp @@ -63,7 +63,6 @@ namespace Opm param.getDefault("max_single_precision_days", unit::convert::to( maxSinglePrecisionTimeStep_, unit::day) ), unit::day ); max_strict_iter_ = param.getDefault("max_strict_iter",8); solve_welleq_initially_ = param.getDefault("solve_welleq_initially",solve_welleq_initially_); - solve_aquifereq_initially_ = param.getDefault("solve_aquifereq_initially",solve_aquifereq_initially_); update_equations_scaling_ = param.getDefault("update_equations_scaling", update_equations_scaling_); use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_); deck_file_name_ = param.template get("deck_filename"); @@ -95,7 +94,6 @@ namespace Opm max_inner_iter_ms_wells_ = 10; maxSinglePrecisionTimeStep_ = unit::convert::from( 20.0, unit::day ); solve_welleq_initially_ = true; - solve_aquifereq_initially_ = true; update_equations_scaling_ = false; use_update_stabilization_ = true; use_multisegment_well_ = false; diff --git a/opm/autodiff/BlackoilModelParameters.hpp b/opm/autodiff/BlackoilModelParameters.hpp index d57552161..b01cfdde9 100644 --- a/opm/autodiff/BlackoilModelParameters.hpp +++ b/opm/autodiff/BlackoilModelParameters.hpp @@ -77,9 +77,6 @@ namespace Opm /// Solve well equation initially bool solve_welleq_initially_; - /// Solve aquifer equation initially - bool solve_aquifereq_initially_; - /// Update scaling factors for mass balance equations bool update_equations_scaling_; diff --git a/opm/autodiff/BlackoilTransportModel.hpp b/opm/autodiff/BlackoilTransportModel.hpp index d6610f0d5..ffc0ebc92 100644 --- a/opm/autodiff/BlackoilTransportModel.hpp +++ b/opm/autodiff/BlackoilTransportModel.hpp @@ -86,7 +86,6 @@ namespace Opm { { Base::prepareStep(timer, reservoir_state, well_state); Base::param_.solve_welleq_initially_ = false; - Base::param_.solve_aquifereq_initially_ = false; SolutionState state0 = variableState(reservoir_state, well_state); asImpl().makeConstantState(state0); asImpl().computeAccum(state0, 0); diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp index cb0c66399..bfbbc0e6b 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp @@ -208,8 +208,6 @@ public: well_model.beginReportStep(timer.currentStepNum()); - aquifer_model.beginReportStep(timer.currentStepNum()); - auto solver = createSolver(well_model, aquifer_model); // write the inital state at the report stage @@ -274,7 +272,6 @@ public: } solver->model().endReportStep(); - aquifer_model.endReportStep(); well_model.endReportStep(); // take time that was used to solve system for this reportStep @@ -318,8 +315,6 @@ public: report.total_time = total_timer.secsSinceStart(); report.converged = true; - auto reportaquifer = aquifer_model.lastReport(); - return report; }