Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ target_sources(test_outputdir PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_equil PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_RestartSerialization PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_glift1 PRIVATE $<TARGET_OBJECTS:moduleVersion>)
target_sources(test_tpsa_localresidual PRIVATE $<TARGET_OBJECTS:moduleVersion>)
if(MPI_FOUND)
target_sources(test_chopstep PRIVATE $<TARGET_OBJECTS:moduleVersion>)
endif()
Expand Down Expand Up @@ -599,8 +600,8 @@ set(FLOW_MODELS blackoil blackoil_temp brine energy extbo foam gasoil gaswater
gaswater_saltprec_vapwat gaswater_saltprec_energy brine_precsalt_vapwat
blackoil_legacyassembly gasoildiffuse gaswater_dissolution
gaswater_dissolution_diffuse gaswater_energy gaswater_solvent biofilm
blackoil_nohyst)
set(FLOW_VARIANT_MODELS brine_energy onephase onephase_energy)
blackoil_nohyst blackoil_tpsa gaswater_dissolution_tpsa)
set(FLOW_VARIANT_MODELS brine_energy onephase onephase_energy onephase_tpsa)

set(FLOW_TGTS)
foreach(OBJ ${COMMON_MODELS} ${FLOW_MODELS} ${FLOW_VARIANT_MODELS})
Expand Down
25 changes: 25 additions & 0 deletions CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ list (APPEND MAIN_SOURCE_FILES
opm/models/io/vtkprimaryvarsparams.cpp
opm/models/io/vtkptflashparams.cpp
opm/models/io/vtktemperatureparams.cpp
opm/models/io/vtktpsaparams.cpp
opm/models/io/restart.cpp
opm/models/nonlinear/newtonmethodparams.cpp
opm/models/parallel/tasklets.cpp
opm/models/parallel/threadmanager.cpp
opm/models/tpsa/tpsanewtonmethodparams.cpp
opm/models/utils/parametersystem.cpp
opm/models/utils/simulatorutils.cpp
opm/models/utils/terminal.cpp
Expand All @@ -126,6 +128,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/flow/EclGenericWriter.cpp
opm/simulators/flow/ExtboContainer.cpp
opm/simulators/flow/ExtraConvergenceOutputThread.cpp
opm/simulators/flow/FacePropertiesTPSA.cpp
opm/simulators/flow/FIPContainer.cpp
opm/simulators/flow/FlowGenericProblem.cpp
opm/simulators/flow/FlowGenericVanguard.cpp
Expand Down Expand Up @@ -182,6 +185,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/linalg/PreconditionerFactory7.cpp
opm/simulators/linalg/PropertyTree.cpp
opm/simulators/linalg/setupPropertyTree.cpp
opm/simulators/linalg/TPSALinearSolverParameters.cpp
opm/simulators/timestepping/AdaptiveSimulatorTimer.cpp
opm/simulators/timestepping/AdaptiveTimeStepping.cpp
opm/simulators/timestepping/ConvergenceReport.cpp
Expand Down Expand Up @@ -505,6 +509,9 @@ list (APPEND TEST_SOURCE_FILES
tests/test_rstconv.cpp
tests/test_stoppedwells.cpp
tests/test_timer.cpp
tests/test_tpsa_face_properties.cpp
tests/test_tpsa_localresidual.cpp
tests/test_tpsa_primaryvariables.cpp
tests/test_vfpproperties.cpp
tests/test_wellmodel.cpp
tests/test_wellprodindexcalculator.cpp
Expand Down Expand Up @@ -650,6 +657,7 @@ list (APPEND TEST_DATA_FILES
tests/equil_humidwetgas.DATA
tests/equil_rsvd_and_rvvd.DATA
tests/equil_rsvd_and_rvvd_and_rvwvd.DATA
tests/tpsa_ex.data
tests/wetgas.DATA
tests/satfuncEPS_B.DATA
tests/wells_manager_data.data
Expand Down Expand Up @@ -793,6 +801,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/discretization/common/linearizationtype.hh
opm/models/discretization/common/restrictprolong.hh
opm/models/discretization/common/tpfalinearizer.hh
opm/models/discretization/common/tpsalinearizer.hpp
opm/models/discretization/ecfv/ecfvbaseoutputmodule.hh
opm/models/discretization/ecfv/ecfvdiscretization.hh
opm/models/discretization/ecfv/ecfvgridcommhandlefactory.hh
Expand Down Expand Up @@ -863,6 +872,8 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/io/vtktemperaturemodule.hpp
opm/models/io/vtktemperatureparams.hpp
opm/models/io/vtktensorfunction.hh
opm/models/io/vtktpsamodule.hpp
opm/models/io/vtktpsaparams.hpp
opm/models/io/vtkvectorfunction.hh
opm/models/ncp/ncpboundaryratevector.hh
opm/models/ncp/ncpextensivequantities.hh
Expand Down Expand Up @@ -910,6 +921,13 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/richards/richardsprimaryvariables.hh
opm/models/richards/richardsproperties.hh
opm/models/richards/richardsratevector.hh
opm/models/tpsa/elasticityindices.hpp
opm/models/tpsa/elasticitylocalresidualtpsa.hpp
opm/models/tpsa/elasticityprimaryvariables.hpp
opm/models/tpsa/tpsabaseproperties.hpp
opm/models/tpsa/tpsamodel.hpp
opm/models/tpsa/tpsanewtonmethod.hpp
opm/models/tpsa/tpsanewtonmethodparams.hpp
opm/models/utils/alignedallocator.hh
opm/models/utils/basicparameters.hh
opm/models/utils/basicproperties.hh
Expand Down Expand Up @@ -939,6 +957,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/BlackoilModelNldd.hpp
opm/simulators/flow/BlackoilModelParameters.hpp
opm/simulators/flow/BlackoilModelProperties.hpp
opm/simulators/flow/BlackoilModelTPSA.hpp
opm/simulators/flow/CO2H2Container.hpp
opm/simulators/flow/CollectDataOnIORank.hpp
opm/simulators/flow/CollectDataOnIORank_impl.hpp
Expand All @@ -953,6 +972,8 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/EquilInitializer.hpp
opm/simulators/flow/ExtboContainer.hpp
opm/simulators/flow/ExtraConvergenceOutputThread.hpp
opm/simulators/flow/FacePropertiesTPSA.hpp
opm/simulators/flow/FacePropertiesTPSA_impl.hpp
opm/simulators/flow/FemCpGridCompat.hpp
opm/simulators/flow/FIBlackoilModel.hpp
opm/simulators/flow/FIPContainer.hpp
Expand All @@ -968,6 +989,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/FlowProblemComp.hpp
opm/simulators/flow/FlowProblemCompProperties.hpp
opm/simulators/flow/FlowProblemParameters.hpp
opm/simulators/flow/FlowProblemTPSA.hpp
opm/simulators/flow/FlowsContainer.hpp
opm/simulators/flow/FlowUtils.hpp
opm/simulators/flow/FlowsData.hpp
Expand Down Expand Up @@ -1007,6 +1029,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/SolutionContainers.hpp
opm/simulators/flow/SubDomain.hpp
opm/simulators/flow/TTagFlowProblemTPFA.hpp
opm/simulators/flow/TTagFlowProblemTPSA.hpp
opm/simulators/flow/TTagFlowProblemGasWater.hpp
opm/simulators/flow/TTagFlowProblemOnePhase.hpp
opm/simulators/flow/TracerContainer.hpp
Expand Down Expand Up @@ -1057,6 +1080,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/linalg/is_gpu_operator.hpp
opm/simulators/linalg/ISTLSolver.hpp
opm/simulators/linalg/ISTLSolverRuntimeOptionProxy.hpp
opm/simulators/linalg/ISTLSolverTPSA.hpp
opm/simulators/linalg/istlpreconditionerwrappers.hh
opm/simulators/linalg/istlsolverwrappers.hh
opm/simulators/linalg/istlsparsematrixadapter.hh
Expand Down Expand Up @@ -1101,6 +1125,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/linalg/SmallDenseMatrixUtils.hpp
opm/simulators/linalg/setupPropertyTree.hpp
opm/simulators/linalg/superlubackend.hh
opm/simulators/linalg/TPSALinearSolverParameters.hpp
opm/simulators/linalg/twolevelmethodcpr.hh
opm/simulators/linalg/vertexborderlistfromgrid.hh
opm/simulators/linalg/weightedresidreductioncriterion.hh
Expand Down
104 changes: 104 additions & 0 deletions flow/flow_blackoil_tpsa.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
Copyright 2025, 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/models/blackoil/blackoillocalresidualtpfa.hh>
#include <opm/models/discretization/common/tpfalinearizer.hh>

#include <opm/simulators/flow/BlackoilModelProperties.hpp>
#include <opm/simulators/flow/Main.hpp>
#include <opm/simulators/flow/TTagFlowProblemTPSA.hpp>

#include <tuple>


namespace Opm::Properties {

namespace TTag {

struct FlowBlackOilProblemTPSA
{
using InheritsFrom = std::tuple<FlowProblem, FlowProblemTpsa>;
};

} // namespace Opm::Properties::TTag

// ///
// Flow related properties
// ///
template<class TypeTag>
struct Linearizer<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ using type = TpfaLinearizer<TypeTag>; };

template<class TypeTag>
struct LocalResidual<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ using type = BlackOilLocalResidualTPFA<TypeTag>; };

template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ static constexpr bool value = false; };

template<class TypeTag>
struct AvoidElementContext<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ static constexpr bool value = true; };

