Whitespace fixes (tabs->spaces, reformatted new files).

This commit is contained in:
Atgeirr Flø Rasmussen 2019-10-11 15:57:51 +02:00
parent 0b9b20695c
commit 5211217c94
12 changed files with 196 additions and 182 deletions

View File

@ -43,7 +43,7 @@ SET_PROP(EclFlowProblemSimple, FluidState)
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation; typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
static const bool compositionSwitchEnabled = Indices::gasEnabled; static const bool compositionSwitchEnabled = Indices::gasEnabled;
public: public:
//typedef Opm::BlackOilFluidSystemSimple<Scalar> type; //typedef Opm::BlackOilFluidSystemSimple<Scalar> type;
typedef Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, Indices::numPhases > type; typedef Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, Indices::numPhases > type;
@ -89,7 +89,7 @@ namespace Opm {
#endif #endif
SET_BOOL_PROP(EclFlowProblemSimple, EnableStorageCache, true); SET_BOOL_PROP(EclFlowProblemSimple, EnableStorageCache, true);
SET_BOOL_PROP(EclFlowProblemSimple, EnableIntensiveQuantityCache, true); SET_BOOL_PROP(EclFlowProblemSimple, EnableIntensiveQuantityCache, true);
//SET_INT_PROP(EclFlowProblemSimple, NumWellAdjoint, 1); //SET_INT_PROP(EclFlowProblemSimple, NumWellAdjoint, 1);
//SET_BOOL_PROP(EclFlowProblem, EnableStorageCache, true); //SET_BOOL_PROP(EclFlowProblem, EnableStorageCache, true);
//SET_BOOL_PROP(EclFlowProblem, EnableIntensiveQuantityCache, true); //SET_BOOL_PROP(EclFlowProblem, EnableIntensiveQuantityCache, true);
@ -98,6 +98,6 @@ namespace Opm {
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
typedef TTAG(EclFlowProblemSimple) TypeTag; typedef TTAG(EclFlowProblemSimple) TypeTag;
return mainFlow<TypeTag>(argc, argv); return mainFlow<TypeTag>(argc, argv);
} }

View File

@ -24,61 +24,68 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem)); NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem));
NEW_PROP_TAG(FluidState); NEW_PROP_TAG(FluidState);
NEW_PROP_TAG(FluidSystem); NEW_PROP_TAG(FluidSystem);
//! The indices required by the model //! The indices required by the model
SET_PROP(EclFlowProblemSimple, Indices) SET_PROP(EclFlowProblemSimple, Indices)
{ {
private: private:
// it is unfortunately not possible to simply use 'TypeTag' here because this leads // it is unfortunately not possible to simply use 'TypeTag' here because this leads
// to cyclic definitions of some properties. if this happens the compiler error // to cyclic definitions of some properties. if this happens the compiler error
// messages unfortunately are *really* confusing and not really helpful. // messages unfortunately are *really* confusing and not really helpful.
typedef TTAG(EclFlowProblem) BaseTypeTag; typedef TTAG(EclFlowProblem) BaseTypeTag;
typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem;
public:
typedef Ewoms::BlackOilOnePhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*enebledCompIdx=*/FluidSystem::waterCompIdx> type;
};
SET_PROP(EclFlowProblemSimple, FluidState)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
static const bool compositionSwitchEnabled = Indices::gasEnabled;
public:
//typedef Opm::BlackOilFluidSystemSimple<Scalar> type;
typedef Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, Indices::numPhases > type;
};
// SET_PROP(EclFlowProblemSimple, FluidSystem) public:
// { typedef Ewoms::BlackOilOnePhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
// private: GET_PROP_VALUE(TypeTag, EnablePolymer),
// //typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; GET_PROP_VALUE(TypeTag, EnableEnergy),
// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; GET_PROP_VALUE(TypeTag, EnableFoam),
// typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation; /*PVOffset=*/0,
// typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; /*enebledCompIdx=*/FluidSystem::waterCompIdx>
type;
// public: };
// typedef Opm::BlackOilFluidSystem<Scalar,Indices> type; SET_PROP(EclFlowProblemSimple, FluidState)
// }; {
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
static const bool compositionSwitchEnabled = Indices::gasEnabled;
public:
// typedef Opm::BlackOilFluidSystemSimple<Scalar> type;
typedef Opm::BlackOilFluidState<Evaluation,
FluidSystem,
enableTemperature,
enableEnergy,
compositionSwitchEnabled,
Indices::numPhases>
type;
};
// SET_PROP(EclFlowProblemSimple, FluidSystem)
// {
// private:
// //typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
// typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
// public:
// typedef Opm::BlackOilFluidSystem<Scalar,Indices> type;
// };
END_PROPERTIES END_PROPERTIES
int main(int argc, char** argv) int
main(int argc, char** argv)
{ {
typedef TTAG(EclFlowProblemSimple) TypeTag; typedef TTAG(EclFlowProblemSimple) TypeTag;
return mainFlow<TypeTag>(argc, argv); return mainFlow<TypeTag>(argc, argv);
} }

