mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
obtaining the position of water phase directly
instead of finding the water phase through a for loop when caculating the water velocity for faces.
This commit is contained in:
parent
2b6a58b12c
commit
312fc60d13
@ -1029,13 +1029,9 @@ namespace Opm {
|
||||
|
||||
std::vector<double> b_faces;
|
||||
|
||||
for (int phase = 0; phase < fluid_.numPhases(); ++phase) {
|
||||
const int canonicalPhaseIdx = canph_[phase];
|
||||
const int phase = fluid_.phaseUsage().phase_pos[BlackoilPhases::Aqua]; // water position
|
||||
|
||||
// only compute the velocity of Water phase
|
||||
if (canonicalPhaseIdx != Water) {
|
||||
continue;
|
||||
}
|
||||
const int canonicalPhaseIdx = canph_[phase];
|
||||
|
||||
const std::vector<PhasePresence> cond = phaseCondition();
|
||||
|
||||
@ -1043,7 +1039,6 @@ namespace Opm {
|
||||
const ADB mu = fluidViscosity(canonicalPhaseIdx, phasePressure[canonicalPhaseIdx], state.temperature, state.rs, state.rv,cond, cells_);
|
||||
rq_[phase].mob = tr_mult * kr[canonicalPhaseIdx] / mu;
|
||||
|
||||
|
||||
// compute gravity potensial using the face average as in eclipse and MRST
|
||||
const ADB rho = fluidDensity(canonicalPhaseIdx, phasePressure[canonicalPhaseIdx], state.temperature, state.rs, state.rv,cond, cells_);
|
||||
const ADB rhoavg = ops_.caver * rho;
|
||||
@ -1069,7 +1064,7 @@ namespace Opm {
|
||||
V visc_mult_cells = polymer_props_ad_.viscMult(polymer_conc);
|
||||
V visc_mult_faces = upwind.select(visc_mult_cells);
|
||||
|
||||
int nface = visc_mult_faces.size();
|
||||
size_t nface = visc_mult_faces.size();
|
||||
visc_mult.resize(nface);
|
||||
std::copy(&(visc_mult_faces[0]), &(visc_mult_faces[0]) + nface, visc_mult.begin());
|
||||
|
||||
@ -1078,7 +1073,6 @@ namespace Opm {
|
||||
const auto& tempb_faces = upwind.select(b);
|
||||
b_faces.resize(tempb_faces.size());
|
||||
std::copy(&(tempb_faces.value()[0]), &(tempb_faces.value()[0]) + tempb_faces.size(), b_faces.begin());
|
||||
}
|
||||
|
||||
const auto& internal_faces = ops_.internal_faces;
|
||||
|
||||
@ -1096,7 +1090,6 @@ namespace Opm {
|
||||
phiavg.resize(temp_phiavg.size());
|
||||
std::copy(&(temp_phiavg.value()[0]), &(temp_phiavg.value()[0]) + temp_phiavg.size(), phiavg.begin());
|
||||
|
||||
size_t nface = rq_[0].mflux.value().size();
|
||||
water_vel.resize(nface);
|
||||
std::copy(&(rq_[0].mflux.value()[0]), &(rq_[0].mflux.value()[0]) + nface, water_vel.begin());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user