Remove unused Utility/Wrapper.hpp

These wrapper classes are not used within any opm project, and can be
removed to reduce maintenance.
This commit is contained in:
Jørgen Kvalsvik
2016-02-17 08:55:05 +01:00
parent 710df504e2
commit 6f417b0a4d
16 changed files with 1 additions and 1860 deletions

View File

@@ -280,22 +280,7 @@ EclipseState/Tables/TableEnums.hpp
EclipseState/Tables/TableSchema.hpp
EclipseState/Tables/TableIndex.hpp
#
Utility/WconinjeWrapper.hpp
Utility/CompdatWrapper.hpp
Utility/WconinjWrapper.hpp
Utility/WgrupconWrapper.hpp
Utility/GconprodWrapper.hpp
Utility/TstepWrapper.hpp
Utility/StartWrapper.hpp
Utility/SpecgridWrapper.hpp
Utility/WconprodWrapper.hpp
Utility/GconinjeWrapper.hpp
Utility/WelopenWrapper.hpp
Utility/GruptreeWrapper.hpp
Utility/WelspecsWrapper.hpp
Utility/EquilWrapper.hpp
Utility/EndscaleWrapper.hpp
Utility/ScalecrsWrapper.hpp)
Utility/EquilWrapper.hpp)
add_library(buildParser ${rawdeck_source} ${build_parser_source} ${deck_source} ${unit_source} ${generator_source})
target_link_libraries(buildParser opmjson ${Boost_LIBRARIES} ${ERT_LIBRARIES})

View File

