mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ECL peaceman well: don't do manual updates of the DOF variables
use the update() method instead. Also, add an updateBeginTimestep() method to the DOF variables which only need to be updated once per timestep...
This commit is contained in:
parent
6c881ab88f
commit
deb10b7524
@ -125,6 +125,11 @@ class EclPeacemanWell : public BaseAuxiliaryModule<TypeTag>
|
|||||||
DofVariables() = default;
|
DofVariables() = default;
|
||||||
DofVariables(const DofVariables&) = default;
|
DofVariables(const DofVariables&) = default;
|
||||||
|
|
||||||
|
// retrieve the solution dependent quantities from the IntensiveQuantities of the
|
||||||
|
// model
|
||||||
|
void updateBeginTimestep(const IntensiveQuantities& intQuants)
|
||||||
|
{ }
|
||||||
|
|
||||||
// retrieve the solution dependent quantities from the IntensiveQuantities of the
|
// retrieve the solution dependent quantities from the IntensiveQuantities of the
|
||||||
// model
|
// model
|
||||||
void update(const IntensiveQuantities& intQuants)
|
void update(const IntensiveQuantities& intQuants)
|
||||||
@ -882,6 +887,9 @@ public:
|
|||||||
maximumReservoirRate_ = 1e100;
|
maximumReservoirRate_ = 1e100;
|
||||||
else if (controlMode_ == ControlMode::VolumetricReservoirRate)
|
else if (controlMode_ == ControlMode::VolumetricReservoirRate)
|
||||||
maximumSurfaceRate_ = 1e100;
|
maximumSurfaceRate_ = 1e100;
|
||||||
|
|
||||||
|
// reset the iteration index
|
||||||
|
iterationIdx_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -913,17 +921,11 @@ public:
|
|||||||
|
|
||||||
DofVariables &dofVars = dofVariables_.at(globalDofIdx);
|
DofVariables &dofVars = dofVariables_.at(globalDofIdx);
|
||||||
const auto& intQuants = context.intensiveQuantities(dofIdx, timeIdx);
|
const auto& intQuants = context.intensiveQuantities(dofIdx, timeIdx);
|
||||||
const auto& fs = intQuants.fluidState();
|
|
||||||
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
|
||||||
dofVars.pressure[phaseIdx] = fs.pressure(phaseIdx);
|
|
||||||
dofVars.density[phaseIdx] = fs.density(phaseIdx);
|
|
||||||
dofVars.mobility[phaseIdx] = intQuants.mobility(phaseIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int compIdx = 0; compIdx < numComponents; ++ compIdx) {
|
if (iterationIdx_ == 0)
|
||||||
dofVars.oilMassFraction[compIdx] = fs.massFraction(oilPhaseIdx, compIdx);
|
dofVars.updateBeginTimestep(intQuants);
|
||||||
dofVars.gasMassFraction[compIdx] = fs.massFraction(gasPhaseIdx, compIdx);
|
|
||||||
}
|
dofVars.update(intQuants);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -956,7 +958,7 @@ public:
|
|||||||
* \brief Called by the simulator after each Newton-Raphson iteration.
|
* \brief Called by the simulator after each Newton-Raphson iteration.
|
||||||
*/
|
*/
|
||||||
void endIteration()
|
void endIteration()
|
||||||
{ }
|
{ ++ iterationIdx_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Called by the simulator after each time step.
|
* \brief Called by the simulator after each time step.
|
||||||
@ -1019,10 +1021,8 @@ public:
|
|||||||
|
|
||||||
tmp.update(context.intensiveQuantities(dofIdx, timeIdx));
|
tmp.update(context.intensiveQuantities(dofIdx, timeIdx));
|
||||||
|
|
||||||
Scalar bhp = actualBottomHolePressure_;
|
|
||||||
|
|
||||||
std::array<Scalar, numPhases> volumetricRates;
|
std::array<Scalar, numPhases> volumetricRates;
|
||||||
computeVolumetricDofRates_(volumetricRates, bhp, tmp);
|
computeVolumetricDofRates_(volumetricRates, actualBottomHolePressure_, tmp);
|
||||||
|
|
||||||
// convert to mass rates
|
// convert to mass rates
|
||||||
RateVector modelRate;
|
RateVector modelRate;
|
||||||
@ -1482,6 +1482,10 @@ protected:
|
|||||||
|
|
||||||
std::unordered_map<int, DofVariables> dofVariables_;
|
std::unordered_map<int, DofVariables> dofVariables_;
|
||||||
|
|
||||||
|
// the number of times beginIteration*() was called for the current time step
|
||||||
|
int iterationIdx_;
|
||||||
|
|
||||||
|
|
||||||
// the sum of the total volumes of all the degrees of freedoms that interact with the well
|
// the sum of the total volumes of all the degrees of freedoms that interact with the well
|
||||||
Scalar wellTotalVolume_;
|
Scalar wellTotalVolume_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user