Bugfix in impes transport for well perforations, function signature change.

This commit is contained in:
Atgeirr Flø Rasmussen 2011-04-18 13:51:54 +02:00
parent c0a1444fa4
commit c7fb0bfc3a
3 changed files with 21 additions and 18 deletions

View File

@ -366,7 +366,8 @@ public:
if (wells_.number_of_wells != 0) { if (wells_.number_of_wells != 0) {
wells = &wells_; wells = &wells_;
} }
cfs_tpfa_expl_mass_transport(grid_.c_grid(), wells, np, dt, &porevol_[0], cfs_tpfa_expl_mass_transport(grid_.c_grid(), wells, &wcompl_,
np, dt, &porevol_[0],
data_, cell_surfvols); data_, cell_surfvols);
} }

View File

@ -1198,13 +1198,14 @@ cfs_tpfa_impes_maxtime(grid_t *G,
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void void
cfs_tpfa_expl_mass_transport(grid_t *G, cfs_tpfa_expl_mass_transport(grid_t *G,
well_t *W, well_t *W,
int np, struct completion_data *wdata,
double dt, int np,
const double *porevol, double dt,
struct cfs_tpfa_data *h, const double *porevol,
double *surf_vol) struct cfs_tpfa_data *h,
double *surf_vol)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
{ {
int c, i, f, c2, p, w; int c, i, f, c2, p, w;
@ -1251,10 +1252,10 @@ cfs_tpfa_expl_mass_transport(grid_t *G,
for (w = i = 0; w < W->number_of_wells; w++) { for (w = i = 0; w < W->number_of_wells; w++) {
for (; i < W->well_connpos[w + 1]; i++) { for (; i < W->well_connpos[w + 1]; i++) {
c = W->well_cells[i]; c = W->well_cells[i];
/* Get pressure difference between cell and well perforation */ /* Get difference between cell pressure and well bhp */
dp = wpress[i] - cpress[c]; dp = wpress[w] - cpress[c];
for (p = 0; p < np; p++) { for (p = 0; p < np; p++) {
dz = masstrans_p[i*np + p]* dp; dz = masstrans_p[i*np + p] * (dp + wdata->gpot[i*np + p]);
/* A positive dz means flow from the well perforation /* A positive dz means flow from the well perforation
i into the cell c */ i into the cell c */
surf_vol[c*np + p] += dz * dt / porevol[c]; surf_vol[c*np + p] += dz * dt / porevol[c];

View File

@ -108,13 +108,14 @@ cfs_tpfa_impes_maxtime(grid_t *G,
const double *gravity); const double *gravity);
void void
cfs_tpfa_expl_mass_transport(grid_t *G, cfs_tpfa_expl_mass_transport(grid_t *G,
well_t *W, well_t *W,
int np, struct completion_data *wdata,
double dt, int np,
const double *porevol, double dt,
struct cfs_tpfa_data *h, const double *porevol,
double *surf_vol); struct cfs_tpfa_data *h,
double *surf_vol);
void void
cfs_tpfa_destroy(struct cfs_tpfa_data *h); cfs_tpfa_destroy(struct cfs_tpfa_data *h);