From bd013a7d4d6bdf0b8ec959ce86249fe3f612716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 29 Oct 2012 17:23:17 +0100 Subject: [PATCH] Added parameters for controlling use of multidim upwinding. For now, you will simply get SPU even with use_multidim_upwind=true. --- .../reorder/TransportModelTracerTof.cpp | 17 +++++++++++++---- .../reorder/TransportModelTracerTof.hpp | 7 ++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/opm/core/transport/reorder/TransportModelTracerTof.cpp b/opm/core/transport/reorder/TransportModelTracerTof.cpp index 8d93f2480..e5202a6d3 100644 --- a/opm/core/transport/reorder/TransportModelTracerTof.cpp +++ b/opm/core/transport/reorder/TransportModelTracerTof.cpp @@ -30,8 +30,9 @@ namespace Opm /// Construct solver. /// \param[in] grid A 2d or 3d grid. - TransportModelTracerTof::TransportModelTracerTof(const UnstructuredGrid& grid) - : grid_(grid) + TransportModelTracerTof::TransportModelTracerTof(const UnstructuredGrid& grid, + const bool use_multidim_upwind) + : grid_(grid), use_multidim_upwind_(use_multidim_upwind) { } @@ -94,7 +95,11 @@ namespace Opm // Add flux to upwind_term or downwind_flux, if interior. if (other != -1) { if (flux < 0.0) { - upwind_term += flux*tof_[other]; + if (use_multidim_upwind_) { + upwind_term += flux*multidimUpwindTof(f, other); + } else { + upwind_term += flux*tof_[other]; + } } else { downwind_flux += flux; } @@ -117,6 +122,10 @@ namespace Opm } - + double TransportModelTracerTof::multidimUpwindTof(const int face, const int upwind_cell) const + { + // Just SPU for now... + return tof_[upwind_cell]; + } } // namespace Opm diff --git a/opm/core/transport/reorder/TransportModelTracerTof.hpp b/opm/core/transport/reorder/TransportModelTracerTof.hpp index 270ac328a..39b280d4b 100644 --- a/opm/core/transport/reorder/TransportModelTracerTof.hpp +++ b/opm/core/transport/reorder/TransportModelTracerTof.hpp @@ -43,7 +43,9 @@ namespace Opm public: /// Construct solver. /// \param[in] grid A 2d or 3d grid. - TransportModelTracerTof(const UnstructuredGrid& grid); + /// \param[in] use_multidim_upwind If true, use multidimensional tof upwinding. + TransportModelTracerTof(const UnstructuredGrid& grid, + const bool use_multidim_upwind = false); /// Solve for time-of-flight. /// \param[in] darcyflux Array of signed face fluxes. @@ -61,12 +63,15 @@ namespace Opm virtual void solveSingleCell(const int cell); virtual void solveMultiCell(const int num_cells, const int* cells); + double multidimUpwindTof(const int face, const int upwind_cell) const; + private: const UnstructuredGrid& grid_; const double* darcyflux_; // one flux per grid face const double* porevolume_; // one volume per cell const double* source_; // one volumetric source term per cell double* tof_; + bool use_multidim_upwind_; }; } // namespace Opm