Merge pull request #1938 from atgeirr/use-foam-module

Use foam module
This commit is contained in:
Atgeirr Flø Rasmussen 2019-08-09 09:54:33 +02:00 committed by GitHub
commit b7a36a6a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 231 additions and 16 deletions

View File

@ -149,6 +149,7 @@ opm_add_test(flow
flow/flow_ebos_gasoil.cpp
flow/flow_ebos_oilwater.cpp
flow/flow_ebos_polymer.cpp
flow/flow_ebos_foam.cpp
flow/flow_ebos_solvent.cpp
flow/flow_ebos_energy.cpp
flow/flow_ebos_oilwater_polymer.cpp

View File

@ -374,6 +374,13 @@ add_test_compareECLFiles(CASENAME nnc
REL_TOL ${rel_tol}
DIR editnnc)
add_test_compareECLFiles(CASENAME spe1_foam
FILENAME SPE1FOAM
SIMULATOR flow
ABS_TOL ${abs_tol}
REL_TOL ${rel_tol}
DIR spe1_foam)
# Restart tests
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-restart-regressionTest.sh "")

View File

@ -46,6 +46,7 @@ public:
typedef Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx> type;
};

View File

@ -46,6 +46,7 @@ public:
typedef Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
};

View File

@ -244,6 +244,8 @@ public:
sSol_.resize(bufferSize, 0.0);
if (GET_PROP_VALUE(TypeTag, EnablePolymer))
cPolymer_.resize(bufferSize, 0.0);
if (GET_PROP_VALUE(TypeTag, EnableFoam))
cFoam_.resize(bufferSize, 0.0);
if (simulator_.problem().vapparsActive())
soMax_.resize(bufferSize, 0.0);
@ -486,6 +488,10 @@ public:
cPolymer_[globalDofIdx] = intQuants.polymerConcentration().value();
}
if (cFoam_.size() > 0) {
cFoam_[globalDofIdx] = intQuants.foamConcentration().value();
}
if (bubblePointPressure_.size() > 0) {
try {
bubblePointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex()));
@ -877,6 +883,9 @@ public:
if (cPolymer_.size() > 0)
sol.insert ("POLYMER", Opm::UnitSystem::measure::identity, std::move(cPolymer_), Opm::data::TargetType::RESTART_SOLUTION);
if (cFoam_.size() > 0)
sol.insert ("FOAM", Opm::UnitSystem::measure::identity, std::move(cFoam_), Opm::data::TargetType::RESTART_SOLUTION);
if (dewPointPressure_.size() > 0)
sol.insert ("PDEW", Opm::UnitSystem::measure::pressure, std::move(dewPointPressure_), Opm::data::TargetType::RESTART_AUXILIARY);
@ -1053,6 +1062,8 @@ public:
}
if (cPolymer_.size() > 0 && sol.has("POLYMER"))
cPolymer_[elemIdx] = sol.data("POLYMER")[globalDofIndex];
if (cFoam_.size() > 0 && sol.has("FOAM"))
cFoam_[elemIdx] = sol.data("FOAM")[globalDofIndex];
if (soMax_.size() > 0 && sol.has("SOMAX"))
soMax_[elemIdx] = sol.data("SOMAX")[globalDofIndex];
if (pcSwMdcOw_.size() > 0 &&sol.has("PCSWM_OW"))
@ -1135,7 +1146,7 @@ public:
Scalar getSolventSaturation(unsigned elemIdx) const
{
if (sSol_.size() > 0)
if (sSol_.size() > elemIdx)
return sSol_[elemIdx];
return 0;
@ -1143,12 +1154,20 @@ public:
Scalar getPolymerConcentration(unsigned elemIdx) const
{
if (cPolymer_.size() > 0)
if (cPolymer_.size() > elemIdx)
return cPolymer_[elemIdx];
return 0;
}
Scalar getFoamConcentration(unsigned elemIdx) const
{
if (cFoam_.size() > elemIdx)
return cFoam_[elemIdx];
return 0;
}
const std::map<std::pair<std::string, int>, double>& getBlockData()
{ return blockData_; }
@ -1459,6 +1478,7 @@ private:
ScalarBuffer relativePermeability_[numPhases];
ScalarBuffer sSol_;
ScalarBuffer cPolymer_;
ScalarBuffer cFoam_;
ScalarBuffer soMax_;
ScalarBuffer pcSwMdcOw_;
ScalarBuffer krnSwMdcOw_;

View File

@ -352,6 +352,7 @@ SET_BOOL_PROP(EclBaseProblem, EnableTemperature, true);
SET_BOOL_PROP(EclBaseProblem, EnablePolymer, false);
SET_BOOL_PROP(EclBaseProblem, EnableSolvent, false);
SET_BOOL_PROP(EclBaseProblem, EnableEnergy, false);
SET_BOOL_PROP(EclBaseProblem, EnableFoam, false);
// disable thermal flux boundaries by default
SET_BOOL_PROP(EclBaseProblem, EnableThermalFluxBoundaries, false);
@ -403,6 +404,7 @@ class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enablePolymerMolarWeight = GET_PROP_VALUE(TypeTag, EnablePolymerMW) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { enableThermalFluxBoundaries = GET_PROP_VALUE(TypeTag, EnableThermalFluxBoundaries) };
@ -435,6 +437,7 @@ class EclProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef BlackOilSolventModule<TypeTag> SolventModule;
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
typedef BlackOilFoamModule<TypeTag> FoamModule;
typedef typename EclEquilInitializer<TypeTag>::ScalarFluidState InitialFluidState;
@ -595,6 +598,7 @@ public:
const auto& vanguard = simulator.vanguard();
SolventModule::initFromDeck(vanguard.deck(), vanguard.eclState());
PolymerModule::initFromDeck(vanguard.deck(), vanguard.eclState());
FoamModule::initFromDeck(vanguard.deck(), vanguard.eclState());
// create the ECL writer
eclWriter_.reset(new EclWriterType(simulator));

View File

@ -25,6 +25,7 @@
#include <flow/flow_ebos_oilwater.hpp>
#include <flow/flow_ebos_solvent.hpp>
#include <flow/flow_ebos_polymer.hpp>
#include <flow/flow_ebos_foam.hpp>
#include <flow/flow_ebos_energy.hpp>
#include <flow/flow_ebos_oilwater_polymer.hpp>
#include <flow/flow_ebos_oilwater_polymer_injectivity.hpp>
@ -271,6 +272,11 @@ int main(int argc, char** argv)
return Opm::flowEbosPolymerMain(argc, argv);
}
}
// Foam case
else if ( phases.active( Opm::Phase::FOAM ) ) {
Opm::flowEbosFoamSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
return Opm::flowEbosFoamMain(argc, argv);
}
// Solvent case
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
Opm::flowEbosSolventSetDeck(externalSetupTimer.elapsed(), *deck, *eclipseState, *schedule, *summaryConfig);
@ -289,7 +295,7 @@ int main(int argc, char** argv)
else
{
if (outputCout)
std::cerr << "No suitable configuration found, valid are Twophase, polymer, solvent, energy, or blackoil" << std::endl;
std::cerr << "No suitable configuration found, valid are Twophase, polymer, foam, solvent, energy, blackoil." << std::endl;
return EXIT_FAILURE;
}
}

