Skip to content

Commit

Permalink
add float variant for flow blackoil
Browse files Browse the repository at this point in the history
  • Loading branch information
akva2 committed Apr 22, 2024
1 parent 9296ee4 commit 5f2d561
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Expand Up @@ -22,6 +22,7 @@ option(SIBLING_SEARCH "Search for other modules in sibling directories?" ON)
set( USE_OPENMP_DEFAULT OFF ) # Use of OpenMP is considered experimental
option(BUILD_FLOW "Build the production oriented flow simulator?" ON)
option(BUILD_FLOW_VARIANTS "Build the variants for flow by default?" OFF)
option(BUILD_FLOW_FLOAT_VARIANTS "Build the variants for flow using float?" OFF)
option(BUILD_FLOW_POLY_GRID "Build flow blackoil with polyhedral grid" OFF)
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_PYTHON_TESTS "Enable tests for the python bindings?" ON)
Expand Down Expand Up @@ -267,6 +268,10 @@ macro (config_hook)
include_directories(${EXTRA_INCLUDES})

include(UseDamaris)

if(BUILD_FLOW_FLOAT_VARIANTS)
set(FLOW_INSTANCE_FLOAT 1)
endif()
endmacro (config_hook)

macro (prereqs_hook)
Expand Down Expand Up @@ -700,6 +705,18 @@ if (BUILD_FLOW)
PASS_REGULAR_EXPRESSION "${${project}_LABEL}")
endif()

if(BUILD_FLOW_FLOAT_VARIANTS)
opm_add_test(flow_blackoil_float
ONLY_COMPILE
ALWAYS_ENABLE
DEFAULT_ENABLE_IF OFF
DEPENDS opmsimulators
LIBRARIES opmsimulators
SOURCES
flow/flow_blackoil_float_main.cpp
$<TARGET_OBJECTS:moduleVersion>)
endif()

if (OPM_ENABLE_PYTHON)
add_subdirectory(python)
endif()
Expand Down
38 changes: 38 additions & 0 deletions flow/flow_blackoil_float_main.cpp
@@ -0,0 +1,38 @@
/*
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>
#include <flow/flow_blackoil.hpp>

namespace Opm::Properties {

template<class TypeTag>
struct Scalar<TypeTag, TTag::FlowProblemTPFA> {
using type = float;
};

}

int main(int argc, char** argv)
{
using TypeTag = Opm::Properties::TTag::FlowProblemTPFA;
auto mainObject = Opm::Main(argc, argv);
return mainObject.runStatic<TypeTag>();
}
1 change: 1 addition & 0 deletions opm-simulators-prereqs.cmake
Expand Up @@ -23,6 +23,7 @@ set (opm-simulators_CONFIG_VAR
HAVE_DAMARIS
HAVE_HDF5
USE_TRACY
FLOW_INSTANCE_FLOAT
)

# dependencies
Expand Down

0 comments on commit 5f2d561

Please sign in to comment.