mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make TransportSolverTwophaseReorder inherit TransportSolverTwophaseInterface.
This changes the solve() interface, which requires clients to change.
This commit is contained in:
parent
28fc68cf71
commit
da985748d0
@ -41,9 +41,9 @@ namespace Opm
|
||||
|
||||
|
||||
TransportSolverTwophaseReorder::TransportSolverTwophaseReorder(const UnstructuredGrid& grid,
|
||||
const Opm::IncompPropertiesInterface& props,
|
||||
const double tol,
|
||||
const int maxit)
|
||||
const Opm::IncompPropertiesInterface& props,
|
||||
const double tol,
|
||||
const int maxit)
|
||||
: grid_(grid),
|
||||
props_(props),
|
||||
tol_(tol),
|
||||
@ -76,17 +76,22 @@ namespace Opm
|
||||
props.satRange(props.numCells(), &cells[0], &smin_[0], &smax_[0]);
|
||||
}
|
||||
|
||||
void TransportSolverTwophaseReorder::solve(const double* darcyflux,
|
||||
const double* porevolume,
|
||||
const double* source,
|
||||
const double dt,
|
||||
std::vector<double>& saturation)
|
||||
|
||||
TransportSolverTwophaseReorder::~TransportSolverTwophaseReorder()
|
||||
{
|
||||
darcyflux_ = darcyflux;
|
||||
}
|
||||
|
||||
|
||||
void TransportSolverTwophaseReorder::solve(const double* porevolume,
|
||||
const double* source,
|
||||
const double dt,
|
||||
TwophaseState& state)
|
||||
{
|
||||
darcyflux_ = &state.faceflux()[0];
|
||||
porevolume_ = porevolume;
|
||||
source_ = source;
|
||||
dt_ = dt;
|
||||
toWaterSat(saturation, saturation_);
|
||||
toWaterSat(state.saturation(), saturation_);
|
||||
|
||||
#ifdef EXPERIMENT_GAUSS_SEIDEL
|
||||
std::vector<int> seq(grid_.number_of_cells);
|
||||
@ -97,14 +102,14 @@ namespace Opm
|
||||
&ia_upw_[0], &ja_upw_[0]);
|
||||
const int nf = grid_.number_of_faces;
|
||||
std::vector<double> neg_darcyflux(nf);
|
||||
std::transform(darcyflux, darcyflux + nf, neg_darcyflux.begin(), std::negate<double>());
|
||||
std::transform(darcyflux_, darcyflux_ + nf, neg_darcyflux.begin(), std::negate<double>());
|
||||
compute_sequence_graph(&grid_, &neg_darcyflux[0],
|
||||
&seq[0], &comp[0], &ncomp,
|
||||
&ia_downw_[0], &ja_downw_[0]);
|
||||
#endif
|
||||
std::fill(reorder_iterations_.begin(),reorder_iterations_.end(),0);
|
||||
reorderAndTransport(grid_, darcyflux);
|
||||
toBothSat(saturation_, saturation);
|
||||
reorderAndTransport(grid_, darcyflux_);
|
||||
toBothSat(saturation_, state.saturation());
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#define OPM_TRANSPORTSOLVERTWOPHASEREORDER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <opm/core/transport/TransportSolverTwophaseInterface.hpp>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
@ -32,7 +33,7 @@ namespace Opm
|
||||
class IncompPropertiesInterface;
|
||||
|
||||
/// Implements a reordering transport solver for incompressible two-phase flow.
|
||||
class TransportSolverTwophaseReorder : public ReorderSolverInterface
|
||||
class TransportSolverTwophaseReorder : public TransportSolverTwophaseInterface, ReorderSolverInterface
|
||||
{
|
||||
public:
|
||||
/// Construct solver.
|
||||
@ -45,17 +46,19 @@ namespace Opm
|
||||
const double tol,
|
||||
const int maxit);
|
||||
|
||||
// Virtual destructor.
|
||||
virtual ~TransportSolverTwophaseReorder();
|
||||
|
||||
/// Solve for saturation at next timestep.
|
||||
/// \param[in] darcyflux Array of signed face fluxes.
|
||||
/// \param[in] porevolume Array of pore volumes.
|
||||
/// \param[in] source Transport source term.
|
||||
/// \param[in] dt Time step.
|
||||
/// \param[in, out] saturation Phase saturations.
|
||||
void solve(const double* darcyflux,
|
||||
const double* porevolume,
|
||||
const double* source,
|
||||
const double dt,
|
||||
std::vector<double>& saturation);
|
||||
/// \param[in] porevolume Array of pore volumes.
|
||||
/// \param[in] source Transport source term. For interpretation see Opm::computeTransportSource().
|
||||
/// \param[in] dt Time step.
|
||||
/// \param[in, out] state Reservoir state. Calling solve() will read state.faceflux() and
|
||||
/// read and write state.saturation().
|
||||
virtual void solve(const double* porevolume,
|
||||
const double* source,
|
||||
const double dt,
|
||||
TwophaseState& state);
|
||||
|
||||
/// Initialise quantities needed by gravity solver.
|
||||
/// \param[in] grav gravity vector
|
||||
|
Loading…
Reference in New Issue
Block a user