@@ -1,143 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_COMPDAT_WRAPPER_HPP
#define OPM_PARSER_COMPDAT_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class CompdatWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'COMPDAT' keyword.
*/
CompdatWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the I-coordinate of the well
*/
int coordinateI(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getInt(0); }
/*!
* \brief Return the J-coordinate of the well
*/
int coordinateJ(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
/*!
* \brief Return the upper K-coordinate of the well
*/
int coordinateKUpper(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
/*!
* \brief Return the lower K-coordinate of the well
*/
int coordinateKLower(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getInt(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getString(0); }
/*!
* \brief Return the index of the saturation table to
* calculate the relative permebilities of the connection
*/
int saturationTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getInt(0); }
/*!
* \brief Return the transmissibility factor to be used for the connection
*/
double transmissibilityFactor(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getSIDouble(0); }
/*!
* \brief Return the diameter of the well
*/
double wellDiameter(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief Return the effective intrinisic permeability to be used for the well
*/
double intrinsicPermeability(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief Return the skin factor to be used for the well
*/
double skinFactor(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getSIDouble(0); }
/*!
* \brief Return the "D-factor" (for non-Darcy flow regimes) to be used for the well
*/
double dFactor(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getSIDouble(0); }
/*!
* \brief Return the direction into which the cells are penetrated by the well
*
* This is one of:
* - X
* - Y
* - Z
* - FX (fracture in X direction)
* - FY (fracture in Y direction)
*/
std::string penetrationDirection(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_COMPDAT_WRAPPER_HPP

View File

@@ -1,81 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_ENDSCALE_WRAPPER_HPP
#define OPM_PARSER_ENDSCALE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class EndscaleWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'ENDSCALE' keyword.
*/
EndscaleWrapper(std::shared_ptr< const DeckKeyword > keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the directional switch for endpoint scaling
*
* This is one of:
* - DIRECT
* - NODIR
*/
std::string directionSwitch() const
{ return m_keyword->getRecord(0)->getItem(0)->getString(0); }
/*!
* \brief Return whether the enpoint scaling should be reversible or not
*/
bool isReversible() const
{ return m_keyword->getRecord(0)->getItem(1)->getString(0) == "REVERS"; }
/*!
* \brief Return the number of endpoint (depending on depth) tables
*/
int numEndscaleTables() const
{ return m_keyword->getRecord(0)->getItem(2)->getInt(0); }
/*!
* \brief Return the maximum number of nodes in endpoint tables
*/
int numMaxNodes() const
{ return m_keyword->getRecord(0)->getItem(3)->getInt(0); }
/*!
* \brief Return the options for combining temperature endpoint data.
*/
int combiningOptions() const
{ return m_keyword->getRecord(0)->getItem(4)->getInt(0); }
private:
std::shared_ptr< const DeckKeyword > m_keyword;
};
}
#endif // OPM_PARSER_ENDSCALE_WRAPPER_HPP

View File

@@ -1,159 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_GCONINJE_WRAPPER_HPP
#define OPM_PARSER_GCONINJE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
namespace Opm {
class GconinjeWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'GCONINJE' keyword.
*/
GconinjeWrapper(std::shared_ptr< const DeckKeyword > keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection well groups
*/
int numGroups() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well group with a given index
*/
std::string groupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the injector type of a well group.
*
* This is one of:
* - OIL
* - WATER
* - GAS
*/
std::string groupType(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - NONE: The individual wells specify how they are controlled
* - RATE: Control for the surface volume rate of the fluid
* - RESV: Control for the reservoir volume rate of the fluid
* - REIN: Injection rate is production rate times a re-injection ratio
* - VREP: Control the total surface injection rate of all wells
* - WGRA: Control for the wet-gas injection rate
* - FLD: Higher level groups specify this group's control
*/
std::string controlMode(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(2)->getString(0); }
/*!
* \brief Return the target for the volumetric surface rate of a well group
*
* If the control mode does not use the volumetric surface
* rate, this is the upper limit.
*/
double rawSurfaceTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(3)->getRawDouble(0); }
/*!
* \brief Return the target for the volumetric reservoir rate of a well group
*
* If the control mode does not use the volumetric reservoir
* rate, this is the upper limit.
*/
double rawReservoirTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(4)->getRawDouble(0); }
/*!
* \brief The target fraction for reinjection
*/
double reinjectTargetRatio(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief The target fraction of the voidage replacement fraction
*/
double voidageReplacementFractionTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief Returns whether a group is unconstraint so that it
* be used to hit the target of a higher-level group
*/
bool isUnconstraint(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(7)->getString(0) == "YES"; }
/*!
* \brief The target for the group's share of the next
* higher-level group's total injection rate.
*/
double injectionShareTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief The kind of control which the next higher-level group wants
*
* This is one of:
* - RATE
* - RESV
* - VOID
* - NETV
* - ' '
*/
std::string injectionShareType(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(9)->getString(0); }
/*!
* \brief The name of the production group which should be partially reinjected
*/
std::string reinjectGroupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(10)->getString(0); }
/*!
* \brief The name of the group to which the voidage
* replacement volume fraction applies and which's
* production rates should be used.
*/
std::string voidageGroupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(11)->getString(0); }
/*!
* \brief The target rate for wet gas injection
*/
double wetGasTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(12)->getSIDouble(0); }
private:
std::shared_ptr< const DeckKeyword > m_keyword;
};
}
#endif // OPM_PARSER_GCONINJE_WRAPPER_HPP

View File

@@ -1,228 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_GCONPROD_WRAPPER_HPP
#define OPM_PARSER_GCONPROD_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class GconprodWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'GCONPROD' keyword.
*/
GconprodWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of prodction well groups
*/
int numGroups() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well group with a given index
*/
std::string groupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - NONE
* - ORAT
* - WRAT
* - GRAT
* - LRAT
* - CRAT
* - RESV
* - PRBL
* - WGRA
* - CVAL
* - PBGS
* - PBWS
* - FLD
*/
std::string controlMode(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the target for the volumetric surface oil rate of a well group
*
* If the control mode does not use the volumetric oil surface
* rate, this is the upper limit.
*/
double surfaceOilTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(2)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric surface water rate of a well group
*
* If the control mode does not use the volumetric water surface
* rate, this is the upper limit.
*/
double surfaceWaterTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(3)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric surface gas rate of a well group
*
* If the control mode does not use the volumetric gas surface
* rate, this is the upper limit.
*/
double surfaceGasTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric surface liquid rate of a well group
*
* If the control mode does not use the volumetric liquid surface
* rate, this is the upper limit.
*/
double surfaceLiquidTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief Return the procedure which is taken if the target rates are exceeded
*
* This is one of:
* - NONE
* - CON
* - +CON
* - WELL
* - PLUG
* - RATE
*/
std::string oilExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(6)->getString(0); }
/*!
* \brief Returns whether a group is unconstraint so that it
* be used to hit the target of a higher-level group
*/
bool isUnconstraint(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(7)->getString(0) == "YES"; }
/*!
* \brief The target for the group's share of the next
* higher-level group's total production rate.
*/
double productionShareTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief The kind of control which the next higher-level group wants
*
* This is one of:
* - OIL
* - WAT
* - GAS
* - LIQ
* - COMB
* - RES
* - WGA
* - CVAL
* - INJV
* - POTN
* - FORM
* - ' '
*/
std::string productionShareType(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(9)->getString(0); }
/*!
* \brief Return the procedure which is taken if the water target rate is exceeded
*/
std::string waterExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(10)->getString(0); }
/*!
* \brief Return the procedure which is taken if the gas target rate is exceeded
*/
std::string gasExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(11)->getString(0); }
/*!
* \brief Return the procedure which is taken if the liquid target rate is exceeded
*/
std::string liquidExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(12)->getString(0); }
/*!
* \brief Return target rate of all fluids at reservoir conditions
*/
double reservoirTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(13)->getSIDouble(0); }
/*!
* \brief Return balancing fraction of fluids produced at reservoir conditions.
*/
double reservoirBalanceTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(14)->getSIDouble(0); }
/*!
* \brief Return target rate for wet-gas
*/
double wetGasTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(15)->getSIDouble(0); }
/*!
* \brief Return caloric target rate
*/
double caloricTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(16)->getSIDouble(0); }
/*!
* \brief Return balancing fraction of gas at surface conditions.
*/
double surfaceGasBalanceTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(17)->getSIDouble(0); }
/*!
* \brief Return balancing fraction of water at surface conditions.
*/
double surfaceWaterBalanceTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(18)->getSIDouble(0); }
/*!
* \brief Return index of the linearly combined rate specified using the LCOM keyword
*/
int lcomIndex(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(19)->getInt(0); }
/*!
* \brief Return the procedure which is taken if the linearly combined rate is exceeded
*/
std::string lcomExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(20)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_GCONINJE_WRAPPER_HPP

