Re-implement computeTotalMobilityOmega() in terms of computePhaseMobilities().

This commit is contained in:
Bård Skaflestad 2012-03-12 16:18:02 +01:00
parent c4f803fedd
commit 29ba859a80

View File

@ -119,27 +119,25 @@ namespace Opm
std::vector<double>& totmob, std::vector<double>& totmob,
std::vector<double>& omega) std::vector<double>& omega)
{ {
int num_cells = cells.size(); std::vector<double> pmobc;
int num_phases = props.numPhases();
totmob.resize(num_cells); computePhaseMobilities(props, cells, s, pmobc);
omega.resize(num_cells);
ASSERT(int(s.size()) == num_cells*num_phases); const std::size_t np = props.numPhases();
std::vector<double> kr(num_cells*num_phases); const std::vector<int>::size_type nc = cells.size();
props.relperm(num_cells, &s[0], &cells[0], &kr[0], 0);
const double* mu = props.viscosity(); std::vector<double>(cells.size(), 0.0).swap(totmob);
for (int cell = 0; cell < num_cells; ++cell) { std::vector<double>(cells.size(), 0.0).swap(omega );
totmob[cell] = 0.0;
for (int phase = 0; phase < num_phases; ++phase) { const double* rho = props.density();
totmob[cell] += kr[num_phases*cell + phase]/mu[phase]; for (std::vector<int>::size_type c = 0; c < nc; ++c) {
} for (std::size_t p = 0; p < np; ++p) {
} totmob[ c ] += pmobc[c*np + p];
const double* rho = props.density(); omega [ c ] += pmobc[c*np + p] * rho[ p ];
for (int cell = 0; cell < num_cells; ++cell) { }
omega[cell] = 0.0;
for (int phase = 0; phase < num_phases; ++phase) { omega[ c ] /= totmob[ c ];
omega[cell] += rho[phase]*(kr[num_phases*cell + phase]/mu[phase])/totmob[cell]; }
}
}
} }
void computePhaseMobilities(const Opm::IncompPropertiesInterface& props, void computePhaseMobilities(const Opm::IncompPropertiesInterface& props,