update PAV formulation.

This commit is contained in:
Liu Ming 2016-09-05 10:38:57 +08:00
parent c5a490c75a
commit 1943978dbd

View File

@ -564,16 +564,26 @@ namespace {
const int dims = *std::max_element(fipnum.begin(), fipnum.end());
std::vector<V> values(dims, V::Zero(5));
std::vector<V> values(dims, V::Zero(7));
for (int d = 0; d < dims; ++d) {
for (int c = 0; c < nc; ++c) {
for (int i = 0; i < 5; ++i) {
if (fipnum[c] == d) {
values[d][i] += fip[c][i];
for (int c = 0; c < nc; ++c) {
if (fipnum[c] != 0) {
values[fipnum[c]-1][i] += fip[i][c];
}
}
}
// compute PAV and PORV or every regions.
for (int c = 0; c < nc; ++c) {
if (fipnum[c] != 0) {
values[fipnum[c]-1][5] += pv[c] * s.col(Oil)[c];
values[fipnum[c]-1][6] += pv[c] * state.pressure.value()[c] * s.col(Oil)[c];
}
}
for (auto& val : values) {
val[6] = val[6] / val[5];
}
return values;