View File

@@ -1,64 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_GRUPTREE_WRAPPER_HPP
#define OPM_PARSER_GRUPTREE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
namespace Opm {
class GruptreeWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'GRUPTREE' keyword.
*/
GruptreeWrapper(std::shared_ptr< const DeckKeyword > keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of nodes in the well group tree
*/
int numNodes() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the child group of
* a well group with a given index
*/
std::string childName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the human-readable name of the parent group
* of a well group with a given index
*/
std::string parentName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
private:
std::shared_ptr< const DeckKeyword > m_keyword;
};
}
#endif // OPM_PARSER_GRUPTREE_WRAPPER_HPP

View File

@@ -1,54 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_SCALECRS_WRAPPER_HPP
#define OPM_PARSER_SCALECRS_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class ScalecrsWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'SCALECRS' keyword.
*/
ScalecrsWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return whether the CRS method should be used to scale the endpoints
*/
bool isEnabled() const
{
return m_keyword->getRecord(0)->getItem(0)->getString(0) == "YES"
|| m_keyword->getRecord(0)->getItem(0)->getString(0) == "Y";
}
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_SCALECRS_WRAPPER_HPP

View File

@@ -1,93 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_SPECGRID_WRAPPER_HPP
#define OPM_PARSER_SPECGRID_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <vector>
namespace Opm {
class SpecgridWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'SPECGRID' keyword.
*/
SpecgridWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of grid blocks in I direction
*/
int numGridBlocksI() const
{ return m_keyword->getRecord(0)->getItem(0)->getInt(0); }
/*!
* \brief Return the number of grid blocks in J direction
*/
int numGridBlocksJ() const
{ return m_keyword->getRecord(0)->getItem(1)->getInt(0); }
/*!
* \brief Return the number of grid blocks in K direction
*/
int numGridBlocksK() const
{ return m_keyword->getRecord(0)->getItem(2)->getInt(0); }
/*!
* \brief The number of IJK grid blocks as a vector
*/
std::vector<int> numBlocksVector() const
{
std::vector<int> dim(3);
dim[0] = numGridBlocksI();
dim[1] = numGridBlocksJ();
dim[2] = numGridBlocksK();
return dim;
}
/*!
* \brief Return the number of reservoirs
*/
int numReservoirs() const
{ return m_keyword->getRecord(0)->getItem(3)->getInt(0); }
/*!
* \brief Type of the coordinate system
*
* This is one of:
* - "T": cylindrical coordinates
* - "F": cartesianCoordinates
*/
std::string coordSystemType() const
{ return m_keyword->getRecord(0)->getItem(4)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_SPECGRID_WRAPPER_HPP

View File

@@ -1,86 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_START_WRAPPER_HPP
#define OPM_PARSER_START_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <stdexcept>
namespace Opm {
class StartWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data exposed by the 'START' keyword.
*/
StartWrapper(Opm::DeckKeywordConstPtr keyword)
{
int day = keyword->getRecord(0)->getItem(0)->getInt(0);
std::string month = keyword->getRecord(0)->getItem(1)->getString(0);
int year = keyword->getRecord(0)->getItem(2)->getInt(0);
int monthNum = 0;
if (month == "JAN")
monthNum = 1;
else if (month == "FEB")
monthNum = 2;
else if (month == "MAR")
monthNum = 3;
else if (month == "APR")
monthNum = 4;
else if (month == "MAY")
monthNum = 5;
else if (month == "JUN")
monthNum = 6;
else if (month == "JUL")
monthNum = 7;
else if (month == "AUG")
monthNum = 8;
else if (month == "SEP")
monthNum = 9;
else if (month == "OCT")
monthNum = 10;
else if (month == "NOV")
monthNum = 11;
else if (month == "DEC")
monthNum = 12;
else
throw std::runtime_error("Invalid month specified for START keyword");
m_startDate = boost::gregorian::date(year, monthNum, day);
}
/*!
* \brief Return calendar date at which the simulation starts.
*/
const boost::gregorian::date &getStartDate() const
{ return m_startDate; }
private:
boost::gregorian::date m_startDate;
};
}
#endif // OPM_PARSER_START_KEYWORD_HPP

View File

@@ -1,59 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_TSTEP_WRAPPER_HPP
#define OPM_PARSER_TSTEP_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class TstepWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data exposed by the 'TSTEP' keyword.
*/
TstepWrapper(Opm::DeckKeywordConstPtr keyword)
{
m_timesteps = keyword->getSIDoubleData();
m_totalTime = std::accumulate(m_timesteps.begin(), m_timesteps.end(), 0.0);
}
/*!
* \brief Return the simulated timestep sizes in seconds.
*/
const std::vector<double> &timestepVector() const
{ return m_timesteps; }
/*!
* \brief Return the total simulation time in seconds.
*/
double totalTime() const
{ return m_totalTime; }
private:
std::vector<double> m_timesteps;
double m_totalTime;
};
}
#endif // OPM_PARSER_TSTEP_KEYWORD_HPP