70
flow/flow_ebos_foam.cpp Normal file
View File

@ -0,0 +1,70 @@
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <flow/flow_ebos_foam.hpp>
#include <opm/material/common/ResetLocale.hpp>
#include <opm/grid/CpGrid.hpp>
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
#include <opm/simulators/flow/FlowMainEbos.hpp>
#if HAVE_DUNE_FEM
#include <dune/fem/misc/mpimanager.hh>
#else
#include <dune/common/parallel/mpihelper.hh>
#endif
namespace Ewoms {
namespace Properties {
NEW_TYPE_TAG(EclFlowFoamProblem, INHERITS_FROM(EclFlowProblem));
SET_BOOL_PROP(EclFlowFoamProblem, EnableFoam, true);
}}
namespace Opm {
void flowEbosFoamSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
{
typedef TTAG(EclFlowFoamProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalSetupTime(setupTime);
Vanguard::setExternalDeck(&deck);
Vanguard::setExternalEclState(&eclState);
Vanguard::setExternalSchedule(&schedule);
Vanguard::setExternalSummaryConfig(&summaryConfig);
}
// ----------------- Main program -----------------
int flowEbosFoamMain(int argc, char** argv)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
Opm::resetLocale();
// initialize MPI, finalize is done automatically on exit
#if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv);
#else
Dune::MPIHelper::instance(argc, argv).rank();
#endif
Opm::FlowMainEbos<TTAG(EclFlowFoamProblem)> mainfunc;
return mainfunc.execute(argc, argv);
}
}

