mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2912 from totto82/polyhedrealgrid
Make a flow version that uses the polyhedreal grid
This commit is contained in:
@@ -26,7 +26,7 @@ option(BUILD_FLOW_VARIANTS "Build the variants for flow by default?" OFF)
|
|||||||
option(BUILD_EBOS "Build the research oriented ebos simulator?" ON)
|
option(BUILD_EBOS "Build the research oriented ebos simulator?" ON)
|
||||||
option(BUILD_EBOS_EXTENSIONS "Build the variants for various extensions of ebos by default?" OFF)
|
option(BUILD_EBOS_EXTENSIONS "Build the variants for various extensions of ebos by default?" OFF)
|
||||||
option(BUILD_EBOS_DEBUG_EXTENSIONS "Build the ebos variants which are purely for debugging by default?" OFF)
|
option(BUILD_EBOS_DEBUG_EXTENSIONS "Build the ebos variants which are purely for debugging by default?" OFF)
|
||||||
|
option(BUILD_FLOW_POLY_GRID "Build flow blackoil with polyhedral grid" OFF)
|
||||||
option(ENABLE_3DPROPS_TESTING "Build and use the new experimental 3D properties" OFF)
|
option(ENABLE_3DPROPS_TESTING "Build and use the new experimental 3D properties" OFF)
|
||||||
if (ENABLE_3DPROPS_TESTING)
|
if (ENABLE_3DPROPS_TESTING)
|
||||||
add_definitions(-DENABLE_3DPROPS_TESTING)
|
add_definitions(-DENABLE_3DPROPS_TESTING)
|
||||||
@@ -271,6 +271,25 @@ opm_add_test(flow_blackoil
|
|||||||
$<TARGET_OBJECTS:moduleVersion>)
|
$<TARGET_OBJECTS:moduleVersion>)
|
||||||
target_compile_definitions(flow_blackoil PRIVATE "FLOW_BLACKOIL_ONLY")
|
target_compile_definitions(flow_blackoil PRIVATE "FLOW_BLACKOIL_ONLY")
|
||||||
|
|
||||||
|
if (NOT BUILD_FLOW_POLY_GRID)
|
||||||
|
set(FLOW_POLY_ONLY_DEFAULT_ENABLE_IF "FALSE")
|
||||||
|
else()
|
||||||
|
set(FLOW_POLY_ONLY_DEFAULT_ENABLE_IF "TRUE")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# the production oriented general-purpose ECL simulator
|
||||||
|
opm_add_test(flow_poly
|
||||||
|
ONLY_COMPILE
|
||||||
|
ALWAYS_ENABLE
|
||||||
|
DEFAULT_ENABLE_IF ${FLOW_POLY_ONLY_DEFAULT_ENABLE_IF}
|
||||||
|
DEPENDS opmsimulators
|
||||||
|
LIBRARIES opmsimulators
|
||||||
|
SOURCES
|
||||||
|
flow/flow_blackoil_poly.cpp
|
||||||
|
$<TARGET_OBJECTS:moduleVersion>)
|
||||||
|
target_compile_definitions(flow_poly PRIVATE USE_POLYHEDRALGRID)
|
||||||
|
|
||||||
|
|
||||||
if (NOT BUILD_FLOW_VARIANTS)
|
if (NOT BUILD_FLOW_VARIANTS)
|
||||||
set(FLOW_VARIANTS_DEFAULT_ENABLE_IF "FALSE")
|
set(FLOW_VARIANTS_DEFAULT_ENABLE_IF "FALSE")
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -183,10 +183,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void createGrids_()
|
void createGrids_()
|
||||||
{
|
{
|
||||||
const auto& gridProps = this->eclState().get3DProperties();
|
grid_ = new Grid(this->eclState().getInputGrid(), this->eclState().fieldProps().porv(true));
|
||||||
const std::vector<double>& porv = gridProps.getDoubleGridProperty("PORV").getData();
|
|
||||||
|
|
||||||
grid_ = new Grid(this->deck(), porv);
|
|
||||||
cartesianIndexMapper_ = new CartesianIndexMapper(*grid_);
|
cartesianIndexMapper_ = new CartesianIndexMapper(*grid_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,12 @@
|
|||||||
|
|
||||||
#if EBOS_USE_ALUGRID
|
#if EBOS_USE_ALUGRID
|
||||||
#include "eclalugridvanguard.hh"
|
#include "eclalugridvanguard.hh"
|
||||||
|
#elif USE_POLYHEDRALGRID
|
||||||
|
#include "eclpolyhedralgridvanguard.hh"
|
||||||
#else
|
#else
|
||||||
//#include "eclpolyhedralgridvanguard.hh"
|
|
||||||
#include "eclcpgridvanguard.hh"
|
#include "eclcpgridvanguard.hh"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "eclwellmanager.hh"
|
#include "eclwellmanager.hh"
|
||||||
#include "eclequilinitializer.hh"
|
#include "eclequilinitializer.hh"
|
||||||
#include "eclwriter.hh"
|
#include "eclwriter.hh"
|
||||||
@@ -124,13 +126,14 @@ namespace TTag {
|
|||||||
struct EclBaseProblem {
|
struct EclBaseProblem {
|
||||||
using InheritstFrom = std::tuple<VtkEclTracer, EclOutputBlackOil, EclAluGridVanguard>;
|
using InheritstFrom = std::tuple<VtkEclTracer, EclOutputBlackOil, EclAluGridVanguard>;
|
||||||
};
|
};
|
||||||
|
#elif USE_POLYHEDRALGRID
|
||||||
|
struct EclBaseProblem {
|
||||||
|
using InheritsFrom = std::tuple<VtkEclTracer, EclOutputBlackOil, EclPolyhedralGridVanguard>;
|
||||||
|
};
|
||||||
#else
|
#else
|
||||||
struct EclBaseProblem {
|
struct EclBaseProblem {
|
||||||
using InheritsFrom = std::tuple<VtkEclTracer, EclOutputBlackOil, EclCpGridVanguard>;
|
using InheritsFrom = std::tuple<VtkEclTracer, EclOutputBlackOil, EclCpGridVanguard>;
|
||||||
};
|
};
|
||||||
//struct EclBaseProblem {
|
|
||||||
// using InheritsFrom = std::tuple<VtkEclTracer, EclOutputBlackOil, EclPolyhedralGridVanguard>;
|
|
||||||
//};
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -425,7 +425,6 @@ public:
|
|||||||
Opm::Action::State& actionState = simulator_.vanguard().actionState();
|
Opm::Action::State& actionState = simulator_.vanguard().actionState();
|
||||||
auto restartValues = loadParallelRestart(eclIO_.get(), actionState, summaryState, solutionKeys, extraKeys,
|
auto restartValues = loadParallelRestart(eclIO_.get(), actionState, summaryState, solutionKeys, extraKeys,
|
||||||
gridView.grid().comm());
|
gridView.grid().comm());
|
||||||
|
|
||||||
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
||||||
unsigned globalIdx = collectToIORank_.localIdxToGlobalIdx(elemIdx);
|
unsigned globalIdx = collectToIORank_.localIdxToGlobalIdx(elemIdx);
|
||||||
eclOutputModule_.setRestart(restartValues.solution, elemIdx, globalIdx);
|
eclOutputModule_.setRestart(restartValues.solution, elemIdx, globalIdx);
|
||||||
|
|||||||
35
flow/flow_blackoil_poly.cpp
Normal file
35
flow/flow_blackoil_poly.cpp
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020, NORCE AS
|
||||||
|
|
||||||
|
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 "config.h"
|
||||||
|
#include <opm/simulators/flow/Main.hpp>
|
||||||
|
|
||||||
|
namespace Opm::Properties {
|
||||||
|
namespace TTag {
|
||||||
|
struct EclFlowProblemPoly {
|
||||||
|
using InheritsFrom = std::tuple<EclFlowProblem>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
using TypeTag = Opm::Properties::TTag::EclFlowProblemPoly;
|
||||||
|
auto mainObject = Opm::Main(argc, argv);
|
||||||
|
return mainObject.runStatic<TypeTag>();
|
||||||
|
}
|
||||||
@@ -19,7 +19,6 @@
|
|||||||
#include <flow/flow_ebos_blackoil.hpp>
|
#include <flow/flow_ebos_blackoil.hpp>
|
||||||
|
|
||||||
#include <opm/material/common/ResetLocale.hpp>
|
#include <opm/material/common/ResetLocale.hpp>
|
||||||
#include <opm/grid/CpGrid.hpp>
|
|
||||||
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
|
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
|
||||||
#include <opm/simulators/flow/FlowMainEbos.hpp>
|
#include <opm/simulators/flow/FlowMainEbos.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include <opm/simulators/utils/ParallelFileMerger.hpp>
|
#include <opm/simulators/utils/ParallelFileMerger.hpp>
|
||||||
#include <opm/simulators/utils/moduleVersion.hpp>
|
#include <opm/simulators/utils/moduleVersion.hpp>
|
||||||
#include <opm/simulators/linalg/ExtractParallelGridInformationToISTL.hpp>
|
#include <opm/simulators/linalg/ExtractParallelGridInformationToISTL.hpp>
|
||||||
|
#include <opm/simulators/utils/ParallelEclipseState.hpp>
|
||||||
|
|
||||||
#include <opm/core/props/satfunc/RelpermDiagnostics.hpp>
|
#include <opm/core/props/satfunc/RelpermDiagnostics.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
size_t numInterior = 0;
|
size_t numInterior = 0;
|
||||||
if (!ownerFirst || grid.comm().size()==1)
|
if (!ownerFirst || grid.comm().size()==1)
|
||||||
return grid.numCells();
|
return grid.leafGridView().size(0);
|
||||||
const auto& gridView = grid.leafGridView();
|
const auto& gridView = grid.leafGridView();
|
||||||
auto elemIt = gridView.template begin<0>();
|
auto elemIt = gridView.template begin<0>();
|
||||||
const auto& elemEndIt = gridView.template end<0>();
|
const auto& elemEndIt = gridView.template end<0>();
|
||||||
|
|||||||
Reference in New Issue
Block a user