View File

@ -24,63 +24,70 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem)); NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem));
SET_BOOL_PROP(EclFlowProblemSimple, EnableEnergy, true); SET_BOOL_PROP(EclFlowProblemSimple, EnableEnergy, true);
NEW_PROP_TAG(FluidState); NEW_PROP_TAG(FluidState);
NEW_PROP_TAG(FluidSystem); NEW_PROP_TAG(FluidSystem);
//! The indices required by the model //! The indices required by the model
SET_PROP(EclFlowProblemSimple, Indices) SET_PROP(EclFlowProblemSimple, Indices)
{ {
private: private:
// it is unfortunately not possible to simply use 'TypeTag' here because this leads // it is unfortunately not possible to simply use 'TypeTag' here because this leads
// to cyclic definitions of some properties. if this happens the compiler error // to cyclic definitions of some properties. if this happens the compiler error
// messages unfortunately are *really* confusing and not really helpful. // messages unfortunately are *really* confusing and not really helpful.
typedef TTAG(EclFlowProblem) BaseTypeTag; typedef TTAG(EclFlowProblem) BaseTypeTag;
typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem; typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem;
public:
typedef Ewoms::BlackOilOnePhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
/*PVOffset=*/0,
/*enebledCompIdx=*/FluidSystem::waterCompIdx> type;
};
SET_PROP(EclFlowProblemSimple, FluidState)
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
static const bool compositionSwitchEnabled = Indices::gasEnabled;
public:
//typedef Opm::BlackOilFluidSystemSimple<Scalar> type;
typedef Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, Indices::numPhases > type;
};
// SET_PROP(EclFlowProblemSimple, FluidSystem) public:
// { typedef Ewoms::BlackOilOnePhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
// private: GET_PROP_VALUE(TypeTag, EnablePolymer),
// //typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; GET_PROP_VALUE(TypeTag, EnableEnergy),
// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; GET_PROP_VALUE(TypeTag, EnableFoam),
// typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation; /*PVOffset=*/0,
// typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; /*enebledCompIdx=*/FluidSystem::waterCompIdx>
type;
// public: };
// typedef Opm::BlackOilFluidSystem<Scalar,Indices> type; SET_PROP(EclFlowProblemSimple, FluidState)
// }; {
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
static const bool compositionSwitchEnabled = Indices::gasEnabled;
public:
// typedef Opm::BlackOilFluidSystemSimple<Scalar> type;
typedef Opm::BlackOilFluidState<Evaluation,
FluidSystem,
enableTemperature,
enableEnergy,
compositionSwitchEnabled,
Indices::numPhases>
type;
};
// SET_PROP(EclFlowProblemSimple, FluidSystem)
// {
// private:
// //typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
// typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
// typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
// public:
// typedef Opm::BlackOilFluidSystem<Scalar,Indices> type;
// };
END_PROPERTIES END_PROPERTIES
int main(int argc, char** argv) int
main(int argc, char** argv)
{ {
typedef TTAG(EclFlowProblemSimple) TypeTag; typedef TTAG(EclFlowProblemSimple) TypeTag;
return mainFlow<TypeTag>(argc, argv); return mainFlow<TypeTag>(argc, argv);
} }

View File