31
flow/flow_ebos_foam.hpp Normal file
View File

@ -0,0 +1,31 @@
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FLOW_EBOS_FOAM_HPP
#define FLOW_EBOS_FOAM_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosFoamSetDeck(double setupTime, Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig);
int flowEbosFoamMain(int argc, char** argv);
}
#endif // FLOW_EBOS_FOAM_HPP

View File

@ -52,6 +52,7 @@ public:
typedef Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::waterCompIdx> type;
};

View File

@ -52,6 +52,7 @@ public:
typedef Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
};

View File

@ -53,6 +53,7 @@ public:
typedef Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
};

View File

@ -55,6 +55,7 @@ public:
typedef Ewoms::BlackOilTwoPhaseIndices<0,
2,
0,
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
};

View File

@ -33,11 +33,11 @@ namespace Opm
// sense that they can be active or not and canonical indices can be translated
// to and from active ones. That said, they are not considered by num_phases or
// MaxNumPhases. The crypto phases which are currently implemented are solvent,
// polymer, energy and polymer molecular weight.
static const int NumCryptoPhases = 4;
// polymer, energy, polymer molecular weight and foam.
static const int NumCryptoPhases = 5;
// enum ComponentIndex { Water = 0, Oil = 1, Gas = 2 };
enum PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2, Solvent = 3, Polymer = 4, Energy = 5, PolymerMW = 6 };
enum PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2, Solvent = 3, Polymer = 4, Energy = 5, PolymerMW = 6, Foam = 7 };
};
struct PhaseUsage : public BlackoilPhases
@ -50,6 +50,7 @@ namespace Opm
bool has_energy;
// polymer molecular weight
bool has_polymermw;
bool has_foam;
};
/// Check or assign presence of a formed, free phase. Limited to

View File

@ -119,6 +119,15 @@ namespace Opm
else
pu.phase_pos[BlackoilPhases::PolymerMW] = -1;
// Add foam info
pu.has_foam = phases.active(Phase::FOAM);
if (pu.has_foam) {
pu.phase_pos[BlackoilPhases::Foam] = numActivePhases;
++ numActivePhases;
}
else
pu.phase_pos[BlackoilPhases::Foam] = -1;
return pu;
}

View File

