mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-11 22:45:35 -06:00
change according to comments in pullrequest
This commit is contained in:
parent
3a56213ed8
commit
ee482e87a6
@ -376,7 +376,6 @@ public:
|
||||
// and the thermal condictivity coefficients
|
||||
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||
if (!FluidSystem::phaseIsActive(phaseIdx)) {
|
||||
//fs.setEnthalpy(phaseIdx, 0.0);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -140,6 +140,7 @@ public:
|
||||
{
|
||||
if (priVars.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg)
|
||||
// -> threephase case
|
||||
assert( not(priVars.primaryVarsMeaning() == PrimaryVariables::px) )
|
||||
Sg = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
|
||||
else if (priVars.primaryVarsMeaning() == PrimaryVariables::Sw_pg_Rv) {
|
||||
// -> gas-water case
|
||||
@ -206,7 +207,6 @@ public:
|
||||
asImp_().solventPostSatFuncUpdate_(elemCtx, dofIdx, timeIdx);
|
||||
|
||||
Evaluation SoMax=0;
|
||||
//const Evaluation&
|
||||
if(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)){
|
||||
SoMax =
|
||||
Opm::max(fluidState_.saturation(oilPhaseIdx),
|
||||
@ -266,8 +266,6 @@ public:
|
||||
fluidState_.setRv(0.0);
|
||||
}
|
||||
else if (priVars.primaryVarsMeaning() == PrimaryVariables::Sw_pg_Rv) {
|
||||
//assert(priVars.primaryVarsMeaning() == PrimaryVariables::Sw_pg_Rv);
|
||||
|
||||
const auto& Rv = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
|
||||
fluidState_.setRv(Rv);
|
||||
|
||||
@ -282,10 +280,10 @@ public:
|
||||
SoMax);
|
||||
|
||||
fluidState_.setRs(Opm::min(RsMax, RsSat));
|
||||
}
|
||||
else
|
||||
} else {
|
||||
fluidState_.setRs(0.0);
|
||||
}else{
|
||||
}
|
||||
} else {
|
||||
assert(priVars.primaryVarsMeaning() == PrimaryVariables::px);
|
||||
}
|
||||
|
||||
@ -353,12 +351,10 @@ public:
|
||||
Evaluation x;
|
||||
if(FluidSystem::phaseIsActive(oilPhaseIdx)){
|
||||
x = rockCompressibility*(fluidState_.pressure(oilPhaseIdx) - rockRefPressure);
|
||||
}else if( FluidSystem::phaseIsActive(waterPhaseIdx) ){
|
||||
x = rockCompressibility*(fluidState_.pressure(waterPhaseIdx) - rockRefPressure);
|
||||
}else{
|
||||
if(FluidSystem::phaseIsActive(waterPhaseIdx)){
|
||||
x = rockCompressibility*(fluidState_.pressure(waterPhaseIdx) - rockRefPressure);
|
||||
}else{
|
||||
x = rockCompressibility*(fluidState_.pressure(gasPhaseIdx) - rockRefPressure);
|
||||
}
|
||||
x = rockCompressibility*(fluidState_.pressure(gasPhaseIdx) - rockRefPressure);
|
||||
}
|
||||
porosity_ *= 1.0 + x + 0.5*x*x;
|
||||
}
|
||||
|
@ -37,13 +37,13 @@ namespace Ewoms {
|
||||
*
|
||||
* \brief The primary variable and equation indices for the black-oil model.
|
||||
*/
|
||||
template <unsigned numSolventsV, unsigned numPolymersV, unsigned numEnergyV, unsigned PVOffset, unsigned enableCanonicalCompIdx>
|
||||
template <unsigned numSolventsV, unsigned numPolymersV, unsigned numEnergyV, unsigned PVOffset, unsigned canonicalCompIdx>
|
||||
struct BlackOilOnePhaseIndices
|
||||
{
|
||||
//! Is phase enabled or not
|
||||
static const bool oilEnabled = (enableCanonicalCompIdx == 0);
|
||||
static const bool waterEnabled = (enableCanonicalCompIdx == 1);
|
||||
static const bool gasEnabled = (enableCanonicalCompIdx == 2);
|
||||
static const bool oilEnabled = (canonicalCompIdx == 0);
|
||||
static const bool waterEnabled = (canonicalCompIdx == 1);
|
||||
static const bool gasEnabled = (canonicalCompIdx == 2);
|
||||
|
||||
//! Are solvents involved?
|
||||
static const bool enableSolvent = numSolventsV > 0;
|
||||
@ -116,7 +116,7 @@ struct BlackOilOnePhaseIndices
|
||||
static unsigned activeToCanonicalComponentIndex(unsigned compIdx)
|
||||
{
|
||||
// assumes canonical oil = 0, water = 1, gas = 2;
|
||||
assert(compIdx < 2);
|
||||
assert(compIdx == 0);
|
||||
if(gasEnabled) {
|
||||
return 2;
|
||||
} else if (waterEnabled) {
|
||||
|
@ -401,10 +401,7 @@ public:
|
||||
*/
|
||||
void setTimeStepSize(Scalar value)
|
||||
{
|
||||
if( not(value>0)){
|
||||
std::cout << "Time step set to zero" << std::endl;
|
||||
}
|
||||
timeStepSize_ = value;
|
||||
timeStepSize_ = value;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -448,7 +445,7 @@ public:
|
||||
*/
|
||||
bool finished() const
|
||||
{
|
||||
assert(timeStepSize_ > 0.0);
|
||||
assert(timeStepSize_ >= 0.0);
|
||||
Scalar eps =
|
||||
std::max(Scalar(std::abs(this->time())), timeStepSize())
|
||||
*std::numeric_limits<Scalar>::epsilon()*1e3;
|
||||
@ -765,7 +762,7 @@ public:
|
||||
else
|
||||
// ask the problem to provide the next time step size
|
||||
dt = std::min(maxTimeStepSize(), problem_->nextTimeStepSize());
|
||||
|
||||
assert(dt>0);
|
||||
setTimeStepSize(dt);
|
||||
}
|
||||
prePostProcessTimer_.stop();
|
||||
|
Loading…
Reference in New Issue
Block a user