No longer ignores boundary fluxes.

This means that the class does expect source terms that are just that, and not
'transport source' terms that include boundary inflows (like the transport
solvers expect). This is also consistent with the behaviour of the DG version.
This commit is contained in:
Atgeirr Flø Rasmussen 2012-12-05 10:39:00 +01:00
parent 8fce539d3d
commit 534f8f8bb6

View File

@ -100,15 +100,18 @@ namespace Opm
flux =-darcyflux_[f]; flux =-darcyflux_[f];
other = grid_.face_cells[2*f]; other = grid_.face_cells[2*f];
} }
// Add flux to upwind_term or downwind_flux, if interior. // Add flux to upwind_term or downwind_flux
if (other != -1) {
if (flux < 0.0) { if (flux < 0.0) {
// Using tof == 0 on inflow, so we only add a
// nonzero contribution if we are on an internal
// face.
if (other != -1) {
upwind_term += flux*tof_[other]; upwind_term += flux*tof_[other];
}
} else { } else {
downwind_flux += flux; downwind_flux += flux;
} }
} }
}
// Compute tof. // Compute tof.
tof_[cell] = (porevolume_[cell] - upwind_term)/downwind_flux; tof_[cell] = (porevolume_[cell] - upwind_term)/downwind_flux;
@ -131,17 +134,13 @@ namespace Opm
for (int i = grid_.cell_facepos[cell]; i < grid_.cell_facepos[cell+1]; ++i) { for (int i = grid_.cell_facepos[cell]; i < grid_.cell_facepos[cell+1]; ++i) {
int f = grid_.cell_faces[i]; int f = grid_.cell_faces[i];
double flux; double flux;
int other;
// Compute cell flux // Compute cell flux
if (cell == grid_.face_cells[2*f]) { if (cell == grid_.face_cells[2*f]) {
flux = darcyflux_[f]; flux = darcyflux_[f];
other = grid_.face_cells[2*f+1];
} else { } else {
flux =-darcyflux_[f]; flux =-darcyflux_[f];
other = grid_.face_cells[2*f];
} }
// Add flux to upwind_term or downwind_flux, if interior. // Add flux to upwind_term or downwind_term_[face|cell_factor].
if (other != -1) {
if (flux < 0.0) { if (flux < 0.0) {
upwind_term += flux*face_tof_[f]; upwind_term += flux*face_tof_[f];
} else { } else {
@ -151,7 +150,6 @@ namespace Opm
downwind_term_cell_factor += cterm_factor*flux; downwind_term_cell_factor += cterm_factor*flux;
} }
} }
}
// Compute tof for cell. // Compute tof for cell.
tof_[cell] = (porevolume_[cell] - upwind_term - downwind_term_face)/downwind_term_cell_factor; // } tof_[cell] = (porevolume_[cell] - upwind_term - downwind_term_face)/downwind_term_cell_factor; // }