Continued renaming of transpormodels to transportsolver*reorder
This commit is contained in:
parent
4224e1f463
commit
0db443553b
@ -26,7 +26,7 @@
|
||||
#include <cassert>
|
||||
|
||||
|
||||
void Opm::TransportModelInterface::reorderAndTransport(const UnstructuredGrid& grid, const double* darcyflux)
|
||||
void Opm::ReorderSolverInterface::reorderAndTransport(const UnstructuredGrid& grid, const double* darcyflux)
|
||||
{
|
||||
// Compute reordered sequence of single-cell problems
|
||||
std::vector<int> sequence(grid.number_of_cells);
|
||||
|
@ -17,8 +17,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_TRANSPORTMODELINTERFACE_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTMODELINTERFACE_HEADER_INCLUDED
|
||||
#ifndef OPM_REORDERSOLVERINTERFACE_HEADER_INCLUDED
|
||||
#define OPM_REORDERSOLVERINTERFACE_HEADER_INCLUDED
|
||||
|
||||
struct UnstructuredGrid;
|
||||
|
||||
@ -32,10 +32,10 @@ namespace Opm
|
||||
/// needs. (The solve() method is therefore not virtual in this
|
||||
/// class.) The reorderAndTransport() method is provided as an aid
|
||||
/// to implementing solve() in subclasses.
|
||||
class TransportModelInterface
|
||||
class ReorderSolverInterface
|
||||
{
|
||||
public:
|
||||
virtual ~TransportModelInterface() {}
|
||||
virtual ~ReorderSolverInterface() {}
|
||||
private:
|
||||
virtual void solveSingleCell(const int cell) = 0;
|
||||
virtual void solveMultiCell(const int num_cells, const int* cells) = 0;
|
||||
|
@ -30,7 +30,7 @@ namespace Opm
|
||||
|
||||
/// Construct solver.
|
||||
/// \param[in] grid A 2d or 3d grid.
|
||||
TransportModelTracerTof::TransportModelTracerTof(const UnstructuredGrid& grid)
|
||||
TofReorder::TofReorder(const UnstructuredGrid& grid)
|
||||
: grid_(grid)
|
||||
{
|
||||
}
|
||||
@ -45,7 +45,7 @@ namespace Opm
|
||||
/// (+) inflow flux,
|
||||
/// (-) outflow flux.
|
||||
/// \param[out] tof Array of time-of-flight values.
|
||||
void TransportModelTracerTof::solveTof(const double* darcyflux,
|
||||
void TofReorder::solveTof(const double* darcyflux,
|
||||
const double* porevolume,
|
||||
const double* source,
|
||||
std::vector<double>& tof)
|
||||
@ -69,7 +69,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTof::solveSingleCell(const int cell)
|
||||
void TofReorder::solveSingleCell(const int cell)
|
||||
{
|
||||
// Compute flux terms.
|
||||
// Sources have zero tof, and therefore do not contribute
|
||||
@ -108,7 +108,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTof::solveMultiCell(const int num_cells, const int* cells)
|
||||
void TofReorder::solveMultiCell(const int num_cells, const int* cells)
|
||||
{
|
||||
std::cout << "Pretending to solve multi-cell dependent equation with " << num_cells << " cells." << std::endl;
|
||||
for (int i = 0; i < num_cells; ++i) {
|
||||
|
@ -17,8 +17,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_TRANSPORTMODELTRACERTOF_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTMODELTRACERTOF_HEADER_INCLUDED
|
||||
#ifndef OPM_TOFREORDER_HEADER_INCLUDED
|
||||
#define OPM_TOFREORDER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||
#include <vector>
|
||||
@ -38,12 +38,12 @@ namespace Opm
|
||||
/// where v is the fluid velocity, \tau is time-of-flight and
|
||||
/// \phi is the porosity. This is a boundary value problem, where
|
||||
/// \tau is specified to be zero on all inflow boundaries.
|
||||
class TransportModelTracerTof : public TransportModelInterface
|
||||
class TofReorder : public ReorderSolverInterface
|
||||
{
|
||||
public:
|
||||
/// Construct solver.
|
||||
/// \param[in] grid A 2d or 3d grid.
|
||||
TransportModelTracerTof(const UnstructuredGrid& grid);
|
||||
TofReorder(const UnstructuredGrid& grid);
|
||||
|
||||
/// Solve for time-of-flight.
|
||||
/// \param[in] darcyflux Array of signed face fluxes.
|
||||
|
@ -413,7 +413,7 @@ namespace Opm
|
||||
/// \param[in] grid A 2d or 3d grid.
|
||||
/// \param[in] use_cvi If true, use corner point velocity interpolation.
|
||||
/// Otherwise, use the basic constant interpolation.
|
||||
TransportModelTracerTofDiscGal::TransportModelTracerTofDiscGal(const UnstructuredGrid& grid,
|
||||
TofDiscGalReorder::TofDiscGalReorder(const UnstructuredGrid& grid,
|
||||
const bool use_cvi)
|
||||
: grid_(grid),
|
||||
coord_(grid.dimensions),
|
||||
@ -442,7 +442,7 @@ namespace Opm
|
||||
/// cell comes before the K coefficients corresponding
|
||||
/// to the second cell etc.
|
||||
/// K depends on degree and grid dimension.
|
||||
void TransportModelTracerTofDiscGal::solveTof(const double* darcyflux,
|
||||
void TofDiscGalReorder::solveTof(const double* darcyflux,
|
||||
const double* porevolume,
|
||||
const double* source,
|
||||
const int degree,
|
||||
@ -476,7 +476,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTofDiscGal::solveSingleCell(const int cell)
|
||||
void TofDiscGalReorder::solveSingleCell(const int cell)
|
||||
{
|
||||
// Residual:
|
||||
// For each cell K, basis function b_j (spanning V_h),
|
||||
@ -643,7 +643,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTofDiscGal::solveMultiCell(const int num_cells, const int* cells)
|
||||
void TofDiscGalReorder::solveMultiCell(const int num_cells, const int* cells)
|
||||
{
|
||||
std::cout << "Pretending to solve multi-cell dependent equation with " << num_cells << " cells." << std::endl;
|
||||
for (int i = 0; i < num_cells; ++i) {
|
||||
|
@ -17,8 +17,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_TRANSPORTMODELTRACERTOFDISCGAL_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTMODELTRACERTOFDISCGAL_HEADER_INCLUDED
|
||||
#ifndef OPM_TOFDISCGALREORDER_HEADER_INCLUDED
|
||||
#define OPM_TOFDISCGALREORDER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
@ -43,14 +43,14 @@ namespace Opm
|
||||
/// \tau is specified to be zero on all inflow boundaries.
|
||||
/// The user may specify the polynomial degree of the basis function space
|
||||
/// used, but only degrees 0 and 1 are supported so far.
|
||||
class TransportModelTracerTofDiscGal : public TransportModelInterface
|
||||
class TofDiscGalReorder : public ReorderSolverInterface
|
||||
{
|
||||
public:
|
||||
/// Construct solver.
|
||||
/// \param[in] grid A 2d or 3d grid.
|
||||
/// \param[in] use_cvi If true, use corner point velocity interpolation.
|
||||
/// Otherwise, use the basic constant interpolation.
|
||||
TransportModelTracerTofDiscGal(const UnstructuredGrid& grid,
|
||||
TofDiscGalReorder(const UnstructuredGrid& grid,
|
||||
const bool use_cvi);
|
||||
|
||||
|
||||
@ -79,8 +79,8 @@ namespace Opm
|
||||
|
||||
private:
|
||||
// Disable copying and assignment.
|
||||
TransportModelTracerTofDiscGal(const TransportModelTracerTofDiscGal&);
|
||||
TransportModelTracerTofDiscGal& operator=(const TransportModelTracerTofDiscGal&);
|
||||
TofDiscGalReorder(const TofDiscGalReorder&);
|
||||
TofDiscGalReorder& operator=(const TofDiscGalReorder&);
|
||||
|
||||
const UnstructuredGrid& grid_;
|
||||
boost::shared_ptr<VelocityInterpolationInterface> velocity_interpolation_;
|
||||
|
@ -39,7 +39,7 @@ namespace Opm
|
||||
typedef RegulaFalsi<WarnAndContinueOnError> RootFinder;
|
||||
|
||||
|
||||
TransportModelCompressibleTwophase::TransportModelCompressibleTwophase(
|
||||
TransportSolverCompressibleTwophaseReorder::TransportSolverCompressibleTwophaseReorder(
|
||||
const UnstructuredGrid& grid,
|
||||
const Opm::BlackoilPropertiesInterface& props,
|
||||
const double tol,
|
||||
@ -76,7 +76,7 @@ namespace Opm
|
||||
props.satRange(props.numCells(), &allcells_[0], &smin_[0], &smax_[0]);
|
||||
}
|
||||
|
||||
void TransportModelCompressibleTwophase::solve(const double* darcyflux,
|
||||
void TransportSolverCompressibleTwophaseReorder::solve(const double* darcyflux,
|
||||
const double* pressure,
|
||||
const double* porevolume0,
|
||||
const double* porevolume,
|
||||
@ -132,7 +132,7 @@ namespace Opm
|
||||
// We need the formula influx = B_i sum_{j->i} b_j v_{ij} - B_i q_w.
|
||||
// outflux = B_i sum_{i->j} b_i v_{ij} - B_i q = sum_{i->j} v_{ij} - B_i q
|
||||
// Influxes are negative, outfluxes positive.
|
||||
struct TransportModelCompressibleTwophase::Residual
|
||||
struct TransportSolverCompressibleTwophaseReorder::Residual
|
||||
{
|
||||
int cell;
|
||||
double B_cell;
|
||||
@ -142,8 +142,8 @@ namespace Opm
|
||||
// @@@ TODO: figure out change to rock-comp. terms with fluid compr.
|
||||
double comp_term; // Now: used to be: q - sum_j v_ij
|
||||
double dtpv; // dt/pv(i)
|
||||
const TransportModelCompressibleTwophase& tm;
|
||||
explicit Residual(const TransportModelCompressibleTwophase& tmodel, int cell_index)
|
||||
const TransportSolverCompressibleTwophaseReorder& tm;
|
||||
explicit Residual(const TransportSolverCompressibleTwophaseReorder& tmodel, int cell_index)
|
||||
: tm(tmodel)
|
||||
{
|
||||
cell = cell_index;
|
||||
@ -187,7 +187,7 @@ namespace Opm
|
||||
};
|
||||
|
||||
|
||||
void TransportModelCompressibleTwophase::solveSingleCell(const int cell)
|
||||
void TransportSolverCompressibleTwophaseReorder::solveSingleCell(const int cell)
|
||||
{
|
||||
Residual res(*this, cell);
|
||||
int iters_used;
|
||||
@ -196,7 +196,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
void TransportModelCompressibleTwophase::solveMultiCell(const int num_cells, const int* cells)
|
||||
void TransportSolverCompressibleTwophaseReorder::solveMultiCell(const int num_cells, const int* cells)
|
||||
{
|
||||
// Experiment: when a cell changes more than the tolerance,
|
||||
// mark all downwind cells as needing updates. After
|
||||
@ -302,7 +302,7 @@ namespace Opm
|
||||
|
||||
}
|
||||
|
||||
double TransportModelCompressibleTwophase::fracFlow(double s, int cell) const
|
||||
double TransportSolverCompressibleTwophaseReorder::fracFlow(double s, int cell) const
|
||||
{
|
||||
double sat[2] = { s, 1.0 - s };
|
||||
double mob[2];
|
||||
@ -321,15 +321,15 @@ namespace Opm
|
||||
// [[ incompressible was: r(s) = s - s0 + dt/pv*sum_{j adj i}( gravmod_ij * gf_ij ) ]]
|
||||
//
|
||||
// r(s) = s - B*z0 + dt/pv*( influx + outflux*f(s) )
|
||||
struct TransportModelCompressibleTwophase::GravityResidual
|
||||
struct TransportSolverCompressibleTwophaseReorder::GravityResidual
|
||||
{
|
||||
int cell;
|
||||
int nbcell[2];
|
||||
double s0;
|
||||
double dtpv; // dt/pv(i)
|
||||
double gf[2];
|
||||
const TransportModelCompressibleTwophase& tm;
|
||||
explicit GravityResidual(const TransportModelCompressibleTwophase& tmodel,
|
||||
const TransportSolverCompressibleTwophaseReorder& tm;
|
||||
explicit GravityResidual(const TransportSolverCompressibleTwophaseReorder& tmodel,
|
||||
const std::vector<int>& cells,
|
||||
const int pos,
|
||||
const double* gravflux) // Always oriented towards next in column. Size = colsize - 1.
|
||||
@ -376,7 +376,7 @@ namespace Opm
|
||||
}
|
||||
};
|
||||
|
||||
void TransportModelCompressibleTwophase::mobility(double s, int cell, double* mob) const
|
||||
void TransportSolverCompressibleTwophaseReorder::mobility(double s, int cell, double* mob) const
|
||||
{
|
||||
double sat[2] = { s, 1.0 - s };
|
||||
props_.relperm(1, sat, &cell, mob, 0);
|
||||
@ -386,7 +386,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelCompressibleTwophase::initGravity(const double* grav)
|
||||
void TransportSolverCompressibleTwophaseReorder::initGravity(const double* grav)
|
||||
{
|
||||
// Set up transmissibilities.
|
||||
std::vector<double> htrans(grid_.cell_facepos[grid_.number_of_cells]);
|
||||
@ -403,7 +403,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelCompressibleTwophase::initGravityDynamic()
|
||||
void TransportSolverCompressibleTwophaseReorder::initGravityDynamic()
|
||||
{
|
||||
// Set up gravflux_ = T_ij g [ (b_w,i rho_w,S - b_o,i rho_o,S) (z_i - z_f)
|
||||
// + (b_w,j rho_w,S - b_o,j rho_o,S) (z_f - z_j) ]
|
||||
@ -436,7 +436,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelCompressibleTwophase::solveSingleCellGravity(const std::vector<int>& cells,
|
||||
void TransportSolverCompressibleTwophaseReorder::solveSingleCellGravity(const std::vector<int>& cells,
|
||||
const int pos,
|
||||
const double* gravflux)
|
||||
{
|
||||
@ -451,7 +451,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
int TransportModelCompressibleTwophase::solveGravityColumn(const std::vector<int>& cells)
|
||||
int TransportSolverCompressibleTwophaseReorder::solveGravityColumn(const std::vector<int>& cells)
|
||||
{
|
||||
// Set up column gravflux.
|
||||
const int nc = cells.size();
|
||||
@ -504,7 +504,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelCompressibleTwophase::solveGravity(const std::vector<std::vector<int> >& columns,
|
||||
void TransportSolverCompressibleTwophaseReorder::solveGravity(const std::vector<std::vector<int> >& columns,
|
||||
const double dt,
|
||||
std::vector<double>& saturation,
|
||||
std::vector<double>& surfacevol)
|
||||
|
@ -17,8 +17,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_TRANSPORTMODELCOMPRESSIBLETWOPHASE_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTMODELCOMPRESSIBLETWOPHASE_HEADER_INCLUDED
|
||||
#ifndef OPM_TRANSPORTSOLVERCOMPRESSIBLETWOPHASEREORDER_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTSOLVERCOMPRESSIBLETWOPHASEREORDER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||
#include <vector>
|
||||
@ -32,7 +32,7 @@ namespace Opm
|
||||
|
||||
/// Implements a reordering transport solver for compressible,
|
||||
/// non-miscible two-phase flow.
|
||||
class TransportModelCompressibleTwophase : public TransportModelInterface
|
||||
class TransportSolverCompressibleTwophaseReorder : public ReorderSolverInterface
|
||||
{
|
||||
public:
|
||||
/// Construct solver.
|
||||
@ -40,7 +40,7 @@ namespace Opm
|
||||
/// \param[in] props Rock and fluid properties.
|
||||
/// \param[in] tol Tolerance used in the solver.
|
||||
/// \param[in] maxit Maximum number of non-linear iterations used.
|
||||
TransportModelCompressibleTwophase(const UnstructuredGrid& grid,
|
||||
TransportSolverCompressibleTwophaseReorder(const UnstructuredGrid& grid,
|
||||
const Opm::BlackoilPropertiesInterface& props,
|
||||
const double tol,
|
||||
const int maxit);
|
||||
|
@ -17,8 +17,8 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_TRANSPORTMODELTWOPHASE_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTMODELTWOPHASE_HEADER_INCLUDED
|
||||
#ifndef OPM_TRANSPORTSOLVERTWOPHASEREORDER_HEADER_INCLUDED
|
||||
#define OPM_TRANSPORTSOLVERTWOPHASEREORDER_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||
#include <vector>
|
||||
@ -32,7 +32,7 @@ namespace Opm
|
||||
class IncompPropertiesInterface;
|
||||
|
||||
/// Implements a reordering transport solver for incompressible two-phase flow.
|
||||
class TransportModelTwophase : public TransportModelInterface
|
||||
class TransportSolverTwophaseReorder : public ReorderSolverInterface
|
||||
{
|
||||
public:
|
||||
/// Construct solver.
|
||||
@ -40,7 +40,7 @@ namespace Opm
|
||||
/// \param[in] props Rock and fluid properties.
|
||||
/// \param[in] tol Tolerance used in the solver.
|
||||
/// \param[in] maxit Maximum number of non-linear iterations used.
|
||||
TransportModelTwophase(const UnstructuredGrid& grid,
|
||||
TransportSolverTwophaseReorder(const UnstructuredGrid& grid,
|
||||
const Opm::IncompPropertiesInterface& props,
|
||||
const double tol,
|
||||
const int maxit);
|
Loading…
Reference in New Issue
Block a user