Commit 7c0e9f09 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/test-1p3c-maxwell-stefan' into 'master'

[test][1pnc] Improve Maxwell-Stefan test

Closes #1158

See merge request !3145
parents a0f0e297 4cbb547b
Pipeline #17660 canceled with stages
in 0 seconds
......@@ -8,7 +8,7 @@ dumux_add_test(NAME test_1pnc_maxwellstefan_tpfa
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_1pnc_maxwellstefan_tpfa-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_maxwellstefan_tpfa-00019.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_maxwellstefan_tpfa-00005.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_maxwellstefan_tpfa params.input -Problem.Name test_1pnc_maxwellstefan_tpfa")
dumux_add_test(NAME test_1pnc_maxwellstefan_box
......@@ -18,6 +18,6 @@ dumux_add_test(NAME test_1pnc_maxwellstefan_box
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_1pnc_maxwellstefan_box-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_maxwellstefan_box-00019.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_maxwellstefan_box-00005.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_1pnc_maxwellstefan_box params.input -Problem.Name test_1pnc_maxwellstefan_box"
--zeroThreshold {"velocity_Gas \(m/s\)":1e-13})
......@@ -100,12 +100,6 @@ int main(int argc, char** argv)
auto gridVariables = std::make_shared<GridVariables>(problem, gridGeometry);
gridVariables->init(x);
// get some time loop parameters
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
auto tEnd = getParam<Scalar>("TimeLoop.TEnd");
auto dt = getParam<Scalar>("TimeLoop.DtInitial");
auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
// intialize the vtk output module
VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name());
using VelocityOutput = GetPropType<TypeTag, Properties::VelocityOutput>;
......@@ -115,8 +109,13 @@ int main(int argc, char** argv)
vtkWriter.write(0.0);
// instantiate time loop
auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
const auto tEnd = getParam<Scalar>("TimeLoop.TEnd");
const auto dt = getParam<Scalar>("TimeLoop.DtInitial");
const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0.0, dt, tEnd);
timeLoop->setMaxTimeStepSize(maxDt);
timeLoop->setPeriodicCheckPoint(tEnd/5.0);
// the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
......@@ -144,7 +143,8 @@ int main(int argc, char** argv)
timeLoop->advanceTimeStep();
// write vtk output
vtkWriter.write(timeLoop->time());
if (timeLoop->isCheckPoint())
vtkWriter.write(timeLoop->time());
// report statistics of this time step
timeLoop->reportTimeStep();
......
[TimeLoop]
DtInitial = 1 # [s]
DtInitial = 15 # [s]
TEnd = 3600 # [s]
MaxTimeStepSize = 25 # [s]
[Grid]
UpperRight = 1 1
Cells = 30 30
UpperRight = 1 0.03
Cells = 30 1
[Problem]
Name = maxwellstefan_1pnc # name passed to the output routines
......
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