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