mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Clean up in computeMassFlux().
This commit is contained in:
@@ -1591,43 +1591,33 @@ namespace detail {
|
|||||||
template <class Grid, class Implementation>
|
template <class Grid, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation>::computeMassFlux(const int actph ,
|
BlackoilModelBase<Grid, Implementation>::computeMassFlux(const int actph ,
|
||||||
const V& transi,
|
const V& transi,
|
||||||
const ADB& kr ,
|
const ADB& kr ,
|
||||||
const ADB& phasePressure,
|
const ADB& phasePressure,
|
||||||
const SolutionState& state)
|
const SolutionState& state)
|
||||||
{
|
{
|
||||||
|
// Compute and store mobilities.
|
||||||
const int canonicalPhaseIdx = canph_[ actph ];
|
const int canonicalPhaseIdx = canph_[ actph ];
|
||||||
|
const std::vector<PhasePresence>& cond = phaseCondition();
|
||||||
const std::vector<PhasePresence> cond = phaseCondition();
|
|
||||||
|
|
||||||
const ADB tr_mult = transMult(state.pressure);
|
const ADB tr_mult = transMult(state.pressure);
|
||||||
const ADB mu = fluidViscosity(canonicalPhaseIdx, phasePressure, state.temperature, state.rs, state.rv,cond, cells_);
|
const ADB mu = fluidViscosity(canonicalPhaseIdx, phasePressure, state.temperature, state.rs, state.rv, cond, cells_);
|
||||||
|
|
||||||
rq_[ actph ].mob = tr_mult * kr / mu;
|
rq_[ actph ].mob = tr_mult * kr / mu;
|
||||||
|
|
||||||
const ADB rho = fluidDensity(canonicalPhaseIdx, phasePressure, state.temperature, state.rs, state.rv,cond, cells_);
|
// Compute head differentials. Gravity potential is done using the face average as in eclipse and MRST.
|
||||||
|
const ADB rho = fluidDensity(canonicalPhaseIdx, phasePressure, state.temperature, state.rs, state.rv, cond, cells_);
|
||||||
ADB& head = rq_[ actph ].head;
|
|
||||||
|
|
||||||
// compute gravity potensial using the face average as in eclipse and MRST
|
|
||||||
const ADB rhoavg = ops_.caver * rho;
|
const ADB rhoavg = ops_.caver * rho;
|
||||||
|
|
||||||
ADB dp = ops_.ngrad * phasePressure - geo_.gravity()[2] * (rhoavg * (ops_.ngrad * geo_.z().matrix()));
|
ADB dp = ops_.ngrad * phasePressure - geo_.gravity()[2] * (rhoavg * (ops_.ngrad * geo_.z().matrix()));
|
||||||
|
|
||||||
if (use_threshold_pressure_) {
|
if (use_threshold_pressure_) {
|
||||||
applyThresholdPressures(dp);
|
applyThresholdPressures(dp);
|
||||||
}
|
}
|
||||||
|
ADB& head = rq_[ actph ].head;
|
||||||
head = transi*dp;
|
head = transi*dp;
|
||||||
//head = transi*(ops_.ngrad * phasePressure) + gflux;
|
|
||||||
|
|
||||||
|
// Compute phase fluxes with upwinding of formation value factor and mobility.
|
||||||
UpwindSelector<double> upwind(grid_, ops_, head.value());
|
UpwindSelector<double> upwind(grid_, ops_, head.value());
|
||||||
|
|
||||||
const ADB& b = rq_[ actph ].b;
|
const ADB& b = rq_[ actph ].b;
|
||||||
const ADB& mob = rq_[ actph ].mob;
|
const ADB& mob = rq_[ actph ].mob;
|
||||||
rq_[ actph ].mflux = upwind.select(b * mob) * head;
|
rq_[ actph ].mflux = upwind.select(b * mob) * head;
|
||||||
// OPM_AD_DUMP(rq_[ actph ].mob);
|
|
||||||
// OPM_AD_DUMP(rq_[ actph ].mflux);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user