Moved temp init into GridProperty
The GridPropertyInitializers files now really only held the temperature initialisation function, and has been merged into GridProperty.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
@@ -28,6 +29,9 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/Box.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -430,6 +434,33 @@ const std::string& GridProperty<double>::getDimensionString() const {
|
||||
return m_kwInfo.getDimensionString();
|
||||
}
|
||||
|
||||
std::vector< double > temperature_lookup( size_t size,
|
||||
const TableManager* tables,
|
||||
const EclipseGrid* grid,
|
||||
GridProperties<int>* ig_props ) {
|
||||
|
||||
if( !tables->useEqlnum() ) {
|
||||
/* if values are defaulted in the TEMPI keyword, but no
|
||||
* EQLNUM is specified, you will get NaNs
|
||||
*/
|
||||
return std::vector< double >( size, std::numeric_limits< double >::quiet_NaN() );
|
||||
}
|
||||
|
||||
std::vector< double > values( size, 0 );
|
||||
|
||||
const auto& rtempvdTables = tables->getRtempvdTables();
|
||||
const std::vector< int >& eqlNum = ig_props->getKeyword("EQLNUM").getData();
|
||||
|
||||
for (size_t cellIdx = 0; cellIdx < eqlNum.size(); ++ cellIdx) {
|
||||
int cellEquilNum = eqlNum[cellIdx];
|
||||
const RtempvdTable& rtempvdTable = rtempvdTables.getTable<RtempvdTable>(cellEquilNum);
|
||||
double cellDepth = std::get<2>(grid->getCellCenter(cellIdx));
|
||||
values[cellIdx] = rtempvdTable.evaluate("Temperature", cellDepth);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template class Opm::GridPropertySupportedKeywordInfo< int >;
|
||||
|
||||
Reference in New Issue
Block a user