View File

@@ -1,160 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_WCONINJ_WRAPPER_HPP
#define OPM_PARSER_WCONINJ_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WconinjWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WCONINJ' keyword.
*/
WconinjWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the injector type of a well.
*
* This is one of:
* - OIL
* - WATER
* - GAS
*/
std::string wellType(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - STOP: Well does not reach the reservoir, but it
* injects. (and some of this fluid reaches the reservoir
* via crossflow)
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - RATE: Control for the surface volume rate of the fluid
* - RESV: Control for the reservoir volume rate of the fluid
* - BHP: Control for the bottom hole pressure
* - THP: Control for the top hole pressure
*/
std::string controlMode(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getString(0); }
/*!
* \brief Return the target for the volumetric surface rate of a well
*
* If the control mode does not use the volumetric surface
* rate, this is the upper limit.
*/
double surfaceTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric reservoir rate of a well
*
* If the control mode does not use the volumetric reservoir
* rate, this is the upper limit.
*/
double reservoirTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief Return the reinjection replacement percentage of well
*/
double reinjectionReplacementRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief Return how reinjection should be handled
*
* This is one of:
* - NONE
* - GPRD
* - FPRD
*/
std::string reinjectionReplacementType(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getString(0); }
/*!
* \brief The target of the bottom hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double bottomHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief The target of the top hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double topHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getSIDouble(0); }
/*!
* \brief The index of the PVT table used for the injected fluid
*/
int vfpTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getInt(0); }
/*!
* \brief The vaporized oil concentration in the injected gas (if the well injects gas)
*/
double vaporizedOilConcentration(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WCONINJ_WRAPPER_HPP

View File

@@ -1,170 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_WCONINJE_WRAPPER_HPP
#define OPM_PARSER_WCONINJE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WconinjeWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WCONINJE' keyword.
*/
WconinjeWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the injector type of a well.
*
* This is one of:
* - OIL
* - WATER
* - STEAM-GAS
* - GAS
* - MULTI
*/
std::string wellType(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - STOP: Well does not reach the reservoir, but it
* injects. (and some of this fluid reaches the reservoir
* via crossflow)
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - RATE: Control for the surface volume rate of the fluid
* - RESV: Control for the reservoir volume rate of the fluid
* - BHP: Control for the bottom hole pressure
* - THP: Control for the top hole pressure
* - GRUP: Use the control mode which applies for the group of the well
*/
std::string controlMode(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getString(0); }
/*!
* \brief Return the target for the volumetric surface rate of a well
*
* If the control mode does not use the volumetric surface
* rate, this is the upper limit.
*/
double rawSurfaceTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getRawDouble(0); }
/*!
* \brief Return the target for the volumetric reservoir rate of a well
*
* If the control mode does not use the volumetric reservoir
* rate, this is the upper limit.
*/
double rawReservoirTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getRawDouble(0); }
/*!
* \brief The target of the bottom hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double bottomHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief The target of the top hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double topHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getSIDouble(0); }
/*!
* \brief The index of the PVT table used for the injected fluid
*/
int vfpTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getInt(0); }
/*!
* \brief The vaporized oil concentration in the injected gas (if the well injects gas)
*/
double vaporizedOilConcentration(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief The gas to steam ratio (at reservoir conditions?) for GAS-STEAM injectors.
*/
double gasSteamRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getSIDouble(0); }
/*!
* \brief The proportion of oil at the surface for multi-phase injector wells.
*/
double surfaceOilRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getSIDouble(0); }
/*!
* \brief The proportion water oil at the surface for multi-phase injector wells.
*/
double surfaceWaterRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getSIDouble(0); }
/*!
* \brief The proportion water oil at the surface for multi-phase injector wells.
*/
double surfaceGasRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(13)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WCONINJE_WRAPPER_HPP

