From d460952d08c49bb94341e3f821473fe1a9f5b468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 21 Oct 2015 15:27:52 +0200 Subject: [PATCH 1/2] Make SaturationPropsFromDeck work for two-phase cases. --- opm/core/props/satfunc/SaturationPropsFromDeck.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/core/props/satfunc/SaturationPropsFromDeck.cpp b/opm/core/props/satfunc/SaturationPropsFromDeck.cpp index 769ad032..f1b38f03 100644 --- a/opm/core/props/satfunc/SaturationPropsFromDeck.cpp +++ b/opm/core/props/satfunc/SaturationPropsFromDeck.cpp @@ -82,7 +82,7 @@ namespace Opm { assert(cells != 0); - const int np = BlackoilPhases::MaxNumPhases; + const int np = numPhases(); if (dkrds) { ExplicitArraysSatDerivativesFluidState fluidState(phaseUsage_); fluidState.setSaturationArray(s); @@ -141,7 +141,7 @@ namespace Opm { assert(cells != 0); - const int np = BlackoilPhases::MaxNumPhases; + const int np = numPhases(); if (dpcds) { ExplicitArraysSatDerivativesFluidState fluidState(phaseUsage_); typedef ExplicitArraysSatDerivativesFluidState::Evaluation Evaluation; @@ -196,7 +196,7 @@ namespace Opm int gpos = phaseUsage_.phase_pos[BlackoilPhases::Vapour]; int opos = phaseUsage_.phase_pos[BlackoilPhases::Liquid]; - const int np = phaseUsage_.num_phases; + const int np = numPhases(); for (int i = 0; i < n; ++i) { const auto& scaledDrainageInfo = materialLawManager_->oilWaterScaledEpsInfoDrainage(cells[i]); From 62f59fa62451c1e91217affe7b41dd5cff2a166b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 21 Oct 2015 15:28:27 +0200 Subject: [PATCH 2/2] In sim_2p_incomp, avoid running everything twice. There were loops (over all timesteps) both in the main() function and the simulator class. Note: This simulator cannot properly handle changing well configurations, and will now use only the initial configuration (first report step), instead of possibly crashing later. --- examples/sim_2p_incomp.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/sim_2p_incomp.cpp b/examples/sim_2p_incomp.cpp index 97a9fe0e..3104fc46 100644 --- a/examples/sim_2p_incomp.cpp +++ b/examples/sim_2p_incomp.cpp @@ -249,15 +249,17 @@ try // Use timer for last epoch to obtain total time. simtimer.init(timeMap); const double total_time = simtimer.totalTime(); - for (size_t reportStepIdx = 0; reportStepIdx < timeMap->numTimesteps(); ++reportStepIdx) { + // for (size_t reportStepIdx = 0; reportStepIdx < timeMap->numTimesteps(); ++reportStepIdx) { + size_t reportStepIdx = 0; // Only handle a single, unchanging well setup. + { // Update the timer. simtimer.setCurrentStepNum(step); simtimer.setTotalTime(total_time); // Report on start of report step. - std::cout << "\n\n-------------- Starting report step " << reportStepIdx << " --------------" - << "\n (number of time steps: " - << simtimer.numSteps() - step << ")\n\n" << std::flush; + // std::cout << "\n\n-------------- Starting report step " << reportStepIdx << " --------------" + // << "\n (number of time steps: " + // << simtimer.numSteps() - step << ")\n\n" << std::flush; // Create new wells, well_state WellsManager wells(eclipseState , reportStepIdx , *grid->c_grid(), props->permeability());