@ -83,6 +83,7 @@ SET_BOOL_PROP(EclFlowProblem, EnablePolymer, false);
SET_BOOL_PROP(EclFlowProblem, EnableSolvent, false);
SET_BOOL_PROP(EclFlowProblem, EnableTemperature, true);
SET_BOOL_PROP(EclFlowProblem, EnableEnergy, false);
SET_BOOL_PROP(EclFlowProblem, EnableFoam, false);
SET_TYPE_PROP(EclFlowProblem, EclWellModel, Opm::BlackoilWellModel<TypeTag>);
SET_TAG_PROP(EclFlowProblem, LinearSolverSplice, FlowIstlSolver);
@ -122,10 +123,12 @@ namespace Opm {
static const int contiPolymerEqIdx = Indices::contiPolymerEqIdx;
static const int contiEnergyEqIdx = Indices::contiEnergyEqIdx;
static const int contiPolymerMWEqIdx = Indices::contiPolymerMWEqIdx;
static const int contiFoamEqIdx = Indices::contiFoamEqIdx;
static const int solventSaturationIdx = Indices::solventSaturationIdx;
static const int polymerConcentrationIdx = Indices::polymerConcentrationIdx;
static const int polymerMoleWeightIdx = Indices::polymerMoleWeightIdx;
static const int temperatureIdx = Indices::temperatureIdx;
static const int foamConcentrationIdx = Indices::foamConcentrationIdx;
typedef Dune::FieldVector<Scalar, numEq > VectorBlockType;
typedef typename SparseMatrixAdapter::MatrixBlock MatrixBlockType;
@ -160,6 +163,7 @@ namespace Opm {
, has_polymer_(GET_PROP_VALUE(TypeTag, EnablePolymer))
, has_polymermw_(GET_PROP_VALUE(TypeTag, EnablePolymerMW))
, has_energy_(GET_PROP_VALUE(TypeTag, EnableEnergy))
, has_foam_(GET_PROP_VALUE(TypeTag, EnableFoam))
, param_( param )
, well_model_ (well_model)
, terminal_output_ (terminal_output)
@ -620,6 +624,12 @@ namespace Opm {
R_sum[ contiPolymerEqIdx ] += R2;
maxCoeff[ contiPolymerEqIdx ] = std::max( maxCoeff[ contiPolymerEqIdx ], std::abs( R2 ) / pvValue );
}
if (has_foam_ ) {
B_avg[ contiFoamEqIdx ] += 1.0 / fs.invB(FluidSystem::gasPhaseIdx).value();
const auto R2 = ebosResid[cell_idx][contiFoamEqIdx];
R_sum[ contiFoamEqIdx ] += R2;
maxCoeff[ contiFoamEqIdx ] = std::max( maxCoeff[ contiFoamEqIdx ], std::abs( R2 ) / pvValue );
}
if (has_polymermw_) {
assert(has_polymer_);
@ -706,6 +716,9 @@ namespace Opm {
if (has_energy_) {
compNames[temperatureIdx] = "Energy";
}
if (has_foam_) {
compNames[foamConcentrationIdx] = "Foam";
}
}
// Create convergence report.
@ -857,6 +870,7 @@ namespace Opm {
const bool has_polymer_;
const bool has_polymermw_;
const bool has_energy_;
const bool has_foam_;
ModelParameters param_;
SimulatorReport failureReport_;

View File

@ -28,6 +28,10 @@
#include <opm/simulators/wells/WellInterface.hpp>
#include <opm/simulators/linalg/ISTLSolverEbos.hpp>
#include <ewoms/models/blackoil/blackoilpolymermodules.hh>
#include <ewoms/models/blackoil/blackoilsolventmodules.hh>
#include <ewoms/models/blackoil/blackoilfoammodules.hh>
#include <opm/material/densead/DynamicEvaluation.hpp>
#include <dune/common/dynvector.hh>
@ -53,22 +57,26 @@ namespace Opm
using typename Base::MaterialLaw;
using typename Base::ModelParameters;
using typename Base::Indices;
using typename Base::PolymerModule;
using typename Base::RateConverterType;
using Base::numEq;
using Base::has_solvent;
using Base::has_polymer;
using Base::has_foam;
using Base::has_energy;
using PolymerModule = Ewoms::BlackOilPolymerModule<TypeTag>;
using FoamModule = Ewoms::BlackOilFoamModule<TypeTag>;
// polymer concentration and temperature are already known by the well, so
// polymer and energy conservation do not need to be considered explicitly
static const int numPolymerEq = Indices::numPolymers;
static const int numEnergyEq = Indices::numEnergy;
static const int numFoamEq = Indices::numFoam;
// number of the conservation equations
static const int numWellConservationEq = numEq - numPolymerEq - numEnergyEq;
static const int numWellConservationEq = numEq - numPolymerEq - numEnergyEq - numFoamEq;
// number of the well control equations
static const int numWellControlEq = 1;
// number of the well equations that will always be used
@ -126,6 +134,7 @@ namespace Opm
using Base::contiSolventEqIdx;
using Base::contiPolymerEqIdx;
using Base::contiFoamEqIdx;
static const int contiEnergyEqIdx = Indices::contiEnergyEqIdx;
StandardWell(const Well2& well, const int time_step, const Wells* wells,
@ -199,6 +208,7 @@ namespace Opm
using Base::ebosCompIdxToFlowCompIdx;
using Base::wsolvent;
using Base::wpolymer;
using Base::wfoam;
using Base::wellHasTHPConstraints;
using Base::mostStrictBhpFromBhpLimits;
using Base::scalingFactor;

View File

@ -643,6 +643,18 @@ namespace Opm
}
}
if (has_foam) {
// TODO: the application of well efficiency factor has not been tested with an example yet
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
EvalWell cq_s_foam = cq_s[gasCompIdx] * well_efficiency_factor_;
if (well_type_ == INJECTOR) {
cq_s_foam *= wfoam();
} else {
cq_s_foam *= extendEval(intQuants.foamConcentration());
}
connectionRates_[perf][contiFoamEqIdx] = Base::restrictEval(cq_s_foam);
}
// Store the perforation pressure for later usage.
well_state.perfPress()[first_perf_ + perf] = well_state.bhp()[index_of_well_] + perf_pressure_diffs_[perf];
@ -1973,8 +1985,8 @@ namespace Opm
Opm::DeferredLogger& deferred_logger) const
{
// the following implementation assume that the polymer is always after the w-o-g phases
// For the polymer case and the energy case, there is one more mass balance equations of reservoir than wells
assert((int(B_avg.size()) == num_components_) || has_polymer || has_energy);
// For the polymer, energy and foam cases, there is one more mass balance equations of reservoir than wells
assert((int(B_avg.size()) == num_components_) || has_polymer || has_energy || has_foam);
const double tol_wells = param_.tolerance_wells_;
const double maxResidualAllowed = param_.max_residual_allowed_;

View File

@ -47,9 +47,6 @@
#include <opm/simulators/timestepping/ConvergenceReport.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <ewoms/models/blackoil/blackoilpolymermodules.hh>
#include <ewoms/models/blackoil/blackoilsolventmodules.hh>
#include<dune/common/fmatrix.hh>
#include<dune/istl/bcrsmatrix.hh>
#include<dune/istl/matrixmatrix.hh>
@ -97,19 +94,19 @@ namespace Opm
typedef Dune::BlockVector<VectorBlockType> BVector;
typedef DenseAd::Evaluation<double, /*size=*/numEq> Eval;
typedef Ewoms::BlackOilPolymerModule<TypeTag> PolymerModule;
static const bool has_solvent = GET_PROP_VALUE(TypeTag, EnableSolvent);
static const bool has_polymer = GET_PROP_VALUE(TypeTag, EnablePolymer);
static const bool has_energy = GET_PROP_VALUE(TypeTag, EnableEnergy);
// flag for polymer molecular weight related
static const bool has_polymermw = GET_PROP_VALUE(TypeTag, EnablePolymerMW);
static const bool has_foam = GET_PROP_VALUE(TypeTag, EnableFoam);
static const int contiSolventEqIdx = Indices::contiSolventEqIdx;
static const int contiPolymerEqIdx = Indices::contiPolymerEqIdx;
// index for the polymer molecular weight continuity equation
static const int contiPolymerMWEqIdx = Indices::contiPolymerMWEqIdx;
static const int contiFoamEqIdx = Indices::contiFoamEqIdx;
// For the conversion between the surface volume rate and resrevoir voidage rate
// For the conversion between the surface volume rate and reservoir voidage rate
using RateConverterType = RateConverter::
SurfaceToReservoirVoidage<FluidSystem, std::vector<int> >;
@ -366,6 +363,8 @@ namespace Opm
double wpolymer() const;
double wfoam() const;
bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits,
const WellState& well_state,
Opm::DeferredLogger& deferred_logger) const;

View File

@ -350,6 +350,30 @@ namespace Opm
template<typename TypeTag>
double
WellInterface<TypeTag>::
wfoam() const
{
if (!has_foam) {
return 0.0;
}
auto injectorType = well_ecl_.injectorType();
if (injectorType == WellInjector::GAS) {
WellFoamProperties fprop = well_ecl_.getFoamProperties();
return fprop.m_foamConcentration;
} else {
// Not a gas injection well => no foam.
return 0.0;
}
}
template<typename TypeTag>
double
WellInterface<TypeTag>::

View File

@ -65,6 +65,7 @@ tests[editnnc_model2]="flow model2 9_EDITNNC_MODEL2 editnnc_model2"
tests[polymer_injectivity]="flow polymer_injectivity 2D_POLYMER_INJECTIVITY"
tests[nnc]="flow editnnc NNC_AND_EDITNNC nnc"
tests[udq]="flow udq_actionx UDQ_WCONPROD"
tests[spe1_foam]="flow spe1_foam SPE1FOAM"
changed_tests=""
for test_name in ${!tests[*]}