@ -40,7 +40,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp>
//#include <opm/material/fluidsystems/BlackOilFluidSystemSimple.hpp> //#include <opm/material/fluidsystems/BlackOilFluidSystemSimple.hpp>
//#include <opm/material/fluidsystems/BlackOilFluidSystemSimple.hpp> //#include <opm/material/fluidsystems/BlackOilFluidSystemSimple.hpp>
#include <opm/models/blackoil/blackoilintensivequantities.hh> #include <opm/models/blackoil/blackoilintensivequantities.hh>
#include <opm/material/fluidstates/BlackOilFluidState.hpp> #include <opm/material/fluidstates/BlackOilFluidState.hpp>
//#include <opm/material/fluidstates/BlackOilFluidStateSimple.hpp> //#include <opm/material/fluidstates/BlackOilFluidStateSimple.hpp>
@ -71,7 +71,7 @@ namespace Opm {
Vanguard::setExternalDeck(&deck); Vanguard::setExternalDeck(&deck);
Vanguard::setExternalEclState(&eclState); Vanguard::setExternalEclState(&eclState);
} }
// ----------------- Main program ----------------- // ----------------- Main program -----------------
template <class TypeTag> template <class TypeTag>
int flowEbosMain(int argc, char** argv, bool outputCout, bool outputFiles) int flowEbosMain(int argc, char** argv, bool outputCout, bool outputFiles)
@ -79,7 +79,7 @@ namespace Opm {
// we always want to use the default locale, and thus spare us the trouble // we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings. // with incorrect locale settings.
Opm::resetLocale(); Opm::resetLocale();
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv); Dune::Fem::MPIManager::initialize(argc, argv);
#else #else
@ -306,7 +306,7 @@ int mainFlow(int argc, char** argv)
typedef GET_PROP_TYPE(PreTypeTag, Problem) PreProblem; typedef GET_PROP_TYPE(PreTypeTag, Problem) PreProblem;
PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project."); PreProblem::setBriefDescription("Flow, an advanced reservoir simulator for ECL-decks provided by the Open Porous Media project.");
int status = Opm::FlowMainEbos<PreTypeTag>::setupParameters_(argc, argv); int status = Opm::FlowMainEbos<PreTypeTag>::setupParameters_(argc, argv);
if (status != 0) { if (status != 0) {
// if setupParameters_ returns a value smaller than 0, there was no error, but // if setupParameters_ returns a value smaller than 0, there was no error, but
@ -391,12 +391,12 @@ int mainFlow(int argc, char** argv)
catch (const std::invalid_argument& e) catch (const std::invalid_argument& e)
{ {
if (outputCout) { if (outputCout) {
std::cerr << "Failed to create valid EclipseState object." << std::endl; std::cerr << "Failed to create valid EclipseState object." << std::endl;
std::cerr << "Exception caught: " << e.what() << std::endl; std::cerr << "Exception caught: " << e.what() << std::endl;
} }
throw; throw;
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#endif #endif

View File

@ -423,35 +423,35 @@ namespace Opm {
Scalar saturationsOld[FluidSystem::numPhases] = { 0.0 }; Scalar saturationsOld[FluidSystem::numPhases] = { 0.0 };
Scalar oilSaturationOld = 1.0; Scalar oilSaturationOld = 1.0;
// NB fix me! adding pressures changes to satutation changes does not make sense // NB fix me! adding pressures changes to satutation changes does not make sense
Scalar tmp = pressureNew - pressureOld; Scalar tmp = pressureNew - pressureOld;
resultDelta += tmp*tmp; resultDelta += tmp*tmp;
resultDenom += pressureNew*pressureNew; resultDenom += pressureNew*pressureNew;
if (FluidSystem::numActivePhases() > 1) { if (FluidSystem::numActivePhases() > 1) {
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) { if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
saturationsOld[FluidSystem::waterPhaseIdx] = priVarsOld[Indices::waterSaturationIdx]; saturationsOld[FluidSystem::waterPhaseIdx] = priVarsOld[Indices::waterSaturationIdx];
oilSaturationOld -= saturationsOld[FluidSystem::waterPhaseIdx]; oilSaturationOld -= saturationsOld[FluidSystem::waterPhaseIdx];
} }
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) &&
priVarsOld.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg)
{
saturationsOld[FluidSystem::gasPhaseIdx] = priVarsOld[Indices::compositionSwitchIdx];
oilSaturationOld -= saturationsOld[FluidSystem::gasPhaseIdx];
}
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) { if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) &&
saturationsOld[FluidSystem::oilPhaseIdx] = oilSaturationOld; priVarsOld.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg)
} {
for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++ phaseIdx) { saturationsOld[FluidSystem::gasPhaseIdx] = priVarsOld[Indices::compositionSwitchIdx];
Scalar tmp = saturationsNew[phaseIdx] - saturationsOld[phaseIdx]; oilSaturationOld -= saturationsOld[FluidSystem::gasPhaseIdx];
resultDelta += tmp*tmp; }
resultDenom += saturationsNew[phaseIdx]*saturationsNew[phaseIdx];
assert(std::isfinite(resultDelta)); if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
assert(std::isfinite(resultDenom)); saturationsOld[FluidSystem::oilPhaseIdx] = oilSaturationOld;
} }
} for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++ phaseIdx) {
Scalar tmp = saturationsNew[phaseIdx] - saturationsOld[phaseIdx];
resultDelta += tmp*tmp;
resultDenom += saturationsNew[phaseIdx]*saturationsNew[phaseIdx];
assert(std::isfinite(resultDelta));
assert(std::isfinite(resultDenom));
}
}
} }
resultDelta = gridView.comm().sum(resultDelta); resultDelta = gridView.comm().sum(resultDelta);

