mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Whitespace fixes (tabs->spaces, reformatted new files).
This commit is contained in:
parent
0b9b20695c
commit
5211217c94
@ -43,7 +43,7 @@ SET_PROP(EclFlowProblemSimple, FluidState)
|
||||
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;
|
||||
@ -89,7 +89,7 @@ namespace Opm {
|
||||
#endif
|
||||
SET_BOOL_PROP(EclFlowProblemSimple, EnableStorageCache, true);
|
||||
SET_BOOL_PROP(EclFlowProblemSimple, EnableIntensiveQuantityCache, true);
|
||||
|
||||
|
||||
//SET_INT_PROP(EclFlowProblemSimple, NumWellAdjoint, 1);
|
||||
//SET_BOOL_PROP(EclFlowProblem, EnableStorageCache, true);
|
||||
//SET_BOOL_PROP(EclFlowProblem, EnableIntensiveQuantityCache, true);
|
||||
@ -98,6 +98,6 @@ namespace Opm {
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
}
|
||||
|
@ -24,61 +24,68 @@
|
||||
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem));
|
||||
NEW_PROP_TAG(FluidState);
|
||||
NEW_PROP_TAG(FluidSystem);
|
||||
//! The indices required by the model
|
||||
SET_PROP(EclFlowProblemSimple, Indices)
|
||||
{
|
||||
private:
|
||||
// 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
|
||||
// messages unfortunately are *really* confusing and not really helpful.
|
||||
typedef TTAG(EclFlowProblem) BaseTypeTag;
|
||||
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;
|
||||
};
|
||||
NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem));
|
||||
NEW_PROP_TAG(FluidState);
|
||||
NEW_PROP_TAG(FluidSystem);
|
||||
//! The indices required by the model
|
||||
SET_PROP(EclFlowProblemSimple, Indices)
|
||||
{
|
||||
private:
|
||||
// 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
|
||||
// messages unfortunately are *really* confusing and not really helpful.
|
||||
typedef TTAG(EclFlowProblem) BaseTypeTag;
|
||||
typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem;
|
||||
|
||||
// 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;
|
||||
// };
|
||||
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)
|
||||
// {
|
||||
// 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
|
||||
|
||||
int main(int argc, char** argv)
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
}
|
||||
|
@ -24,63 +24,70 @@
|
||||
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem));
|
||||
SET_BOOL_PROP(EclFlowProblemSimple, EnableEnergy, true);
|
||||
NEW_PROP_TAG(FluidState);
|
||||
NEW_PROP_TAG(FluidSystem);
|
||||
//! The indices required by the model
|
||||
SET_PROP(EclFlowProblemSimple, Indices)
|
||||
{
|
||||
private:
|
||||
// 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
|
||||
// messages unfortunately are *really* confusing and not really helpful.
|
||||
typedef TTAG(EclFlowProblem) BaseTypeTag;
|
||||
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;
|
||||
};
|
||||
NEW_TYPE_TAG(EclFlowProblemSimple, INHERITS_FROM(EclFlowProblem));
|
||||
SET_BOOL_PROP(EclFlowProblemSimple, EnableEnergy, true);
|
||||
NEW_PROP_TAG(FluidState);
|
||||
NEW_PROP_TAG(FluidSystem);
|
||||
//! The indices required by the model
|
||||
SET_PROP(EclFlowProblemSimple, Indices)
|
||||
{
|
||||
private:
|
||||
// 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
|
||||
// messages unfortunately are *really* confusing and not really helpful.
|
||||
typedef TTAG(EclFlowProblem) BaseTypeTag;
|
||||
typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem;
|
||||
|
||||
// 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;
|
||||
// };
|
||||
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)
|
||||
// {
|
||||
// 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
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
typedef TTAG(EclFlowProblemSimple) TypeTag;
|
||||
return mainFlow<TypeTag>(argc, argv);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@
|
||||
#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/models/blackoil/blackoilintensivequantities.hh>
|
||||
#include <opm/material/fluidstates/BlackOilFluidState.hpp>
|
||||
//#include <opm/material/fluidstates/BlackOilFluidStateSimple.hpp>
|
||||
@ -71,7 +71,7 @@ namespace Opm {
|
||||
Vanguard::setExternalDeck(&deck);
|
||||
Vanguard::setExternalEclState(&eclState);
|
||||
}
|
||||
|
||||
|
||||
// ----------------- Main program -----------------
|
||||
template <class TypeTag>
|
||||
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
|
||||
// with incorrect locale settings.
|
||||
Opm::resetLocale();
|
||||
|
||||
|
||||
#if HAVE_DUNE_FEM
|
||||
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||
#else
|
||||
@ -306,7 +306,7 @@ int mainFlow(int argc, char** argv)
|
||||
typedef GET_PROP_TYPE(PreTypeTag, Problem) PreProblem;
|
||||
|
||||
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);
|
||||
if (status != 0) {
|
||||
// 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)
|
||||
{
|
||||
if (outputCout) {
|
||||
std::cerr << "Failed to create valid EclipseState object." << std::endl;
|
||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||
std::cerr << "Failed to create valid EclipseState object." << std::endl;
|
||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
@ -423,35 +423,35 @@ namespace Opm {
|
||||
Scalar saturationsOld[FluidSystem::numPhases] = { 0.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;
|
||||
resultDelta += tmp*tmp;
|
||||
resultDenom += pressureNew*pressureNew;
|
||||
|
||||
if (FluidSystem::numActivePhases() > 1) {
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
saturationsOld[FluidSystem::waterPhaseIdx] = priVarsOld[Indices::waterSaturationIdx];
|
||||
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::numActivePhases() > 1) {
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
saturationsOld[FluidSystem::waterPhaseIdx] = priVarsOld[Indices::waterSaturationIdx];
|
||||
oilSaturationOld -= saturationsOld[FluidSystem::waterPhaseIdx];
|
||||
}
|
||||
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
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)) {
|
||||
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);
|
||||
|
@ -60,7 +60,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
{
|
||||
++current_step_;
|
||||
current_time_ += dt_;
|
||||
assert(dt_ > 0);
|
||||
assert(dt_ > 0);
|
||||
// store used time step sizes
|
||||
steps_.push_back( dt_ );
|
||||
return *this;
|
||||
@ -82,7 +82,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
if( dt_ > max_time_step_ ) {
|
||||
dt_ = 0.5 * remaining;
|
||||
}
|
||||
assert(dt_ > 0);
|
||||
assert(dt_ > 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
|
||||
|
||||
if( 1.5 * dt_ > remaining ) {
|
||||
dt_ = 0.5 * remaining;
|
||||
assert(dt_ > 0);
|
||||
assert(dt_ > 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -293,10 +293,10 @@ namespace Opm {
|
||||
double dtEstimate = timeStepControl_->computeTimeStepSize(dt, iterations, relativeChange,
|
||||
substepTimer.simulationTimeElapsed());
|
||||
|
||||
assert(dtEstimate > 0);
|
||||
assert(dtEstimate > 0);
|
||||
// limit the growth of the timestep size by the growth factor
|
||||
dtEstimate = std::min(dtEstimate, double(maxGrowth_ * dt));
|
||||
assert(dtEstimate > 0);
|
||||
assert(dtEstimate > 0);
|
||||
// further restrict time step size growth after convergence problems
|
||||
if (restarts > 0) {
|
||||
dtEstimate = std::min(growthFactor_ * dt, dtEstimate);
|
||||
@ -310,7 +310,7 @@ namespace Opm {
|
||||
const double maxPredictionTHPTimestep = 16.0 * unit::day;
|
||||
dtEstimate = std::min(dtEstimate, maxPredictionTHPTimestep);
|
||||
}
|
||||
assert(dtEstimate > 0);
|
||||
assert(dtEstimate > 0);
|
||||
if (timestepVerbose_) {
|
||||
std::ostringstream ss;
|
||||
substepReport.reportStep(ss);
|
||||
|
@ -134,11 +134,11 @@ namespace Opm
|
||||
// store new error
|
||||
const double error = relChange.relativeChange();
|
||||
errors_[ 2 ] = error;
|
||||
for( int i=0; i<2; ++i ) {
|
||||
assert(std::isfinite(errors_[i]));
|
||||
assert(errors_[i]>0);
|
||||
}
|
||||
|
||||
for( int i=0; i<2; ++i ) {
|
||||
assert(std::isfinite(errors_[i]));
|
||||
assert(errors_[i]>0);
|
||||
}
|
||||
|
||||
if( error > tol_ )
|
||||
{
|
||||
// adjust dt by given tolerance
|
||||
|
@ -251,18 +251,18 @@ namespace Opm {
|
||||
const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||
const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||
const auto& fs = intQuants.fluidState();
|
||||
// copy of get perfpressure in Standard well
|
||||
// exept for value
|
||||
double perf_pressure = 0.0;
|
||||
if (Indices::oilEnabled) {
|
||||
perf_pressure = fs.pressure(FluidSystem::oilPhaseIdx).value();
|
||||
} else {
|
||||
if (Indices::waterEnabled) {
|
||||
perf_pressure = fs.pressure(FluidSystem::waterPhaseIdx).value();
|
||||
} else {
|
||||
perf_pressure = fs.pressure(FluidSystem::gasPhaseIdx).value();
|
||||
}
|
||||
}
|
||||
// copy of get perfpressure in Standard well
|
||||
// exept for value
|
||||
double perf_pressure = 0.0;
|
||||
if (Indices::oilEnabled) {
|
||||
perf_pressure = fs.pressure(FluidSystem::oilPhaseIdx).value();
|
||||
} else {
|
||||
if (Indices::waterEnabled) {
|
||||
perf_pressure = fs.pressure(FluidSystem::waterPhaseIdx).value();
|
||||
} else {
|
||||
perf_pressure = fs.pressure(FluidSystem::gasPhaseIdx).value();
|
||||
}
|
||||
}
|
||||
cellPressures[cellIdx] = perf_pressure;
|
||||
}
|
||||
well_state_.init(wells(), cellPressures, schedule(), wells_ecl_, timeStepIdx, &previous_well_state_, phase_usage_);
|
||||
|
@ -493,13 +493,13 @@ namespace Opm {
|
||||
|
||||
// sum p, rs, rv, and T.
|
||||
double hydrocarbonPV = pv_cell*hydrocarbon;
|
||||
if (hydrocarbonPV > 0) {
|
||||
pv += hydrocarbonPV;
|
||||
p += fs.pressure(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV;
|
||||
rs += fs.Rs().value()*hydrocarbonPV;
|
||||
rv += fs.Rv().value()*hydrocarbonPV;
|
||||
T += fs.temperature(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV;
|
||||
}
|
||||
if (hydrocarbonPV > 0) {
|
||||
pv += hydrocarbonPV;
|
||||
p += fs.pressure(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV;
|
||||
rs += fs.Rs().value()*hydrocarbonPV;
|
||||
rv += fs.Rv().value()*hydrocarbonPV;
|
||||
T += fs.temperature(FluidSystem::oilPhaseIdx).value()*hydrocarbonPV;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& reg : rmap_.activeRegions()) {
|
||||
@ -523,7 +523,7 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Region identifier.
|
||||
*
|
||||
* Integral type.
|
||||
|
@ -238,10 +238,10 @@ namespace Opm
|
||||
StandardWell<TypeTag>::
|
||||
wellVolumeFraction(const unsigned compIdx) const
|
||||
{
|
||||
if (FluidSystem::numActivePhases() == 1) {
|
||||
return EvalWell(numWellEq_ + numEq, 1.0);
|
||||
}
|
||||
|
||||
if (FluidSystem::numActivePhases() == 1) {
|
||||
return EvalWell(numWellEq_ + numEq, 1.0);
|
||||
}
|
||||
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && compIdx == Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx)) {
|
||||
return primary_variables_evaluation_[WFrac];
|
||||
}
|
||||
|
@ -109,11 +109,11 @@ namespace Opm
|
||||
SurfaceToReservoirVoidage<FluidSystem, std::vector<int> >;
|
||||
static const bool compositionSwitchEnabled = Indices::gasEnabled;
|
||||
using FluidState = Opm::BlackOilFluidState<Eval,
|
||||
FluidSystem,
|
||||
has_temperature,
|
||||
has_energy,
|
||||
compositionSwitchEnabled,
|
||||
Indices::numPhases >;
|
||||
FluidSystem,
|
||||
has_temperature,
|
||||
has_energy,
|
||||
compositionSwitchEnabled,
|
||||
Indices::numPhases >;
|
||||
/// Constructor
|
||||
WellInterface(const Well2& well, const int time_step, const Wells* wells,
|
||||
const ModelParameters& param,
|
||||
|
Loading…
Reference in New Issue
Block a user