Make computeMassFlux() more like the base class version.

This commit is contained in:
Atgeirr Flø Rasmussen 2015-05-26 16:49:25 +02:00
parent 9cc01245f1
commit 2ddfe91504

View File

@ -343,30 +343,22 @@ namespace Opm {
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 ].dh;
// compute gravity potensial using the face average as in eclipse and MRST
const ADB rhoavg = ops_.caver * rho; const ADB rhoavg = ops_.caver * rho;
rq_[ actph ].dh = 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(rq_[ actph ].dh);
} }
head = transi*dp; // Polymer treatment.
if (canonicalPhaseIdx == Water) { if (canonicalPhaseIdx == Water) {
if(has_polymer_) { if(has_polymer_) {
const ADB cmax = ADB::constant(cmax_, state.concentration.blockPattern()); const ADB cmax = ADB::constant(cmax_, state.concentration.blockPattern());
@ -381,19 +373,16 @@ namespace Opm {
rq_[poly_pos_].b = rq_[actph].b; rq_[poly_pos_].b = rq_[actph].b;
rq_[poly_pos_].dh = rq_[actph].dh; rq_[poly_pos_].dh = rq_[actph].dh;
UpwindSelector<double> upwind(grid_, ops_, rq_[poly_pos_].dh.value()); UpwindSelector<double> upwind(grid_, ops_, rq_[poly_pos_].dh.value());
rq_[poly_pos_].mflux = upwind.select(rq_[poly_pos_].b * rq_[poly_pos_].mob) * rq_[poly_pos_].dh; rq_[poly_pos_].mflux = upwind.select(rq_[poly_pos_].b * rq_[poly_pos_].mob) * (transi * rq_[poly_pos_].dh);
} }
} }
//head = transi*(ops_.ngrad * phasePressure) + gflux; // Compute phase fluxes with upwinding of formation value factor and mobility.
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; const ADB& dh = rq_[ actph ].dh;
// OPM_AD_DUMP(rq_[ actph ].mob); UpwindSelector<double> upwind(grid_, ops_, dh.value());
// OPM_AD_DUMP(rq_[ actph ].mflux); rq_[ actph ].mflux = upwind.select(b * mob) * (transi * dh);
} }