Implement compressible (volume flux) source term assembly.

This commit is contained in:
Bård Skaflestad 2011-10-19 20:09:51 +02:00
parent 79b5e94127
commit fb1316802c

View File

@ -507,6 +507,20 @@ compute_cell_contrib(grid_t *G ,
}
static void
assemble_sources(struct compr_src *src, struct cfs_tpfa_res_data *h)
{
int i;
for (i = 0; i < src->nsrc; i++) {
assert (src->cell[i] >= 0 );
assert (((size_t) src->cell[i]) < h->J->m);
h->F[ src->cell[ i ] ] += src->flux[ i ];
}
}
/* ---------------------------------------------------------------------- */
static int
assemble_cell_contrib(grid_t *G,
@ -765,6 +779,11 @@ cfs_tpfa_res_assemble(grid_t *G,
assemble_cell_contrib(G, c, h);
}
if (src != NULL) {
assert (src->nphases == cq->nphases);
assemble_sources(src, h);
}
res_is_neumann = 1;
if (res_is_neumann && h->pimpl->is_incomp) {