View File

@ -60,7 +60,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
{ {
++current_step_; ++current_step_;
current_time_ += dt_; current_time_ += dt_;
assert(dt_ > 0); assert(dt_ > 0);
// store used time step sizes // store used time step sizes
steps_.push_back( dt_ ); steps_.push_back( dt_ );
return *this; return *this;
@ -82,7 +82,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
if( dt_ > max_time_step_ ) { if( dt_ > max_time_step_ ) {
dt_ = 0.5 * remaining; dt_ = 0.5 * remaining;
} }
assert(dt_ > 0); assert(dt_ > 0);
return; return;
} }
@ -91,7 +91,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
if( 1.5 * dt_ > remaining ) { if( 1.5 * dt_ > remaining ) {
dt_ = 0.5 * remaining; dt_ = 0.5 * remaining;
assert(dt_ > 0); assert(dt_ > 0);
return; return;
} }
} }

View File

@ -293,10 +293,10 @@ namespace Opm {
double dtEstimate = timeStepControl_->computeTimeStepSize(dt, iterations, relativeChange, double dtEstimate = timeStepControl_->computeTimeStepSize(dt, iterations, relativeChange,
substepTimer.simulationTimeElapsed()); substepTimer.simulationTimeElapsed());
assert(dtEstimate > 0); assert(dtEstimate > 0);
// limit the growth of the timestep size by the growth factor // limit the growth of the timestep size by the growth factor
dtEstimate = std::min(dtEstimate, double(maxGrowth_ * dt)); dtEstimate = std::min(dtEstimate, double(maxGrowth_ * dt));
assert(dtEstimate > 0); assert(dtEstimate > 0);
// further restrict time step size growth after convergence problems // further restrict time step size growth after convergence problems
if (restarts > 0) { if (restarts > 0) {
dtEstimate = std::min(growthFactor_ * dt, dtEstimate); dtEstimate = std::min(growthFactor_ * dt, dtEstimate);
@ -310,7 +310,7 @@ namespace Opm {
const double maxPredictionTHPTimestep = 16.0 * unit::day; const double maxPredictionTHPTimestep = 16.0 * unit::day;
dtEstimate = std::min(dtEstimate, maxPredictionTHPTimestep); dtEstimate = std::min(dtEstimate, maxPredictionTHPTimestep);
} }
assert(dtEstimate > 0); assert(dtEstimate > 0);
if (timestepVerbose_) { if (timestepVerbose_) {
std::ostringstream ss; std::ostringstream ss;
substepReport.reportStep(ss); substepReport.reportStep(ss);

View File

@ -134,11 +134,11 @@ namespace Opm
// store new error // store new error
const double error = relChange.relativeChange(); const double error = relChange.relativeChange();
errors_[ 2 ] = error; errors_[ 2 ] = error;
for( int i=0; i<2; ++i ) { for( int i=0; i<2; ++i ) {
assert(std::isfinite(errors_[i])); assert(std::isfinite(errors_[i]));
assert(errors_[i]>0); assert(errors_[i]>0);
} }
if( error > tol_ ) if( error > tol_ )
{ {
// adjust dt by given tolerance // adjust dt by given tolerance

View File

@ -251,18 +251,18 @@ namespace Opm {
const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0); const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0); const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
const auto& fs = intQuants.fluidState(); const auto& fs = intQuants.fluidState();
// copy of get perfpressure in Standard well // copy of get perfpressure in Standard well
// exept for value // exept for value
double perf_pressure = 0.0; double perf_pressure = 0.0;
if (Indices::oilEnabled) { if (Indices::oilEnabled) {
perf_pressure = fs.pressure(FluidSystem::oilPhaseIdx).value(); perf_pressure = fs.pressure(FluidSystem::oilPhaseIdx).value();
} else { } else {
if (Indices::waterEnabled) { if (Indices::waterEnabled) {
perf_pressure = fs.pressure(FluidSystem::waterPhaseIdx).value(); perf_pressure = fs.pressure(FluidSystem::waterPhaseIdx).value();
} else { } else {
perf_pressure = fs.pressure(FluidSystem::gasPhaseIdx).value(); perf_pressure = fs.pressure(FluidSystem::gasPhaseIdx).value();
} }
} }
cellPressures[cellIdx] = perf_pressure; cellPressures[cellIdx] = perf_pressure;
} }
well_state_.init(wells(), cellPressures, schedule(), wells_ecl_, timeStepIdx, &previous_well_state_, phase_usage_); well_state_.init(wells(), cellPressures, schedule(), wells_ecl_, timeStepIdx, &previous_well_state_, phase_usage_);

View File

@ -493,13 +493,13 @@ namespace Opm {
// sum p, rs, rv, and T. // sum p, rs, rv, and T.
double hydrocarbonPV = pv_cell*hydrocarbon; double hydrocarbonPV = pv_cell*hydrocarbon;
if (hydrocarbonPV > 0) { if (hydrocarbonPV > 0) {
pv += hydrocarbonPV; pv += hydrocarbonPV;
p += fs.pressure(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV; p += fs.pressure(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV;
rs += fs.Rs().value()*hydrocarbonPV; rs += fs.Rs().value()*hydrocarbonPV;
rv += fs.Rv().value()*hydrocarbonPV; rv += fs.Rv().value()*hydrocarbonPV;
T += fs.temperature(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV; T += fs.temperature(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV;
} }
} }
for (const auto& reg : rmap_.activeRegions()) { for (const auto& reg : rmap_.activeRegions()) {
@ -523,7 +523,7 @@ namespace Opm {
} }
} }
/** /**
* Region identifier. * Region identifier.
* *
* Integral type. * Integral type.

View File

@ -238,10 +238,10 @@ namespace Opm
StandardWell<TypeTag>:: StandardWell<TypeTag>::
wellVolumeFraction(const unsigned compIdx) const wellVolumeFraction(const unsigned compIdx) const
{ {
if (FluidSystem::numActivePhases() == 1) { if (FluidSystem::numActivePhases() == 1) {
return EvalWell(numWellEq_ + numEq, 1.0); return EvalWell(numWellEq_ + numEq, 1.0);
} }
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && compIdx == Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx)) { if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && compIdx == Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx)) {
return primary_variables_evaluation_[WFrac]; return primary_variables_evaluation_[WFrac];
} }

View File

@ -109,11 +109,11 @@ namespace Opm
SurfaceToReservoirVoidage<FluidSystem, std::vector<int> >; SurfaceToReservoirVoidage<FluidSystem, std::vector<int> >;
static const bool compositionSwitchEnabled = Indices::gasEnabled; static const bool compositionSwitchEnabled = Indices::gasEnabled;
using FluidState = Opm::BlackOilFluidState<Eval, using FluidState = Opm::BlackOilFluidState<Eval,
FluidSystem, FluidSystem,
has_temperature, has_temperature,
has_energy, has_energy,
compositionSwitchEnabled, compositionSwitchEnabled,
Indices::numPhases >; Indices::numPhases >;
/// Constructor /// Constructor
WellInterface(const Well2& well, const int time_step, const Wells* wells, WellInterface(const Well2& well, const int time_step, const Wells* wells,
const ModelParameters& param, const ModelParameters& param,