mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge remote-tracking branch 'hnil/hnil_class' into combined.
Conflicts: CMakeLists.txt examples/sim_wateroil.cpp opm/core/grid/cpgpreprocess/geometry.c opm/core/transport/reorder/ReorderSolverInterface.hpp opm/core/transport/reorder/TofDiscGalReorder.cpp opm/core/transport/reorder/TofDiscGalReorder.hpp opm/core/transport/reorder/TofReorder.cpp opm/core/transport/reorder/TofReorder.hpp opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.cpp opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp
This commit is contained in:
commit
e99e023980
@ -24,9 +24,12 @@ namespace Opm
|
||||
{
|
||||
|
||||
BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck(const EclipseGridParser& deck,
|
||||
const UnstructuredGrid& grid)
|
||||
const UnstructuredGrid& grid,
|
||||
bool init_rock)
|
||||
{
|
||||
if (init_rock){
|
||||
rock_.init(deck, grid);
|
||||
}
|
||||
pvt_.init(deck, 200);
|
||||
SaturationPropsFromDeck<SatFuncSimpleUniform>* ptr
|
||||
= new SaturationPropsFromDeck<SatFuncSimpleUniform>();
|
||||
@ -41,9 +44,13 @@ namespace Opm
|
||||
|
||||
BlackoilPropertiesFromDeck::BlackoilPropertiesFromDeck(const EclipseGridParser& deck,
|
||||
const UnstructuredGrid& grid,
|
||||
const parameter::ParameterGroup& param)
|
||||
const parameter::ParameterGroup& param,
|
||||
bool init_rock)
|
||||
{
|
||||
if(init_rock){
|
||||
rock_.init(deck, grid);
|
||||
}
|
||||
|
||||
const int pvt_samples = param.getDefault("pvt_tab_size", 200);
|
||||
pvt_.init(deck, pvt_samples);
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace Opm
|
||||
/// mapping from cell indices (typically from a processed grid)
|
||||
/// to logical cartesian indices consistent with the deck.
|
||||
BlackoilPropertiesFromDeck(const EclipseGridParser& deck,
|
||||
const UnstructuredGrid& grid);
|
||||
const UnstructuredGrid& grid, bool init_rock=true );
|
||||
|
||||
/// Initialize from deck, grid and parameters.
|
||||
/// \param[in] deck Deck input parser
|
||||
@ -60,7 +60,8 @@ namespace Opm
|
||||
/// be done, and the input fluid data used directly for linear interpolation.
|
||||
BlackoilPropertiesFromDeck(const EclipseGridParser& deck,
|
||||
const UnstructuredGrid& grid,
|
||||
const parameter::ParameterGroup& param);
|
||||
const parameter::ParameterGroup& param,
|
||||
bool init_rock=true);
|
||||
|
||||
/// Destructor.
|
||||
virtual ~BlackoilPropertiesFromDeck();
|
||||
|
32
opm/core/transport/TwoPhaseTransportSolver.cpp
Normal file
32
opm/core/transport/TwoPhaseTransportSolver.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*===========================================================================
|
||||
//
|
||||
// File: TwoPhaseTransportSolver.cpp
|
||||
//
|
||||
// Author: hnil <hnil@sintef.no>
|
||||
//
|
||||
// Created: 9 Nov 2012
|
||||
//==========================================================================*/
|
||||
/*
|
||||
Copyright 2011 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2011 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media Project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "TwoPhaseTransportSolver.hpp"
|
||||
|
||||
|
60
opm/core/transport/TwoPhaseTransportSolver.hpp
Normal file
60
opm/core/transport/TwoPhaseTransportSolver.hpp
Normal file
@ -0,0 +1,60 @@
|
||||
/*===========================================================================
|
||||
//
|
||||
// File: TwoPhaseTransportSolver.hpp
|
||||
//
|
||||
// Author: hnil <hnil@sintef.no>
|
||||
//
|
||||
// Created: 9 Nov 2012
|
||||
//==========================================================================*/
|
||||
/*
|
||||
Copyright 2011 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2011 Statoil ASA.
|
||||
|
||||
This file is part of the Open Porous Media Project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TWOPHASETRANSPORTSOLVER_HPP
|
||||
#define TWOPHASETRANSPORTSOLVER_HPP
|
||||
|
||||
#include <opm/core/simulator/TwophaseState.hpp>
|
||||
#include <opm/core/simulator/WellState.hpp>
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
/// Base class for tranport solvers
|
||||
class TwoPhaseTransportSolver
|
||||
{
|
||||
public:
|
||||
/// Virtual destructor to enable inheritance.
|
||||
virtual ~TwoPhaseTransportSolver() {}
|
||||
|
||||
/// 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.
|
||||
virtual void solve(const double* porevolume,
|
||||
const double* source,
|
||||
const double dt,
|
||||
TwophaseState& state,
|
||||
WellState& wstate) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // TWOPHASETRANSPORTSOLVER_HPP
|
@ -17,7 +17,7 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelInterface.hpp>
|
||||
#include <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <opm/core/transport/reorder/reordersequence.h>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/utility/StopWatch.hpp>
|
||||
@ -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
|
||||
sequence_.resize(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
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -35,10 +35,10 @@ namespace Opm
|
||||
/// class.) The reorderAndTransport() method is provided as an aid
|
||||
/// to implementing solve() in subclasses, together with the
|
||||
/// sequence() and components() methods for accessing the ordering.
|
||||
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;
|
@ -19,7 +19,7 @@
|
||||
|
||||
#include <opm/core/grid/CellQuadrature.hpp>
|
||||
#include <opm/core/grid/FaceQuadrature.hpp>
|
||||
#include <opm/core/transport/reorder/TransportModelTracerTofDiscGal.hpp>
|
||||
#include <opm/core/transport/reorder/TofDiscGalReorder.hpp>
|
||||
#include <opm/core/transport/reorder/DGBasis.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
@ -34,10 +34,6 @@ namespace Opm
|
||||
{
|
||||
|
||||
|
||||
// --------------- Methods of TransportModelTracerTofDiscGal ---------------
|
||||
|
||||
|
||||
|
||||
/// Construct solver.
|
||||
/// \param[in] grid A 2d or 3d grid.
|
||||
/// \param[in] param Parameters for the solver.
|
||||
@ -55,7 +51,7 @@ namespace Opm
|
||||
/// computing (unlimited) solution.
|
||||
/// AsSimultaneousPostProcess Apply to each cell independently, using un-
|
||||
/// limited solution in neighbouring cells.
|
||||
TransportModelTracerTofDiscGal::TransportModelTracerTofDiscGal(const UnstructuredGrid& grid,
|
||||
TofDiscGalReorder::TofDiscGalReorder(const UnstructuredGrid& grid,
|
||||
const parameter::ParameterGroup& param)
|
||||
: grid_(grid),
|
||||
use_cvi_(false),
|
||||
@ -127,7 +123,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,
|
||||
std::vector<double>& tof_coeff)
|
||||
@ -173,7 +169,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),
|
||||
@ -396,7 +392,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,10 +17,10 @@
|
||||
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 <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@ -45,7 +45,7 @@ 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.
|
||||
@ -68,7 +68,7 @@ namespace Opm
|
||||
/// computing (unlimited) solution.
|
||||
/// AsSimultaneousPostProcess Apply to each cell independently, using un-
|
||||
/// limited solution in neighbouring cells.
|
||||
TransportModelTracerTofDiscGal(const UnstructuredGrid& grid,
|
||||
TofDiscGalReorder(const UnstructuredGrid& grid,
|
||||
const parameter::ParameterGroup& param);
|
||||
|
||||
|
||||
@ -95,8 +95,8 @@ namespace Opm
|
||||
|
||||
private:
|
||||
// Disable copying and assignment.
|
||||
TransportModelTracerTofDiscGal(const TransportModelTracerTofDiscGal&);
|
||||
TransportModelTracerTofDiscGal& operator=(const TransportModelTracerTofDiscGal&);
|
||||
TofDiscGalReorder(const TofDiscGalReorder&);
|
||||
TofDiscGalReorder& operator=(const TofDiscGalReorder&);
|
||||
|
||||
// Data members
|
||||
const UnstructuredGrid& grid_;
|
@ -17,7 +17,7 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelTracerTof.hpp>
|
||||
#include <opm/core/transport/reorder/TofReorder.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <algorithm>
|
||||
@ -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,
|
||||
const bool use_multidim_upwind)
|
||||
: grid_(grid),
|
||||
darcyflux_(0),
|
||||
@ -53,7 +53,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)
|
||||
@ -137,7 +137,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTracerTof::solveSingleCell(const int cell)
|
||||
void TofReorder::solveSingleCell(const int cell)
|
||||
{
|
||||
if (use_multidim_upwind_) {
|
||||
solveSingleCellMultidimUpwind(cell);
|
||||
@ -243,7 +243,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,10 +17,10 @@
|
||||
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 <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
@ -38,13 +38,13 @@ 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.
|
||||
/// \param[in] use_multidim_upwind If true, use multidimensional tof upwinding.
|
||||
TransportModelTracerTof(const UnstructuredGrid& grid,
|
||||
TofReorder(const UnstructuredGrid& grid,
|
||||
const bool use_multidim_upwind = false);
|
||||
|
||||
/// Solve for time-of-flight.
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelCompressibleTwophase.hpp>
|
||||
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
|
||||
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/transport/reorder/reordersequence.h>
|
||||
@ -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,10 +17,10 @@
|
||||
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 <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <vector>
|
||||
|
||||
struct UnstructuredGrid;
|
||||
@ -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,7 +17,7 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/transport/reorder/TransportModelTwophase.hpp>
|
||||
#include <opm/core/transport/reorder/TransportSolverTwophaseReorder.hpp>
|
||||
#include <opm/core/props/IncompPropertiesInterface.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/transport/reorder/reordersequence.h>
|
||||
@ -40,7 +40,7 @@ namespace Opm
|
||||
typedef RegulaFalsi<WarnAndContinueOnError> RootFinder;
|
||||
|
||||
|
||||
TransportModelTwophase::TransportModelTwophase(const UnstructuredGrid& grid,
|
||||
TransportSolverTwophaseReorder::TransportSolverTwophaseReorder(const UnstructuredGrid& grid,
|
||||
const Opm::IncompPropertiesInterface& props,
|
||||
const double tol,
|
||||
const int maxit)
|
||||
@ -76,7 +76,7 @@ namespace Opm
|
||||
props.satRange(props.numCells(), &cells[0], &smin_[0], &smax_[0]);
|
||||
}
|
||||
|
||||
void TransportModelTwophase::solve(const double* darcyflux,
|
||||
void TransportSolverTwophaseReorder::solve(const double* darcyflux,
|
||||
const double* porevolume,
|
||||
const double* source,
|
||||
const double dt,
|
||||
@ -108,7 +108,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
const std::vector<int>& TransportModelTwophase::getReorderIterations() const
|
||||
const std::vector<int>& TransportSolverTwophaseReorder::getReorderIterations() const
|
||||
{
|
||||
return reorder_iterations_;
|
||||
}
|
||||
@ -120,7 +120,7 @@ namespace Opm
|
||||
//
|
||||
// where influx is water influx, outflux is total outflux.
|
||||
// Influxes are negative, outfluxes positive.
|
||||
struct TransportModelTwophase::Residual
|
||||
struct TransportSolverTwophaseReorder::Residual
|
||||
{
|
||||
int cell;
|
||||
double s0;
|
||||
@ -128,8 +128,8 @@ namespace Opm
|
||||
double outflux; // sum_j max(v_ij, 0) - q
|
||||
double comp_term; // q - sum_j v_ij
|
||||
double dtpv; // dt/pv(i)
|
||||
const TransportModelTwophase& tm;
|
||||
explicit Residual(const TransportModelTwophase& tmodel, int cell_index)
|
||||
const TransportSolverTwophaseReorder& tm;
|
||||
explicit Residual(const TransportSolverTwophaseReorder& tmodel, int cell_index)
|
||||
: tm(tmodel)
|
||||
{
|
||||
cell = cell_index;
|
||||
@ -171,7 +171,7 @@ namespace Opm
|
||||
};
|
||||
|
||||
|
||||
void TransportModelTwophase::solveSingleCell(const int cell)
|
||||
void TransportSolverTwophaseReorder::solveSingleCell(const int cell)
|
||||
{
|
||||
Residual res(*this, cell);
|
||||
// const double r0 = res(saturation_[cell]);
|
||||
@ -225,7 +225,7 @@ namespace Opm
|
||||
// } // anon namespace
|
||||
|
||||
|
||||
void TransportModelTwophase::solveMultiCell(const int num_cells, const int* cells)
|
||||
void TransportSolverTwophaseReorder::solveMultiCell(const int num_cells, const int* cells)
|
||||
{
|
||||
// std::ofstream os("dump");
|
||||
// std::copy(cells, cells + num_cells, std::ostream_iterator<double>(os, "\n"));
|
||||
@ -440,7 +440,7 @@ namespace Opm
|
||||
#endif // EXPERIMENT_GAUSS_SEIDEL
|
||||
}
|
||||
|
||||
double TransportModelTwophase::fracFlow(double s, int cell) const
|
||||
double TransportSolverTwophaseReorder::fracFlow(double s, int cell) const
|
||||
{
|
||||
double sat[2] = { s, 1.0 - s };
|
||||
double mob[2];
|
||||
@ -458,15 +458,15 @@ namespace Opm
|
||||
//
|
||||
// r(s) = s - s0 + dt/pv*sum_{j adj i}( gravmod_ij * gf_ij ).
|
||||
//
|
||||
struct TransportModelTwophase::GravityResidual
|
||||
struct TransportSolverTwophaseReorder::GravityResidual
|
||||
{
|
||||
int cell;
|
||||
int nbcell[2];
|
||||
double s0;
|
||||
double dtpv; // dt/pv(i)
|
||||
double gf[2];
|
||||
const TransportModelTwophase& tm;
|
||||
explicit GravityResidual(const TransportModelTwophase& tmodel,
|
||||
const TransportSolverTwophaseReorder& tm;
|
||||
explicit GravityResidual(const TransportSolverTwophaseReorder& tmodel,
|
||||
const std::vector<int>& cells,
|
||||
const int pos,
|
||||
const double* gravflux) // Always oriented towards next in column. Size = colsize - 1.
|
||||
@ -513,7 +513,7 @@ namespace Opm
|
||||
}
|
||||
};
|
||||
|
||||
void TransportModelTwophase::mobility(double s, int cell, double* mob) const
|
||||
void TransportSolverTwophaseReorder::mobility(double s, int cell, double* mob) const
|
||||
{
|
||||
double sat[2] = { s, 1.0 - s };
|
||||
props_.relperm(1, sat, &cell, mob, 0);
|
||||
@ -523,7 +523,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTwophase::initGravity(const double* grav)
|
||||
void TransportSolverTwophaseReorder::initGravity(const double* grav)
|
||||
{
|
||||
// Set up gravflux_ = T_ij g (rho_w - rho_o) (z_i - z_j)
|
||||
std::vector<double> htrans(grid_.cell_facepos[grid_.number_of_cells]);
|
||||
@ -547,7 +547,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTwophase::solveSingleCellGravity(const std::vector<int>& cells,
|
||||
void TransportSolverTwophaseReorder::solveSingleCellGravity(const std::vector<int>& cells,
|
||||
const int pos,
|
||||
const double* gravflux)
|
||||
{
|
||||
@ -564,7 +564,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
int TransportModelTwophase::solveGravityColumn(const std::vector<int>& cells)
|
||||
int TransportSolverTwophaseReorder::solveGravityColumn(const std::vector<int>& cells)
|
||||
{
|
||||
// Set up column gravflux.
|
||||
const int nc = cells.size();
|
||||
@ -617,7 +617,7 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
void TransportModelTwophase::solveGravity(const std::vector<std::vector<int> >& columns,
|
||||
void TransportSolverTwophaseReorder::solveGravity(const std::vector<std::vector<int> >& columns,
|
||||
const double* porevolume,
|
||||
const double dt,
|
||||
std::vector<double>& saturation)
|
@ -17,10 +17,10 @@
|
||||
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 <opm/core/transport/reorder/ReorderSolverInterface.hpp>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <ostream>
|
||||
@ -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);
|
@ -225,7 +225,6 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Construct from existing wells object.
|
||||
WellsManager::WellsManager(struct Wells* W)
|
||||
: w_(clone_wells(W))
|
||||
|
Loading…
Reference in New Issue
Block a user