From 836b5aefd5a2d9a3ab74f1c162cea3de64b89f98 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Thu, 14 Jan 2021 11:55:18 +0100 Subject: [PATCH] adding NumericalAquiferCell it is the cells that makes the numerical aquifer itself. --- CMakeLists_files.cmake | 2 + .../NumericalAquifer/NumericalAquiferCell.hpp | 50 +++++++++++ .../NumericalAquifer/NumericalAquiferCell.cpp | 88 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp create mode 100644 src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index a3f835f6b..bfa4a39fc 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -60,6 +60,7 @@ if(ENABLE_ECL_INPUT) src/opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.cpp src/opm/parser/eclipse/EclipseState/Aquifer/Aquancon.cpp src/opm/parser/eclipse/EclipseState/Aquifer/AquiferHelpers.cpp + src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp src/opm/parser/eclipse/EclipseState/checkDeck.cpp src/opm/parser/eclipse/EclipseState/EclipseConfig.cpp src/opm/parser/eclipse/EclipseState/EclipseState.cpp @@ -702,6 +703,7 @@ if(ENABLE_ECL_INPUT) opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.hpp opm/parser/eclipse/EclipseState/Aquifer/AquiferCT.hpp opm/parser/eclipse/EclipseState/Aquifer/Aquifetp.hpp + opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp opm/parser/eclipse/EclipseState/Schedule/Action/ActionContext.hpp opm/parser/eclipse/EclipseState/Schedule/Action/ActionResult.hpp diff --git a/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp b/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp new file mode 100644 index 000000000..780b6d621 --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp @@ -0,0 +1,50 @@ +/* + Copyright (C) 2020 SINTEF Digital + + 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 . + */ + +#ifndef OPM_NUMERICALAQUIFERCELL_HPP +#define OPM_NUMERICALAQUIFERCELL_HPP + +#include + +namespace Opm { + class DeckRecord; + class EclipseGrid; + class FieldPropsManager; + + struct NumericalAquiferCell { + NumericalAquiferCell(const DeckRecord&, const EclipseGrid&, const FieldPropsManager&); + size_t aquifer_id; // aquifer id + size_t I, J, K; // indices for the grid block + double area; // cross-sectional area + double length; + double porosity; + double permeability; + double depth; // by default the grid block depth will be used + std::optional init_pressure; // by default, the grid pressure from equilibration will be used + int pvttable; // by default, the block PVTNUM + int sattable; // saturation table number, by default, the block value + double pore_volume; // pore volume + double transmissibility; + size_t global_index; + + double cellVolume() const; + }; +} + +#endif //OPM_NUMERICALAQUIFERCELL_HPP diff --git a/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp b/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp new file mode 100644 index 000000000..a93d09ad5 --- /dev/null +++ b/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.cpp @@ -0,0 +1,88 @@ +/* + Copyright (C) 2020 SINTEF Digital + + 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 . + */ +#include + +#include +#include +#include + +#include + +namespace Opm { + + using AQUNUM = ParserKeywords::AQUNUM; + NumericalAquiferCell::NumericalAquiferCell(const DeckRecord& record, const EclipseGrid& grid, const FieldPropsManager& field_props) + : aquifer_id( record.getItem().get(0) ) + , I ( record.getItem().get(0) - 1 ) + , J ( record.getItem().get(0) - 1 ) + , K ( record.getItem().get(0) - 1 ) + , area (record.getItem().getSIDouble(0) ) + , length ( record.getItem().getSIDouble(0) ) + , permeability( record.getItem().getSIDouble(0) ) + { + const auto& cell_depth = field_props.cellDepth(); + const auto& poro = field_props.get_double("PORO"); + const auto& pvtnum = field_props.get_int("PVTNUM"); + const auto& satnum = field_props.get_int("SATNUM"); + + this->global_index = grid.getGlobalIndex(I, J, K); + std::cout << " aquifer cell { " << I + 1 << " , " << J + 1 << " , " << K + 1 << std::endl; + const size_t active_index = grid.activeIndex(this->global_index); + + if ( !record.getItem().defaultApplied(0) ) { + this->porosity = record.getItem().getSIDouble(0); + } else { + this->porosity = poro[active_index]; + } + + if ( !record.getItem().defaultApplied(0) ) { + this->depth = record.getItem().getSIDouble(0); + } else { + this->depth = cell_depth[active_index]; + } + + if ( !record.getItem().defaultApplied(0) ) { + this->init_pressure = record.getItem().getSIDouble(0); + } + + if ( !record.getItem().defaultApplied(0) ) { + this->pvttable = record.getItem().get(0); + } else { + this->pvttable = pvtnum[active_index]; + } + + if ( !record.getItem().defaultApplied(0) ) { + this->sattable = record.getItem().get(0); + } else { + this->sattable = satnum[active_index]; + } + + this->pore_volume = this->porosity * this->cellVolume(); + + this->transmissibility = 2. * this->permeability * this->area / this->length; + } + + double NumericalAquiferCell::cellVolume() const { + return this->area * this->length; + } +} + + + +