diff --git a/opm/core/pressure/tpfa/ifs_tpfa.c b/opm/core/pressure/tpfa/ifs_tpfa.c index 9563b773..156e7e30 100644 --- a/opm/core/pressure/tpfa/ifs_tpfa.c +++ b/opm/core/pressure/tpfa/ifs_tpfa.c @@ -266,10 +266,6 @@ ifs_tpfa_assemble(struct UnstructuredGrid *G, h->A->sa[j2] -= trans[f]; } } - - if ((F != NULL) && (F->src != NULL)) { - h->b[c] += F->src[c]; - } } is_neumann = 1; @@ -277,6 +273,12 @@ ifs_tpfa_assemble(struct UnstructuredGrid *G, is_neumann = assemble_bc_contrib(G, F->bc, trans, h); } + if ((F != NULL) && (F->src != NULL)) { + for (c = 0; c < G->number_of_cells; c++) { + h->b[c] += F->src[c]; + } + } + if (is_neumann) { /* Remove zero eigenvalue associated to constant pressure */ h->A->sa[0] *= 2;