View File

@@ -1,196 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_WCONPROD_WRAPPER_HPP
#define OPM_PARSER_WCONPROD_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WconprodWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WCONPROD' keyword.
*/
WconprodWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the connection type of a well.
*
* This is one of:
* - OPEN
* - STOP
* - SHUT
* - AUTO
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the control mode of a well.
*
* This is one of:
* - ORAT (surface oil rate)
* - WRAT (surface water rate)
* - GRAT (surface gas rate)
* - LRAT (surface liquid rate)
* - CRAT (linear combination of the surface rates)
* - RESV (reservoir fluid volume rate)
* - BHP (bottom-hole pressure)
* - THP (top-hole pressure)
* - WGRA (wet-gas rate)
* - TMRA (total molar rate)
* - STRA (steam volume rate)
* - SATP (water saturation pressure)
* - SATT (water temperature)
* - CVAL (caloric rate)
* - NGL (NGL rate, WTF?)
* - GRUP (group of the well controls the regime)
* - ' ' (undefined, default)
*/
std::string controlMode(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getString(0); }
/*!
* \brief The upper limit of the surface oil rate.
*/
double oilTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getSIDouble(0); }
/*!
* \brief The upper limit of the surface water rate.
*/
double waterTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief The upper limit of the surface gas rate.
*/
double gasTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief The upper rate limit of the liquids at the surface.
*/
double liquidTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief The upper limit of the fluid volumes at the reservoir.
*/
double reservoirTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getSIDouble(0); }
/*!
* \brief The lower limit of the bottom hole pressure.
*/
double bottomHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief The lower limit of the top hole pressure.
*/
double topHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief The index of the well's VFP table
*/
int vfpTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getInt(0); }
/*!
* \brief The artificial lift quantity of the well.
*/
double artificialLiftQuantity(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getSIDouble(0); }
/*!
* \brief The upper limit of the produced wet gas
*/
double wetGasTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getSIDouble(0); }
/*!
* \brief The upper limit of the produced molar rate
*/
double molarTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(13)->getSIDouble(0); }
/*!
* \brief The upper limit for the rate of the produced steam
*/
double steamTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(14)->getSIDouble(0); }
/*!
* \brief The pressure offset used for saturation pressure control
*/
double pressureOffset(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(15)->getSIDouble(0); }
/*!
* \brief The temperature offset used for saturation temperature control
*/
double temperatureOffset(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(16)->getSIDouble(0); }
/*!
* \brief The upper limit of the caloric rate
*/
double caloricTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(17)->getSIDouble(0); }
/*!
* \brief The index of the linearly combined rate specified by the LINCOM keyword
*/
int lincomIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(18)->getInt(0); }
/*!
* \brief The upper limit of the NGL rate
*/
double nglTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(19)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WCONPROD_WRAPPER_HPP