// ///
// TPSA related properties
// ///
template <class TypeTag>
struct EnableMech<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ static constexpr bool value = true; };

template <class TypeTag>
struct Problem<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ using type = FlowProblemTPSA<TypeTag>; };

template <class TypeTag>
struct NonlinearSystem<TypeTag, TTag::FlowBlackOilProblemTPSA>
{ using type = BlackoilModelTPSA<TypeTag>; };

} // namespace Opm::Properties

namespace Opm {

// ----------------- Main program -----------------
int flowBlackoilTpsaMain(int argc, char** argv, bool outputCout, bool outputFiles)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
resetLocale();

FlowMain<Properties::TTag::FlowBlackOilProblemTPSA>
mainfunc {argc, argv, outputCout, outputFiles};
return mainfunc.execute();
}

int flowBlackoilTpsaMainStandalone(int argc, char** argv)
{
using TypeTag = Properties::TTag::FlowBlackOilProblemTPSA;
auto mainObject = std::make_unique<Opm::Main>(argc, argv);
auto ret = mainObject->runStatic<TypeTag>();
// Destruct mainObject as the destructor calls MPI_Finalize!
mainObject.reset();
return ret;
}

} // namespace Opm
35 changes: 35 additions & 0 deletions flow/flow_blackoil_tpsa.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
Copyright 2025, 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/>.
*/
#ifndef FLOW_BLACKOIL_TPSA_HPP
#define FLOW_BLACKOIL_TPSA_HPP


namespace Opm {

//! \brief Main function used in flow binary.
int flowBlackoilTpsaMain(int argc, char** argv, bool outputCout, bool outputFiles);

//! \brief Main function used in flow_blackoil_tpsa binary.
int flowBlackoilTpsaMainStandalone(int argc, char** argv);

} // namespace Opm

#endif
28 changes: 28 additions & 0 deletions flow/flow_blackoil_tpsa_main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
Copyright 2025, 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 <flow/flow_blackoil_tpsa.hpp>


int main(int argc, char** argv)
{
return Opm::flowBlackoilTpsaMainStandalone(argc, argv);
}
Loading