Skip to content
Snippets Groups Projects
Commit cef05a1d authored by Timo Koch's avatar Timo Koch
Browse files

[test][2p] Attempt to improve the stability of the fracture tests

* Always compare the last vtu file
* Set maximum time step size lower
* Set Newton and linear solver tolerance lower
parent eeb23606
No related branches found
No related tags found
1 merge request!1382[test][2p] Attempt to improve the stability of the fracture tests
Showing with 4960 additions and 4948 deletions
dune_symlink_to_source_files(FILES "params.input" "grids") dune_symlink_to_source_files(FILES "params.input" "grids")
# using box # tests without gravity
add_executable(test_2p_fracture_box EXCLUDE_FROM_ALL main.cc) dune_add_test(NAME test_2p_fracture_box
target_compile_definitions(test_2p_fracture_box PUBLIC TYPETAG=FractureBox) SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=FractureBox
# using tpfa
add_executable(test_2p_fracture_tpfa EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_2p_fracture_tpfa PUBLIC TYPETAG=FractureCCTpfa)
# using tpfa
add_executable(test_2p_fracture_mpfa EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_2p_fracture_mpfa PUBLIC TYPETAG=FractureCCMpfa)
# box test without gravity
dune_add_test(NAME test_2p_fracture_nogravity_box
TARGET test_2p_fracture_box
CMAKE_GUARD dune-foamgrid_FOUND CMAKE_GUARD dune-foamgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_box-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_box-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_box-00023.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_box-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_box params.input -Problem.Name test_2p_fracture_box") --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_box params.input -Problem.Name test_2p_fracture_box")
dune_add_test(NAME test_2p_fracture_nogravity_tpfa dune_add_test(NAME test_2p_fracture_tpfa
TARGET test_2p_fracture_tpfa SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=FractureCCTpfa
CMAKE_GUARD dune-foamgrid_FOUND CMAKE_GUARD dune-foamgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_tpfa-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_tpfa-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_tpfa-00029.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_tpfa-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_tpfa params.input -Problem.Name test_2p_fracture_tpfa") --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_tpfa params.input -Problem.Name test_2p_fracture_tpfa")
dune_add_test(NAME test_2p_fracture_nogravity_mpfa dune_add_test(NAME test_2p_fracture_mpfa
TARGET test_2p_fracture_mpfa SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=FractureCCMpfa
CMAKE_GUARD dune-foamgrid_FOUND CMAKE_GUARD dune-foamgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_mpfa-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_mpfa-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_mpfa-00030.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_mpfa-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_mpfa params.input -Problem.Name test_2p_fracture_mpfa") --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_mpfa params.input -Problem.Name test_2p_fracture_mpfa")
# tests with gravity # tests with gravity
...@@ -47,7 +38,7 @@ dune_add_test(NAME test_2p_fracture_gravity_box ...@@ -47,7 +38,7 @@ dune_add_test(NAME test_2p_fracture_gravity_box
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_gravity_box-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_gravity_box-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_gravity_box-00028.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_gravity_box-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_box params.input -Problem.Name test_2p_fracture_gravity_box -Problem.EnableGravity true") --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_box params.input -Problem.Name test_2p_fracture_gravity_box -Problem.EnableGravity true")
dune_add_test(NAME test_2p_fracture_gravity_tpfa dune_add_test(NAME test_2p_fracture_gravity_tpfa
...@@ -56,7 +47,7 @@ dune_add_test(NAME test_2p_fracture_gravity_tpfa ...@@ -56,7 +47,7 @@ dune_add_test(NAME test_2p_fracture_gravity_tpfa
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_gravity_tpfa-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_gravity_tpfa-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_gravity_tpfa-00042.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_gravity_tpfa-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_tpfa params.input -Problem.Name test_2p_fracture_gravity_tpfa -Problem.EnableGravity true") --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_tpfa params.input -Problem.Name test_2p_fracture_gravity_tpfa -Problem.EnableGravity true")
dune_add_test(NAME test_2p_fracture_gravity_mpfa dune_add_test(NAME test_2p_fracture_gravity_mpfa
...@@ -65,7 +56,7 @@ dune_add_test(NAME test_2p_fracture_gravity_mpfa ...@@ -65,7 +56,7 @@ dune_add_test(NAME test_2p_fracture_gravity_mpfa
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_gravity_mpfa-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/test_2p_fracture_gravity_mpfa-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_gravity_mpfa-00042.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_gravity_mpfa-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_mpfa params.input -Problem.Name test_2p_fracture_gravity_mpfa -Problem.EnableGravity true") --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_fracture_mpfa params.input -Problem.Name test_2p_fracture_gravity_mpfa -Problem.EnableGravity true")
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
......
...@@ -128,8 +128,9 @@ int main(int argc, char** argv) try ...@@ -128,8 +128,9 @@ int main(int argc, char** argv) try
vtkWriter.write(0.0); vtkWriter.write(0.0);
// instantiate time loop // instantiate time loop
auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0, dt, tEnd); auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0, dt, tEnd);
timeLoop->setMaxTimeStepSize(maxDt); timeLoop->setMaxTimeStepSize(maxDt);
timeLoop->setPeriodicCheckPoint(getParam<Scalar>("TimeLoop.PeriodicCheckPoint"));
// the assembler with time loop for instationary problem // the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
...@@ -160,7 +161,8 @@ int main(int argc, char** argv) try ...@@ -160,7 +161,8 @@ int main(int argc, char** argv) try
timeLoop->advanceTimeStep(); timeLoop->advanceTimeStep();
// write vtk output // write vtk output
vtkWriter.write(timeLoop->time()); if (timeLoop->isCheckPoint() || timeLoop->finished())
vtkWriter.write(timeLoop->time());
// report statistics of this time step // report statistics of this time step
timeLoop->reportTimeStep(); timeLoop->reportTimeStep();
......
[TimeLoop] [TimeLoop]
DtInitial = 250 # [s] DtInitial = 250 # [s]
TEnd = 300000 # [s] TEnd = 300000 # [s]
MaxTimeStepSize = 10000 # [s]
PeriodicCheckPoint = 300000 # [s]
[Grid] [Grid]
File = grids/fracture.msh File = grids/fracture.msh
...@@ -8,3 +10,9 @@ File = grids/fracture.msh ...@@ -8,3 +10,9 @@ File = grids/fracture.msh
[Problem] [Problem]
Name = fracture Name = fracture
EnableGravity = false EnableGravity = false
[LinearSolver]
ResidualReduction = 1e-16
[Newton]
MaxRelativeShift = 1e-10
...@@ -148,6 +148,17 @@ public: ...@@ -148,6 +148,17 @@ public:
Scalar temperature() const Scalar temperature() const
{ return 273.15 + 20; } { return 273.15 + 20; }
/*!
* \brief Specifies which kind of boundary condition should be
* used for which equation on a given boundary segment.
*
* \param globalPos The global position where to set the BC types
*/
Scalar extrusionFactorAtPos(const GlobalPosition &globalPos) const
{
return 0.1;
}
// \} // \}
/*! /*!
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment