Added parameters for controlling use of multidim upwinding.
For now, you will simply get SPU even with use_multidim_upwind=true.
This commit is contained in:
@@ -169,8 +169,11 @@ main(int argc, char** argv)
|
||||
// Choice of tof solver.
|
||||
bool use_dg = param.getDefault("use_dg", false);
|
||||
int dg_degree = -1;
|
||||
bool use_multidim_upwind = false;
|
||||
if (use_dg) {
|
||||
dg_degree = param.getDefault("dg_degree", 0);
|
||||
} else {
|
||||
use_multidim_upwind = param.getDefault("use_multidim_upwind", false);
|
||||
}
|
||||
|
||||
// Write parameters used for later reference.
|
||||
@@ -231,7 +234,7 @@ main(int argc, char** argv)
|
||||
tofsolver.solveTof(&state.faceflux()[0], &porevol[0], &transport_src[0], dg_degree, tof);
|
||||
transport_timer.stop();
|
||||
} else {
|
||||
Opm::TransportModelTracerTof tofsolver(*grid->c_grid());
|
||||
Opm::TransportModelTracerTof tofsolver(*grid->c_grid(), use_multidim_upwind);
|
||||
transport_timer.start();
|
||||
tofsolver.solveTof(&state.faceflux()[0], &porevol[0], &transport_src[0], tof);
|
||||
transport_timer.stop();
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user