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
dune_symlink_to_source_files(FILES "params.input" "grids")
# using box
add_executable(test_2p_fracture_box EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_2p_fracture_box PUBLIC 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
# tests without gravity
dune_add_test(NAME test_2p_fracture_box
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=FractureBox
CMAKE_GUARD dune-foamgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--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")
dune_add_test(NAME test_2p_fracture_nogravity_tpfa
TARGET test_2p_fracture_tpfa
dune_add_test(NAME test_2p_fracture_tpfa
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=FractureCCTpfa
CMAKE_GUARD dune-foamgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--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")
dune_add_test(NAME test_2p_fracture_nogravity_mpfa
TARGET test_2p_fracture_mpfa
dune_add_test(NAME test_2p_fracture_mpfa
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=FractureCCMpfa
CMAKE_GUARD dune-foamgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--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")
# tests with gravity
......@@ -47,7 +38,7 @@ dune_add_test(NAME test_2p_fracture_gravity_box
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--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")
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
CMD_ARGS --script fuzzy
--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")
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
CMD_ARGS --script fuzzy
--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")
set(CMAKE_BUILD_TYPE Release)
......
......@@ -128,8 +128,9 @@ int main(int argc, char** argv) try
vtkWriter.write(0.0);
// 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->setPeriodicCheckPoint(getParam<Scalar>("TimeLoop.PeriodicCheckPoint"));
// the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
......@@ -160,7 +161,8 @@ int main(int argc, char** argv) try
timeLoop->advanceTimeStep();
// write vtk output
vtkWriter.write(timeLoop->time());
if (timeLoop->isCheckPoint() || timeLoop->finished())
vtkWriter.write(timeLoop->time());
// report statistics of this time step
timeLoop->reportTimeStep();
......
[TimeLoop]
DtInitial = 250 # [s]
TEnd = 300000 # [s]
MaxTimeStepSize = 10000 # [s]
PeriodicCheckPoint = 300000 # [s]
[Grid]
File = grids/fracture.msh
......@@ -8,3 +10,9 @@ File = grids/fracture.msh
[Problem]
Name = fracture
EnableGravity = false
[LinearSolver]
ResidualReduction = 1e-16
[Newton]
MaxRelativeShift = 1e-10
......@@ -148,6 +148,17 @@ public:
Scalar temperature() const
{ 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;
}
// \}
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment