mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Moved PolymerInflow* classes to separate file.
Also, implemented PolymerInflowFromDeck (but not yet used).
This commit is contained in:
113
opm/polymer/PolymerInflow.hpp
Normal file
113
opm/polymer/PolymerInflow.hpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
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 OPM_POLYMERINFLOW_HEADER_INCLUDED
|
||||
#define OPM_POLYMERINFLOW_HEADER_INCLUDED
|
||||
|
||||
#include <opm/core/utility/SparseVector.hpp>
|
||||
#include <vector>
|
||||
|
||||
struct Wells;
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
class EclipseGridParser;
|
||||
|
||||
|
||||
|
||||
/// @brief Interface for classes encapsulating polymer inflow information.
|
||||
class PolymerInflowInterface
|
||||
{
|
||||
public:
|
||||
/// Virtual destructor for subclassing.
|
||||
virtual ~PolymerInflowInterface() {}
|
||||
|
||||
/// Get inflow concentrations for all cells.
|
||||
/// \param[in] step_start Start of timestep.
|
||||
/// \param[in] step_end End of timestep.
|
||||
/// \param[out] poly_inflow_c Injection concentrations to use for timestep, per cell.
|
||||
/// Must be properly sized before calling.
|
||||
virtual void getInflowValues(const double step_start,
|
||||
const double step_end,
|
||||
std::vector<double>& poly_inflow_c) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/// @brief Basic polymer injection behaviour class.
|
||||
/// This class gives all injectors the same polymer concentration,
|
||||
/// during a single time interval. Amount and interval can be specified.
|
||||
class PolymerInflowBasic : public PolymerInflowInterface
|
||||
{
|
||||
public:
|
||||
/// Constructor.
|
||||
/// \param[in] starttime Start time of injection in seconds.
|
||||
/// \param[in] endtime End time of injection in seconds.
|
||||
/// \param[in] amount Amount to be injected per second.
|
||||
PolymerInflowBasic(const double starttime,
|
||||
const double endtime,
|
||||
const double amount);
|
||||
|
||||
/// Get inflow concentrations for all cells.
|
||||
/// \param[in] step_start Start of timestep.
|
||||
/// \param[in] step_end End of timestep.
|
||||
/// \param[out] poly_inflow_c Injection concentrations to use for timestep, per cell.
|
||||
/// Must be properly sized before calling.
|
||||
virtual void getInflowValues(const double step_start,
|
||||
const double step_end,
|
||||
std::vector<double>& poly_inflow_c);
|
||||
private:
|
||||
double stime_;
|
||||
double etime_;
|
||||
double amount_;
|
||||
};
|
||||
|
||||
|
||||
/// @brief Polymer injection behaviour class using deck WPOLYMER.
|
||||
/// This class reads the accumulated WPOLYMER lines from the deck,
|
||||
/// and applies the last row given for each well.
|
||||
class PolymerInflowFromDeck : public PolymerInflowInterface
|
||||
{
|
||||
public:
|
||||
/// Constructor.
|
||||
/// \param[in] deck Input deck expected to contain WPOLYMER.
|
||||
/// \param[in] wells Wells structure.
|
||||
/// \param[in] num_cells Number of cells in grid.
|
||||
PolymerInflowFromDeck(const EclipseGridParser& deck,
|
||||
const Wells& wells,
|
||||
const int num_cells);
|
||||
|
||||
/// Get inflow concentrations for all cells.
|
||||
/// \param[in] step_start Start of timestep.
|
||||
/// \param[in] step_end End of timestep.
|
||||
/// \param[out] poly_inflow_c Injection concentrations to use for timestep, per cell.
|
||||
/// Must be properly sized before calling.
|
||||
virtual void getInflowValues(const double /*step_start*/,
|
||||
const double /*step_end*/,
|
||||
std::vector<double>& poly_inflow_c);
|
||||
private:
|
||||
SparseVector<double> sparse_inflow_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
|
||||
#endif // OPM_POLYMERINFLOW_HEADER_INCLUDED
|
||||
Reference in New Issue
Block a user