Skip to content
Snippets Groups Projects
Commit 47ccca34 authored by Melanie Lipp's avatar Melanie Lipp Committed by Kilian Weishaupt
Browse files

[test][freeflow][kovasnay] Add test with stair boundary geometry.

parent c8b68d92
No related branches found
No related tags found
1 merge request!2163Freeflow/cornervelocity
......@@ -10,17 +10,33 @@ dumux_add_test(NAME test_ff_navierstokes_kovasznay
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_kovasznay params.input
-Problem.Name test_ff_navierstokes_kovasznay")
dumux_add_test(NAME test_ff_navierstokes_kovasznay_higherorder
SOURCES main.cc
add_executable(test_ff_navierstokes_kovasznay_higherorder EXCLUDE_FROM_ALL main.cc)
target_compile_definitions(test_ff_navierstokes_kovasznay_higherorder PUBLIC "UPWINDSCHEMEORDER=2")
dumux_add_test(NAME test_ff_navierstokes_kovasznay_higherorder_cuboid
TARGET test_ff_navierstokes_kovasznay_higherorder
LABELS freeflow navierstokes
CMAKE_GUARD HAVE_UMFPACK
COMPILE_DEFINITIONS UPWINDSCHEMEORDER=2
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_ff_navierstokes_kovasznay_higherorder-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_kovasznay_higherorder-00001.vtu
--files ${CMAKE_SOURCE_DIR}/test/references/test_ff_navierstokes_kovasznay_higherorder_cuboid-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_kovasznay_higherorder_cuboid-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_kovasznay_higherorder params.input
-Problem.Name test_ff_navierstokes_kovasznay_higherorder_cuboid
-Flux.TvdApproach Hou
-Flux.DifferencingScheme Vanleer")
dumux_add_test(NAME test_ff_navierstokes_kovasznay_higherorder_staircase
TARGET test_ff_navierstokes_kovasznay_higherorder
LABELS freeflow navierstokes
CMAKE_GUARD HAVE_UMFPACK dune-subgrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/test_ff_navierstokes_kovasznay_higherorder_staircase-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_kovasznay_higherorder_staircase-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_kovasznay_higherorder params.input
-Problem.Name test_ff_navierstokes_kovasznay_higherorder
-Problem.Name test_ff_navierstokes_kovasznay_higherorder_staircase
-Problem.IsStaircaseGeometry true
-Flux.TvdApproach Hou
-Flux.DifferencingScheme Vanleer")
......
......@@ -38,6 +38,7 @@
#include <dumux/common/dumuxmessage.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/properties.hh>
#include <dumux/io/grid/gridmanager_sub.hh>
#include <dumux/io/grid/gridmanager_yasp.hh>
#include <dumux/io/staggeredvtkoutputmodule.hh>
#include <dumux/linear/seqsolverbackend.hh>
......@@ -63,9 +64,37 @@ int main(int argc, char** argv) try
// parse command line arguments and input file
Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file)
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
// create a grid
using Grid = GetPropType<TypeTag, Properties::Grid>;
Dumux::GridManager<Grid> gridManager;
#if HAVE_DUNE_SUBGRID
const bool isStaircaseGeometry = getParam<bool>("Problem.IsStaircaseGeometry", false);
// cut out elements within the stair-case region
auto selector = [&](const auto& element)
{
if (!isStaircaseGeometry)
return true;
const auto globalPos = element.geometry().center();
const auto x = globalPos[0];
const auto y = globalPos[1];
auto eps = 1e-12;
static const auto lowerLeft = getParam<std::decay_t<decltype(globalPos)>>("Grid.LowerLeft");
if (x < eps || y > (lowerLeft[1] + 1.0 - eps))
return true;
const bool isBelowCurve = y < (x/2.0 - std::floor(x/2.0) + lowerLeft[1] + eps);
return !isBelowCurve;
};
gridManager.init(selector, "Internal");
#else
gridManager.init();
#endif
////////////////////////////////////////////////////////////
// run instationary non-linear problem on this grid
......
......@@ -31,6 +31,10 @@
#include <dune/grid/yaspgrid.hh>
#if HAVE_DUNE_SUBGRID
#include <dune/subgrid/subgrid.hh>
#endif
#include <dumux/discretization/staggered/freeflow/properties.hh>
#include <dumux/freeflow/navierstokes/boundarytypes.hh>
......@@ -62,7 +66,16 @@ struct FluidSystem<TypeTag, TTag::KovasznayTest>
// Set the grid type
template<class TypeTag>
struct Grid<TypeTag, TTag::KovasznayTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; };
struct Grid<TypeTag, TTag::KovasznayTest>
{
using HostGrid = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >;
#if HAVE_DUNE_SUBGRID
using type = Dune::SubGrid<HostGrid::dimension, HostGrid>;
#else
using type = HostGrid;
#endif
};
// Set the problem property
template<class TypeTag>
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
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