Mearge from upstream

This commit is contained in:
Halvor M. Nilsen 2012-06-20 13:11:46 +02:00
commit dedac2d493
4 changed files with 142 additions and 133 deletions

View File

@ -9,6 +9,10 @@ syntax: glob
*.pc
stamp-*
.dirstamp
.autotools
.cproject
.project
.settings/*
Makefile
Makefile.in

View File

@ -378,7 +378,7 @@ assemble_well_contrib(int nc ,
break;
case RESERVOIR_RATE:
for (p = 0; p < np; ++p) {
for (p = 0; p < np; p++) {
if (ctrls->distr[np * ctrls->current + p] != 1.0) {
*ok = 0;
break;
@ -539,7 +539,7 @@ well_solution(const struct UnstructuredGrid *G ,
if (soln->well_press != NULL) {
/* Extract BHP directly from solution vector for non-shut wells */
for (w = 0; w < F->W->number_of_wells; ++w) {
for (w = 0; w < F->W->number_of_wells; w++) {
if (F->W->ctrls[w]->current >= 0) {
soln->well_press[w] = h->x[G->number_of_cells + w];
}
@ -585,6 +585,7 @@ assemble_incompressible(struct UnstructuredGrid *G ,
int res_is_neumann, wells_are_rate;
double s;
*ok = 1;
csrmatrix_zero( h->A);
vector_zero (h->A->m, h->b);
@ -694,6 +695,7 @@ ifs_tpfa_assemble(struct UnstructuredGrid *G ,
/* ---------------------------------------------------------------------- */
{
int system_singular, ok;
assemble_incompressible(G, F, trans, gpress, h, &system_singular, &ok);
if (ok && system_singular) {
@ -733,9 +735,11 @@ ifs_tpfa_assemble_comprock(struct UnstructuredGrid *G ,
* after it will always be nonsingular.
*/
if (ok) {
for (c = 0; c < G->number_of_cells; ++c) {
for (c = 0; c < G->number_of_cells; c++) {
j = csrmatrix_elm_index(c, c, h->A);
d = porevol[c] * rock_comp[c] / dt;
h->A->sa[j] += d;
h->b[c] += d * pressure[c];
}
@ -761,7 +765,7 @@ ifs_tpfa_assemble_comprock_increment(struct UnstructuredGrid *G ,
{
int c, w, wdof, system_singular, ok;
size_t j;
double *v;
double *v, dpvdt;
ok = 1;
assemble_incompressible(G, F, trans, gpress, h, &system_singular, &ok);
@ -775,15 +779,20 @@ ifs_tpfa_assemble_comprock_increment(struct UnstructuredGrid *G ,
v = h->pimpl->work;
mult_csr_matrix(h->A, prev_pressure, v);
for (c = 0; c < G->number_of_cells; ++c) {
for (c = 0; c < G->number_of_cells; c++) {
j = csrmatrix_elm_index(c, c, h->A);
dpvdt = (porevol[c] - initial_porevolume[c]) / dt;
h->A->sa[j] += porevol[c] * rock_comp[c] / dt;
h->b[c] += -(porevol[c] - initial_porevolume[c])/dt - v[c];
h->b[c] -= dpvdt + v[c];
}
if (F->W != NULL) {
for (w = 0; w < F->W->number_of_wells; ++w) {
wdof = G->number_of_cells + w;
h->b[wdof] += -v[wdof];
wdof = G->number_of_cells;
for (w = 0; w < F->W->number_of_wells; w++, wdof++) {
h->b[wdof] -= v[wdof];
}
}
}

View File

@ -35,7 +35,6 @@
#ifndef OPENRS_FACTORY_HEADER
#define OPENRS_FACTORY_HEADER
#include <map>
#include <tr1/memory>
@ -168,9 +167,6 @@ namespace Opm
}
};
} // namespace Opm
#endif // OPENRS_FACTORY_HEADER