diff --git a/test/porousmediumflow/1pnc/implicit/CMakeLists.txt b/test/porousmediumflow/1pnc/implicit/CMakeLists.txt index 94cbfd65fdb08ab86c373d99a3b3e3703c99615f..b3e4239da07dc56f60cc42605eaa4770a85949b1 100644 --- a/test/porousmediumflow/1pnc/implicit/CMakeLists.txt +++ b/test/porousmediumflow/1pnc/implicit/CMakeLists.txt @@ -1,107 +1,3 @@ -add_input_file_links() - -dune_add_test(NAME test_1p2c_box - SOURCES test_1p2c_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCTestBoxTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/outflowbox-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1pnctestbox-00009.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_box test_1p2c_fv.input -Problem.Name 1pnctestbox" - --zeroThreshold {"velocity_liq \(m/s\)_1":1e-15}) - -dune_add_test(NAME test_1p2c_tpfa - SOURCES test_1p2c_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCTestCCTpfaTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2ctestcc-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1pnctest_tpfa-00009.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_tpfa test_1p2c_fv.input -Problem.Name 1pnctest_tpfa" - --zeroThreshold {"velocity_liq \(m/s\)_1":1e-15}) - -#Note: The mpfa model does not support velocity output yet. We therefore deactivate it for the test and use a copy of the tpfa reference -# solution where the velocities have been removed. -dune_add_test(NAME test_1p2c_mpfa - SOURCES test_1p2c_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCTestCCMpfaTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2ctestmpfa-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1pnctest_mpfa-00009.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_mpfa test_1p2c_fv.input -Problem.Name 1pnctest_mpfa -Vtk.AddVelocity false") - -# salt-water intrusion test using the box model -dune_add_test(NAME test_saltwaterintrusion_box - SOURCES test_1p2c_fv.cc - COMPILE_DEFINITIONS TYPETAG=SaltWaterIntrusionTestTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/saltwaterintrusion-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/saltwaterintrusion-00035.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_saltwaterintrusion_box saltwaterintrusion.input") - -# non-isothermal tests -# conduction -dune_add_test(NAME test_1p2cni_conduction_box - SOURCES test_1p2cni_conduction_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConductionBoxTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2cniboxconduction-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1p2cni_conductiontest_box-00005.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_box test_1p2cni_conduction_fv.input -Problem.Name 1p2cni_conductiontest_box" - --zeroThreshold {"velocity_liq \(m/s\)":1e-9}) - -dune_add_test(NAME test_1p2cni_conduction_tpfa - SOURCES test_1p2cni_conduction_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConductionCCTpfaTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2cniccconduction-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1p2cni_conductiontest_tpfa-00005.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_tpfa test_1p2cni_conduction_fv.input -Problem.Name 1p2cni_conductiontest_tpfa" - --zeroThreshold {"velocity_liq \(m/s\)_0":1e-9}) - -#Note: The mpfa model does not support velocity output yet. We therefore deactivate it for the test and use a copy of the tpfa reference -# solution where the velocities have been removed. -dune_add_test(NAME test_1p2cni_conduction_mpfa - SOURCES test_1p2cni_conduction_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConductionCCMpfaTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2cniccmpfaconduction-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1p2cni_conductiontest_mpfa-00005.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_mpfa test_1p2cni_conduction_fv.input -Problem.Name 1p2cni_conductiontest_mpfa -Vtk.AddVelocity false") - -# convection -dune_add_test(NAME test_1p2cni_convection_box - SOURCES test_1p2cni_convection_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConvectionBoxTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2cniboxconvection-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1p2cni_convectiontest_box-00009.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_box test_1p2cni_convection_fv.input -Problem.Name 1p2cni_convectiontest_box" - --zeroThreshold {"velocity_liq \(m/s\)":1e-9}) - -dune_add_test(NAME test_1p2cni_convection_tpfa - SOURCES test_1p2cni_convection_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConvectionCCTpfaTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2cniccconvection-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1p2cni_convectiontest_tpfa-00009.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_tpfa test_1p2cni_convection_fv.input -Problem.Name 1p2cni_convectiontest_tpfa" - --zeroThreshold {"velocity_liq \(m/s\)_0":1e-9}) - -#Note: The mpfa model does not support velocity output yet. We therefore deactivate it for the test and use a copy of the tpfa reference -# solution where the velocities have been removed. -dune_add_test(NAME test_1p2cni_convection_mpfa - SOURCES test_1p2cni_convection_fv.cc - COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConvectionCCMpfaTypeTag - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/1p2cniccmpfaconvection-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/1p2cni_convectiontest_mpfa-00009.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_mpfa test_1p2cni_convection_fv.input -Problem.Name 1p2cni_convectiontest_mpfa -Vtk.AddVelocity false") +add_subdirectory("isothermal") +add_subdirectory("nonisothermal") +add_subdirectory("saltwaterintrusion") diff --git a/test/porousmediumflow/1pnc/implicit/isothermal/CMakeLists.txt b/test/porousmediumflow/1pnc/implicit/isothermal/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..663f6167a2f7170e4bc4816ce83503c615b2da23 --- /dev/null +++ b/test/porousmediumflow/1pnc/implicit/isothermal/CMakeLists.txt @@ -0,0 +1,32 @@ +add_input_file_links() + +dune_add_test(NAME test_1p2c_box + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCTestBoxTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2c_box-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_box-00009.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_box params.input -Problem.Name test_1p2c_box" + --zeroThreshold {"velocity_liq \(m/s\)_1":1e-15}) + +dune_add_test(NAME test_1p2c_tpfa + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCTestCCTpfaTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2c_cc-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_tpfa-00009.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_tpfa params.input -Problem.Name test_1p2c_tpfa" + --zeroThreshold {"velocity_liq \(m/s\)_1":1e-15}) + +#Note: The mpfa model does not support velocity output yet. We therefore deactivate it for the test and use a copy of the tpfa reference +# solution where the velocities have been removed. +dune_add_test(NAME test_1p2c_mpfa + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCTestCCMpfaTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2c_mpfa-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_mpfa-00009.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_mpfa params.input -Problem.Name test_1p2c_mpfa -Vtk.AddVelocity false") diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc b/test/porousmediumflow/1pnc/implicit/isothermal/main.cc similarity index 99% rename from test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc rename to test/porousmediumflow/1pnc/implicit/isothermal/main.cc index d6eccc18a854135c949b788610f0cc6759c44d29..36284d306ca64a9a56db2b007e7a651812b879cc 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/isothermal/main.cc @@ -23,9 +23,6 @@ */ #include -#include "1p2ctestproblem.hh" -#include "saltwaterintrusionproblem.hh" - #include #include @@ -50,6 +47,8 @@ #include #include +#include "problem.hh" + int main(int argc, char** argv) try { using namespace Dumux; diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.input b/test/porousmediumflow/1pnc/implicit/isothermal/params.input similarity index 100% rename from test/porousmediumflow/1pnc/implicit/test_1p2c_fv.input rename to test/porousmediumflow/1pnc/implicit/isothermal/params.input diff --git a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh b/test/porousmediumflow/1pnc/implicit/isothermal/problem.hh similarity index 99% rename from test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh rename to test/porousmediumflow/1pnc/implicit/isothermal/problem.hh index 585e1823f95eba5f8f6ac10781df1c382f22b9ad..2462ec1dbe31996003c2d691efef93ae50b0360d 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/isothermal/problem.hh @@ -41,7 +41,7 @@ #include #include -#include "1pnctestspatialparams.hh" +#include "../spatialparams.hh" namespace Dumux { diff --git a/test/porousmediumflow/1pnc/implicit/nonisothermal/CMakeLists.txt b/test/porousmediumflow/1pnc/implicit/nonisothermal/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4b0f16da4aed09ebcab7dadf912cb8c27e00c400 --- /dev/null +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory("conduction") +add_subdirectory("convection") diff --git a/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/CMakeLists.txt b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9afcaefb4b77aaf54839b4863f3087d9a4b0c93e --- /dev/null +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/CMakeLists.txt @@ -0,0 +1,34 @@ +add_input_file_links() + +# non-isothermal tests +# conduction +dune_add_test(NAME test_1p2cni_conduction_box + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConductionBoxTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2cni_conduction_box-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_box-00005.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_box params.input -Problem.Name test_1p2cni_conduction_box" + --zeroThreshold {"velocity_liq \(m/s\)":1e-9}) + +dune_add_test(NAME test_1p2cni_conduction_tpfa + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConductionCCTpfaTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2cni_conduction_cc-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_tpfa-00005.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_tpfa params.input -Problem.Name test_1p2cni_conduction_tpfa" + --zeroThreshold {"velocity_liq \(m/s\)_0":1e-9}) + +#Note: The mpfa model does not support velocity output yet. We therefore deactivate it for the test and use a copy of the tpfa reference +# solution where the velocities have been removed. +dune_add_test(NAME test_1p2cni_conduction_mpfa + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConductionCCMpfaTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2cni_conduction_mpfa-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_mpfa-00005.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_conduction_mpfa params.input -Problem.Name test_1p2cni_conduction_mpfa -Vtk.AddVelocity false") diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/main.cc similarity index 99% rename from test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc rename to test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/main.cc index 0f5f7d2acc34797f3d4a47f483185f402b1ee655..c44ef1b241c3401b3a122182349882f0f26e6cf2 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/main.cc @@ -23,7 +23,7 @@ */ #include -#include "1p2cniconductionproblem.hh" +#include "problem.hh" #include #include diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.input b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/params.input similarity index 100% rename from test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.input rename to test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/params.input diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/problem.hh similarity index 99% rename from test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh rename to test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/problem.hh index 11fa5795c752a9290f8f6629b595cf13b7fa0d02..a93e093ee8558cf683b968368a0b2c9f80d6a323 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/conduction/problem.hh @@ -40,7 +40,7 @@ #include #include #include -#include "1pnctestspatialparams.hh" +#include "../../spatialparams.hh" namespace Dumux { diff --git a/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/CMakeLists.txt b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4250ccbeca0901403dd50f139b5e7ae3efb66d66 --- /dev/null +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/CMakeLists.txt @@ -0,0 +1,34 @@ +add_input_file_links() + +# non-isothermal tests +# convection +dune_add_test(NAME test_1p2cni_convection_box + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConvectionBoxTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2cni_convection_box-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_box-00009.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_box params.input -Problem.Name test_1p2cni_convection_box" + --zeroThreshold {"velocity_liq \(m/s\)":1e-9}) + +dune_add_test(NAME test_1p2cni_convection_tpfa + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConvectionCCTpfaTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2cni_convection_cc-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_tpfa-00009.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_tpfa params.input -Problem.Name test_1p2cni_convection_tpfa" + --zeroThreshold {"velocity_liq \(m/s\)_0":1e-9}) + +#Note: The mpfa model does not support velocity output yet. We therefore deactivate it for the test and use a copy of the tpfa reference +# solution where the velocities have been removed. +dune_add_test(NAME test_1p2cni_convection_mpfa + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=OnePTwoCNIConvectionCCMpfaTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2cni_convection_mpfa-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_mpfa-00009.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2cni_convection_mpfa params.input -Problem.Name test_1p2cni_convection_mpfa -Vtk.AddVelocity false") diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/main.cc similarity index 99% rename from test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc rename to test/porousmediumflow/1pnc/implicit/nonisothermal/convection/main.cc index 5cb98b4f1277055fc3e6daa28d690c09c1f2d0fe..006fb5db9ac2ef9466106dd1ae6ac050de0fe90a 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/main.cc @@ -23,7 +23,7 @@ */ #include -#include "1p2cniconvectionproblem.hh" +#include "problem.hh" #include #include diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.input b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/params.input similarity index 100% rename from test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.input rename to test/porousmediumflow/1pnc/implicit/nonisothermal/convection/params.input diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/problem.hh similarity index 99% rename from test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh rename to test/porousmediumflow/1pnc/implicit/nonisothermal/convection/problem.hh index 5e15469124fd95d840d219b0f2a00e130a3722ec..e04834000c0d322825635235424a2d0dc4d04d0a 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/nonisothermal/convection/problem.hh @@ -40,7 +40,7 @@ #include #include #include -#include "1pnctestspatialparams.hh" +#include "../../spatialparams.hh" namespace Dumux { diff --git a/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/CMakeLists.txt b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..7f50a97e92b871b3a37c63a452617573d569594b --- /dev/null +++ b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/CMakeLists.txt @@ -0,0 +1,11 @@ +add_input_file_links() + +# salt-water intrusion test using the box model +dune_add_test(NAME test_1p2c_saltwaterintrusion_box + SOURCES main.cc + COMPILE_DEFINITIONS TYPETAG=SaltWaterIntrusionTestTypeTag + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p2c_saltwaterintrusion_box-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_saltwaterintrusion_box-00035.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_1p2c_saltwaterintrusion_box params.input -Problem.Name test_1p2c_saltwaterintrusion_box") diff --git a/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/main.cc b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/main.cc new file mode 100644 index 0000000000000000000000000000000000000000..a33f76eb4592abcbac79ab426888151ecc57ec9d --- /dev/null +++ b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/main.cc @@ -0,0 +1,198 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * + * \brief test for the 1pnc model + */ +#include + +#include "problem.hh" + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +int main(int argc, char** argv) try +{ + using namespace Dumux; + + // define the type tag for this problem + using TypeTag = TTAG(TYPETAG); + + //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); + + // initialize parameter tree + Parameters::init(argc, argv); + + ////////////////////////////////////////////////////////////////////// + // try to create a grid (from the given grid file or the input file) + ///////////////////////////////////////////////////////////////////// + + GridManager gridManager; + gridManager.init(); + + //////////////////////////////////////////////////////////// + // run instationary non-linear problem on this grid + //////////////////////////////////////////////////////////// + + // we compute on the leaf grid view + const auto& leafGridView = gridManager.grid().leafGridView(); + + // create the finite volume grid geometry + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + auto fvGridGeometry = std::make_shared(leafGridView); + fvGridGeometry->update(); + + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared(fvGridGeometry); + + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector x(fvGridGeometry->numDofs()); + problem->applyInitialSolution(x); + auto xOld = x; + + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared(problem, fvGridGeometry); + gridVariables->init(x, xOld); + + // get some time loop parameters + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + auto tEnd = getParam("TimeLoop.TEnd"); + auto dt = getParam("TimeLoop.DtInitial"); + auto maxDt = getParam("TimeLoop.MaxTimeStepSize"); + + // intialize the vtk output module + VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); + using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); + vtkWriter.addVelocityOutput(std::make_shared(*gridVariables)); + using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + vtkWriter.write(0.0); + + // instantiate time loop + auto timeLoop = std::make_shared>(0.0, dt, tEnd); + timeLoop->setMaxTimeStepSize(maxDt); + + // the assembler with time loop for instationary problem + using Assembler = FVAssembler; + auto assembler = std::make_shared(problem, fvGridGeometry, gridVariables, timeLoop); + + // the linear solver + using LinearSolver = ILU0BiCGSTABBackend; + auto linearSolver = std::make_shared(); + + // the non-linear solver + NewtonSolver nonLinearSolver(assembler, linearSolver); + + // time loop + timeLoop->start(); do + { + // set previous solution for storage evaluations + assembler->setPreviousSolution(xOld); + + // solve the non-linear system with time step control + nonLinearSolver.solve(x, *timeLoop); + + // make the new solution the old solution + xOld = x; + gridVariables->advanceTimeStep(); + + // advance to the time loop to the next step + timeLoop->advanceTimeStep(); + + // write vtk output + vtkWriter.write(timeLoop->time()); + + // report statistics of this time step + timeLoop->reportTimeStep(); + + // set new dt as suggested by the newton solver + timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); + + } while (!timeLoop->finished()); + + timeLoop->finalize(leafGridView.comm()); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/false); + + return 0; +} + +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::DGFException & e) +{ + std::cerr << "DGF exception thrown (" << e << + "). Most likely, the DGF file name is wrong " + "or the DGF file is corrupted, " + "e.g. missing hash at end of file or wrong number (dimensions) of entries." + << " ---> Abort!" << std::endl; + return 2; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 3; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 4; +} diff --git a/test/porousmediumflow/1pnc/implicit/saltwaterintrusion.input b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/params.input similarity index 100% rename from test/porousmediumflow/1pnc/implicit/saltwaterintrusion.input rename to test/porousmediumflow/1pnc/implicit/saltwaterintrusion/params.input diff --git a/test/porousmediumflow/1pnc/implicit/saltwaterintrusionproblem.hh b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/problem.hh similarity index 99% rename from test/porousmediumflow/1pnc/implicit/saltwaterintrusionproblem.hh rename to test/porousmediumflow/1pnc/implicit/saltwaterintrusion/problem.hh index 0ca5541c70137ec3315426ef3e02655b4e7928c4..e7b8920432a55f7da968b76577fd610ba1795cf0 100644 --- a/test/porousmediumflow/1pnc/implicit/saltwaterintrusionproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/saltwaterintrusion/problem.hh @@ -30,7 +30,7 @@ #include #include -#include "1pnctestspatialparams.hh" +#include "../spatialparams.hh" namespace Dumux { diff --git a/test/porousmediumflow/1pnc/implicit/1pnctestspatialparams.hh b/test/porousmediumflow/1pnc/implicit/spatialparams.hh similarity index 100% rename from test/porousmediumflow/1pnc/implicit/1pnctestspatialparams.hh rename to test/porousmediumflow/1pnc/implicit/spatialparams.hh diff --git a/test/references/outflowbox-reference.vtu b/test/references/test_1p2c_box-reference.vtu similarity index 100% rename from test/references/outflowbox-reference.vtu rename to test/references/test_1p2c_box-reference.vtu diff --git a/test/references/1p2ctestcc-reference.vtu b/test/references/test_1p2c_cc-reference.vtu similarity index 100% rename from test/references/1p2ctestcc-reference.vtu rename to test/references/test_1p2c_cc-reference.vtu diff --git a/test/references/1p2ctestmpfa-reference.vtu b/test/references/test_1p2c_mpfa-reference.vtu similarity index 100% rename from test/references/1p2ctestmpfa-reference.vtu rename to test/references/test_1p2c_mpfa-reference.vtu diff --git a/test/references/saltwaterintrusion-reference.vtu b/test/references/test_1p2c_saltwaterintrusion_box-reference.vtu similarity index 100% rename from test/references/saltwaterintrusion-reference.vtu rename to test/references/test_1p2c_saltwaterintrusion_box-reference.vtu diff --git a/test/references/1p2cniboxconduction-reference.vtu b/test/references/test_1p2cni_conduction_box-reference.vtu similarity index 100% rename from test/references/1p2cniboxconduction-reference.vtu rename to test/references/test_1p2cni_conduction_box-reference.vtu diff --git a/test/references/1p2cniccconduction-reference.vtu b/test/references/test_1p2cni_conduction_cc-reference.vtu similarity index 100% rename from test/references/1p2cniccconduction-reference.vtu rename to test/references/test_1p2cni_conduction_cc-reference.vtu diff --git a/test/references/1p2cniccmpfaconduction-reference.vtu b/test/references/test_1p2cni_conduction_mpfa-reference.vtu similarity index 100% rename from test/references/1p2cniccmpfaconduction-reference.vtu rename to test/references/test_1p2cni_conduction_mpfa-reference.vtu diff --git a/test/references/1p2cniboxconvection-reference.vtu b/test/references/test_1p2cni_convection_box-reference.vtu similarity index 100% rename from test/references/1p2cniboxconvection-reference.vtu rename to test/references/test_1p2cni_convection_box-reference.vtu diff --git a/test/references/1p2cniccconvection-reference.vtu b/test/references/test_1p2cni_convection_cc-reference.vtu similarity index 100% rename from test/references/1p2cniccconvection-reference.vtu rename to test/references/test_1p2cni_convection_cc-reference.vtu diff --git a/test/references/1p2cniccmpfaconvection-reference.vtu b/test/references/test_1p2cni_convection_mpfa-reference.vtu similarity index 100% rename from test/references/1p2cniccmpfaconvection-reference.vtu rename to test/references/test_1p2cni_convection_mpfa-reference.vtu