View File

@@ -1,104 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_WELOPEN_WRAPPER_HPP
#define OPM_PARSER_WELOPEN_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WelopenWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WELOPEN' keyword.
*/
WelopenWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - STOP: Well does not reach the reservoir, but it
* injects. (and some of this fluid reaches the reservoir
* via crossflow)
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the I-coordinate of the connection grid block
*/
int coordinateI(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
/*!
* \brief Return the J-coordinate of the connection grid block
*/
int coordinateJ(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
/*!
* \brief Return the K-coordinate of the connection grid block
*/
int coordinateK(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getInt(0); }
/*!
* \brief Return the index of the first well completion for
* which this data applies
*/
int firstCompletionNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getInt(0); }
/*!
* \brief Return the index of the last well completion for
* which this data applies
*/
int lastCompletionNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getInt(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WELOPEN_WRAPPER_HPP

View File

@@ -1,153 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_WELSPECS_WRAPPER_HPP
#define OPM_PARSER_WELSPECS_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WelspecsWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of an individual well as exposed by the
* 'WELSPECS' keyword.
*/
WelspecsWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number if wells covered by the WELSPECS keyword.
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the name of the well
*/
const std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the name of the group this well belongs to
*/
const std::string groupName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return east-west grid coordinate of the well
*/
int coordinateI(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
/*!
* \brief Return north-south grid coordinate of the well
*/
int coordinateJ(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
/*!
* \brief Return reference depth to which the bottom hole pressure of the well applies
*/
double referenceDepth(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the preferred fluid phase of this well
*
* (whatever this means.) This method returns a string that
* contains one of "OIL", "WATER", "GAS", or "LIQ".
*/
const std::string preferredPhase(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getString(0); }
/*!
* \brief Return effective drainage radius of the well
*/
double drainageRadius(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief Return the inflow equation to be used for the well
*
* This is one of "STD", "NO", "R-G", "YES", "P-P" or "GPP".
*/
const std::string inflowEquation(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getString(0); }
/*!
* \brief Returns true if the well is closed for fluids
*/
bool isShut(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getString(0) == "SHUT"; }
/*!
* \brief Returns true if crossflow should be allowed
*/
bool allowCrossflow(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getString(0) == "YES"; }
/*!
* \brief Returns the pressure number to be used for the wellbore fluids
*/
int pressureTableNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getInt(0); }
/*!
* \brief Indicates the type of the calculation to be used for hydrostatic pressure
*
* This is one of:
* - "SEG": segmented density calculation
* - "AVG": averaged density calculation
*/
const std::string hydrostaticCalculation(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getString(0); }
/*!
* \brief Indicates the "fluid in place" region table number
* used to calculate volumetric rates at reservoir
* conditions.
*/
int inPlaceRegionNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getInt(0); }
// items 14 and 15 are "reserved for FrontSim"
/*!
* \brief Indicates well model to be used
*
* This is one of:
* - "STD": The standard well model (Peaceman??)
* - "HMIW": High Mobility Injection Wells
*/
const std::string wellModel(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(15)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WELSPECS_WRAPPER_HPP

View File

@@ -1,94 +0,0 @@
/*
Copyright (C) 2014 by Andreas Lauser
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_PARSER_WGRUPCON_WRAPPER_HPP
#define OPM_PARSER_WGRUPCON_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WgrupconWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WGRUPCON' keyword.
*/
WgrupconWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of well groups to which this keyword applies
*/
int numGroups() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of a well group with
* a given index
*/
std::string groupName(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(0)->getString(0); }
/*!
* \brief Return whether the group is available for higher
* level groups to control.
*/
bool isUnconstraint(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(1)->getString(0) == "YES"; }
/*!
* \brief Return the guide rate for the group
*/
double guideRate(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(2)->getSIDouble(0); }
/*!
* \brief Return the type of a well group.
*
* This is one of:
* - OIL
* - WAT
* - GAS
* - LIQ
* - COMB
* - WGA
* - CVAL
* - RAT
* - RES
*/
std::string controlPhase(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(3)->getString(0); }
/*!
* \brief Return the scaling factor for the guide rate of a group
*/
double guideRateScalingFactor(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(4)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WGRUPCON_WRAPPER_HPP