diff --git a/test/freeflow/navierstokes/angeli/main.cc b/test/freeflow/navierstokes/angeli/main.cc index 8b8642b51d1fb5752552a7ee85cc683fe3c4765d..d0ce122aa0af211456d1d4d31e82cde329ef5be1 100644 --- a/test/freeflow/navierstokes/angeli/main.cc +++ b/test/freeflow/navierstokes/angeli/main.cc @@ -44,7 +44,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" /*! * \brief Creates analytical solution. diff --git a/test/freeflow/navierstokes/angeli/problem.hh b/test/freeflow/navierstokes/angeli/problem.hh index ffbd7d21ca6bc5145fba1377905c85f3d4bfbb5a..7e2066c377caea6f29707b10aa5112ea177874ab 100644 --- a/test/freeflow/navierstokes/angeli/problem.hh +++ b/test/freeflow/navierstokes/angeli/problem.hh @@ -26,55 +26,15 @@ #ifndef DUMUX_ANGELI_TEST_PROBLEM_HH #define DUMUX_ANGELI_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/constant.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> - #include "../l2error.hh" namespace Dumux { -template <class TypeTag> -class AngeliTestProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct AngeliTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::AngeliTest> -{ -private: - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -}; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::AngeliTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::AngeliTest> { using type = Dumux::AngeliTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; -} // end namespace Properties /*! * \ingroup NavierStokesTests @@ -97,7 +57,6 @@ class AngeliTestProblem : public NavierStokesProblem<TypeTag> using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>; static constexpr auto dimWorld = GridGeometry::GridView::dimensionworld; using Element = typename GridGeometry::GridView::template Codim<0>::Entity; diff --git a/test/freeflow/navierstokes/angeli/properties.hh b/test/freeflow/navierstokes/angeli/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..51217da6891b4103e0158cfea590a62d6e9e74db --- /dev/null +++ b/test/freeflow/navierstokes/angeli/properties.hh @@ -0,0 +1,71 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesTests + * \brief The properties of the test for the instationary staggered grid Navier-Stokes model + * with analytical solution (Angeli et al. 2017, \cite Angeli2017). + */ +#ifndef DUMUX_ANGELI_TEST_PROPERTIES_HH +#define DUMUX_ANGELI_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/material/components/constant.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct AngeliTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::AngeliTest> +{ +private: + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +}; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::AngeliTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::AngeliTest> { using type = Dumux::AngeliTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokes/channel/1d/main.cc b/test/freeflow/navierstokes/channel/1d/main.cc index 4954f69fc9147f6aea98c82e938a07ad57a51909..5af6b617798079aa9388189e31e1a4cdadbdac0c 100644 --- a/test/freeflow/navierstokes/channel/1d/main.cc +++ b/test/freeflow/navierstokes/channel/1d/main.cc @@ -42,7 +42,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokes/channel/1d/problem.hh b/test/freeflow/navierstokes/channel/1d/problem.hh index c8e10dfe6f05a1734a9bd2eff0a1d2bb6349d8e4..fb44365730e409b1c7e7ff99f54ddccfe2debb53 100644 --- a/test/freeflow/navierstokes/channel/1d/problem.hh +++ b/test/freeflow/navierstokes/channel/1d/problem.hh @@ -27,56 +27,15 @@ #define DUMUX_DONEA_TEST_PROBLEM_HH #include <dune/common/fmatrix.hh> -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/constant.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> - #include "../../l2error.hh" namespace Dumux { -template <class TypeTag> -class NavierStokesAnalyticProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct NavierStokesAnalytic { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::NavierStokesAnalytic> -{ - using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -}; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::NavierStokesAnalytic> { using type = Dune::YaspGrid<1>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::NavierStokesAnalytic> { using type = Dumux::NavierStokesAnalyticProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; - -template<class TypeTag> -struct NormalizePressure<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = false; }; -} // end namespace Properties /*! * \ingroup NavierStokesTests diff --git a/test/freeflow/navierstokes/channel/1d/properties.hh b/test/freeflow/navierstokes/channel/1d/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..6d4e9d0b8ff28865dfafcc543f302bd84ab427de --- /dev/null +++ b/test/freeflow/navierstokes/channel/1d/properties.hh @@ -0,0 +1,71 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesTests + * \brief The properties of the test for the 1-D Navier-Stokes model with an analytical solution. + */ +#ifndef DUMUX_DONEA_TEST_PROPERTIES_HH +#define DUMUX_DONEA_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/material/components/constant.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct NavierStokesAnalytic { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::NavierStokesAnalytic> +{ + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +}; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::NavierStokesAnalytic> { using type = Dune::YaspGrid<1>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::NavierStokesAnalytic> { using type = Dumux::NavierStokesAnalyticProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; }; + +template<class TypeTag> +struct NormalizePressure<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = false; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokes/channel/2d/main.cc b/test/freeflow/navierstokes/channel/2d/main.cc index 240e7bc6d1ef6e74016fa7a09141c2099e6e46f7..bbcb337b629b2cfba38b11ca34fc3b5cfda9942e 100644 --- a/test/freeflow/navierstokes/channel/2d/main.cc +++ b/test/freeflow/navierstokes/channel/2d/main.cc @@ -43,7 +43,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokes/channel/2d/problem.hh b/test/freeflow/navierstokes/channel/2d/problem.hh index 2f2f2b5b2cf05d708c03dc9fca5f5700ef4bb367..90037005ae8af6a69440cc2c76d2e04ed4a58132 100644 --- a/test/freeflow/navierstokes/channel/2d/problem.hh +++ b/test/freeflow/navierstokes/channel/2d/problem.hh @@ -25,62 +25,16 @@ #ifndef DUMUX_CHANNEL_TEST_PROBLEM_HH #define DUMUX_CHANNEL_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/timeloop.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> -#include <dumux/material/components/constant.hh> -#include <dumux/material/components/simpleh2o.hh> - #include "../../l2error.hh" namespace Dumux { -template <class TypeTag> -class ChannelTestProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -#if !NONISOTHERMAL -struct ChannelTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -#else -struct ChannelTest { using InheritsFrom = std::tuple<NavierStokesNI, StaggeredFreeFlowModel>; }; -#endif -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::ChannelTest> -{ - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -#if NONISOTHERMAL - using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; -#else - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -#endif -}; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::ChannelTest> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::ChannelTest> { using type = Dumux::ChannelTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; -} // end namespace Properties /*! * \ingroup NavierStokesTests diff --git a/test/freeflow/navierstokes/channel/2d/properties.hh b/test/freeflow/navierstokes/channel/2d/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..79964d2f5ff4406ca0551d772dc9b71f58bb51e1 --- /dev/null +++ b/test/freeflow/navierstokes/channel/2d/properties.hh @@ -0,0 +1,79 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesTests + * \brief The properties of the channel flow test for the staggered grid (Navier-)Stokes model. + */ +#ifndef DUMUX_CHANNEL_TEST_PROPERTIES_HH +#define DUMUX_CHANNEL_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> +#include <dumux/material/components/constant.hh> +#include <dumux/material/components/simpleh2o.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +#if !NONISOTHERMAL +struct ChannelTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +#else +struct ChannelTest { using InheritsFrom = std::tuple<NavierStokesNI, StaggeredFreeFlowModel>; }; +#endif +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ChannelTest> +{ + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +#if NONISOTHERMAL + using type = FluidSystems::OnePLiquid<Scalar, Components::SimpleH2O<Scalar> >; +#else + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +#endif +}; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::ChannelTest> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::ChannelTest> { using type = Dumux::ChannelTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; + +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokes/channel/3d/main.cc b/test/freeflow/navierstokes/channel/3d/main.cc index f3103220bb7c8a17c750d1a654beab20bce6927f..bc41689723d955a234a1d0fabfdbb38a8605940b 100644 --- a/test/freeflow/navierstokes/channel/3d/main.cc +++ b/test/freeflow/navierstokes/channel/3d/main.cc @@ -44,7 +44,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokes/channel/3d/problem.hh b/test/freeflow/navierstokes/channel/3d/problem.hh index a00293bd2609fdb1d87333c996f5f142d108586a..94197e365f7e1b510f6227dbcb3def0199cdd89a 100644 --- a/test/freeflow/navierstokes/channel/3d/problem.hh +++ b/test/freeflow/navierstokes/channel/3d/problem.hh @@ -29,70 +29,18 @@ #define DUMUX_3D_CHANNEL_PROBLEM_HH #include <dune/common/float_cmp.hh> -#include <dune/grid/yaspgrid.hh> -#ifndef GRID_DIM -#define GRID_DIM 3 -#endif - -#if HAVE_DUNE_SUBGRID && GRID_DIM == 3 -#include <dune/subgrid/subgrid.hh> -#endif - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/constant.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> - -namespace Dumux { - -template <class TypeTag> -class ThreeDChannelTestProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct ThreeDChannelTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::ThreeDChannelTest> -{ - using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -}; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::ThreeDChannelTest> -{ - static constexpr int dim = GRID_DIM; - - using HostGrid = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, dim> >; - -#if HAVE_DUNE_SUBGRID && GRID_DIM == 3 - using type = Dune::SubGrid<HostGrid::dimension, HostGrid>; -#else - using type = HostGrid; +#ifndef GRID_DIM +#define GRID_DIM 3 #endif -}; -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::ThreeDChannelTest> { using type = ThreeDChannelTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; -} // end namespace Properties +namespace Dumux { /*! * \brief Test problem for the one-phase (Navier-) Stokes model in a 3D or pseudo 3D channel. diff --git a/test/freeflow/navierstokes/channel/3d/properties.hh b/test/freeflow/navierstokes/channel/3d/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..8a0e341762c58163a599c0fe8041c9f0aa22816b --- /dev/null +++ b/test/freeflow/navierstokes/channel/3d/properties.hh @@ -0,0 +1,83 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesTests + * \brief The properties for the channel flow test for the staggered grid (Navier-)Stokes model. + */ +#ifndef DUMUX_3D_CHANNEL_PROPERTIES_HH +#define DUMUX_3D_CHANNEL_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/material/components/constant.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> + +#include "problem.hh" + +#if HAVE_DUNE_SUBGRID && GRID_DIM == 3 +#include <dune/subgrid/subgrid.hh> +#endif + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct ThreeDChannelTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ThreeDChannelTest> +{ + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +}; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::ThreeDChannelTest> +{ + static constexpr int dim = GRID_DIM; + + using HostGrid = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, dim> >; + +#if HAVE_DUNE_SUBGRID && GRID_DIM == 3 + using type = Dune::SubGrid<HostGrid::dimension, HostGrid>; +#else + using type = HostGrid; +#endif +}; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::ThreeDChannelTest> { using type = ThreeDChannelTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ThreeDChannelTest> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokes/channel/pipe/problem.hh b/test/freeflow/navierstokes/channel/pipe/problem.hh index 21ed3446d619000aa3fa0012c0ab3a1f98095bb8..625a5389c671f42290440792de464b55531fccb1 100644 --- a/test/freeflow/navierstokes/channel/pipe/problem.hh +++ b/test/freeflow/navierstokes/channel/pipe/problem.hh @@ -22,6 +22,7 @@ #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> + #include <dumux/freeflow/navierstokes/problem.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> diff --git a/test/freeflow/navierstokes/channel/pipe/properties.hh b/test/freeflow/navierstokes/channel/pipe/properties.hh index 9de9fd669a60434776503b0032edda80fb845ef2..3f0bb9ef84e499be6fc2309011921c3107fd8ab3 100644 --- a/test/freeflow/navierstokes/channel/pipe/properties.hh +++ b/test/freeflow/navierstokes/channel/pipe/properties.hh @@ -16,14 +16,17 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ - +/*! + * \file + * \ingroup NavierStokesTests + * \brief the properties of the freeflow problem for pipe flow + * Simulation of a radially-symmetric pipe flow with circular cross-section + */ #ifndef DUMUX_TEST_FREEFLOW_PIPE_PROPERTIES_HH #define DUMUX_TEST_FREEFLOW_PIPE_PROPERTIES_HH #include <dune/grid/yaspgrid.hh> -#include <dumux/common/properties.hh> - #include <dumux/discretization/staggered/freeflow/properties.hh> #include <dumux/discretization/extrusion.hh> #include <dumux/freeflow/navierstokes/model.hh> diff --git a/test/freeflow/navierstokes/donea/main.cc b/test/freeflow/navierstokes/donea/main.cc index a42535a229a9768698ab7f369abba5a627fafd89..b0dffe48ad481716d9f99249d155251b8e034571 100644 --- a/test/freeflow/navierstokes/donea/main.cc +++ b/test/freeflow/navierstokes/donea/main.cc @@ -43,7 +43,7 @@ #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/nonlinear/staggerednewtonconvergencewriter.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokes/donea/problem.hh b/test/freeflow/navierstokes/donea/problem.hh index 571494ae925749cd0ded9af24d33d6bb6e11aa8c..5aeb0dba29939c606ed47d95138586e9c0c8520f 100644 --- a/test/freeflow/navierstokes/donea/problem.hh +++ b/test/freeflow/navierstokes/donea/problem.hh @@ -24,60 +24,15 @@ #ifndef DUMUX_DONEA_TEST_PROBLEM_HH #define DUMUX_DONEA_TEST_PROBLEM_HH -#ifndef ENABLECACHING -#define ENABLECACHING 0 -#endif - -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/constant.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> - #include "../l2error.hh" -namespace Dumux -{ -template <class TypeTag> -class DoneaTestProblem; - -namespace Properties -{ -// Create new type tags -namespace TTag { -struct DoneaTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::DoneaTest> -{ - using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -}; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::DoneaTest> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::DoneaTest> { using type = Dumux::DoneaTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; -template<class TypeTag> -struct EnableGridFaceVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; -} +namespace Dumux { /*! * \ingroup NavierStokesTests diff --git a/test/freeflow/navierstokes/donea/properties.hh b/test/freeflow/navierstokes/donea/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..8f79bf35ce472436f9d79577f436086b6d7cd14f --- /dev/null +++ b/test/freeflow/navierstokes/donea/properties.hh @@ -0,0 +1,74 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesTests + * \brief The properties of the test for the staggered grid (Navier-)Stokes model with analytical solution (Donea 2003, \cite Donea2003). + */ +#ifndef DUMUX_DONEA_TEST_PROPERTIES_HH +#define DUMUX_DONEA_TEST_PROPERTIES_HH + +#ifndef ENABLECACHING +#define ENABLECACHING 0 +#endif + +#include <dune/grid/yaspgrid.hh> +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/material/components/constant.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct DoneaTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DoneaTest> +{ + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +}; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::DoneaTest> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::DoneaTest> { using type = Dumux::DoneaTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFaceVariablesCache<TypeTag, TTag::DoneaTest> { static constexpr bool value = ENABLECACHING; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokes/kovasznay/main.cc b/test/freeflow/navierstokes/kovasznay/main.cc index 2d69bb0efceb39565684997b68cc89abd36ec21a..e0c81ef42e0dcf5744f6174d9a84445d545c4e35 100644 --- a/test/freeflow/navierstokes/kovasznay/main.cc +++ b/test/freeflow/navierstokes/kovasznay/main.cc @@ -44,7 +44,7 @@ #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/linear/linearsolvertraits.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokes/kovasznay/problem.hh b/test/freeflow/navierstokes/kovasznay/problem.hh index 8b2fbb74627fe78ddeb4cc0d3d2a1936bcb7d434..05f34ba24dee6c7fd410c437cad63d776d4a99fa 100644 --- a/test/freeflow/navierstokes/kovasznay/problem.hh +++ b/test/freeflow/navierstokes/kovasznay/problem.hh @@ -25,73 +25,15 @@ #ifndef DUMUX_KOVASZNAY_TEST_PROBLEM_HH #define DUMUX_KOVASZNAY_TEST_PROBLEM_HH -#ifndef UPWINDSCHEMEORDER -#define UPWINDSCHEMEORDER 0 -#endif - -#include <dune/grid/yaspgrid.hh> - -#if HAVE_DUNE_SUBGRID -#include <dune/subgrid/subgrid.hh> -#endif - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> -#include <dumux/material/components/constant.hh> - #include "../l2error.hh" namespace Dumux { -template <class TypeTag> -class KovasznayTestProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct KovasznayTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::KovasznayTest> -{ - using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -}; - -// Set the grid type -template<class TypeTag> -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> -struct Problem<TypeTag, TTag::KovasznayTest> { using type = Dumux::KovasznayTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; - -template<class TypeTag> -struct UpwindSchemeOrder<TypeTag, TTag::KovasznayTest> { static constexpr int value = UPWINDSCHEMEORDER; }; -} // end namespace Properties /*! * \ingroup NavierStokesTests diff --git a/test/freeflow/navierstokes/kovasznay/properties.hh b/test/freeflow/navierstokes/kovasznay/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..f7421c17400e7e2db744fccdb8211dea97e93c99 --- /dev/null +++ b/test/freeflow/navierstokes/kovasznay/properties.hh @@ -0,0 +1,88 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesTests + * \brief The properties of the test for the staggered grid Navier-Stokes model with analytical solution (Kovasznay 1948, \cite Kovasznay1948) + */ +#ifndef DUMUX_KOVASZNAY_TEST_PROPERTIES_HH +#define DUMUX_KOVASZNAY_TEST_PROPERTIES_HH + +#ifndef UPWINDSCHEMEORDER +#define UPWINDSCHEMEORDER 0 +#endif + +#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/model.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> +#include <dumux/material/components/constant.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct KovasznayTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::KovasznayTest> +{ + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +}; + +// Set the grid type +template<class TypeTag> +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> +struct Problem<TypeTag, TTag::KovasznayTest> { using type = Dumux::KovasznayTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::KovasznayTest> { static constexpr bool value = true; }; + +template<class TypeTag> +struct UpwindSchemeOrder<TypeTag, TTag::KovasznayTest> { static constexpr int value = UPWINDSCHEMEORDER; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokes/sincos/main.cc b/test/freeflow/navierstokes/sincos/main.cc index eb202fd4b13d6b19428cc188909f0a3ec644b879..8830ec2ba660aa97b39d10911167afe6351e2d1f 100644 --- a/test/freeflow/navierstokes/sincos/main.cc +++ b/test/freeflow/navierstokes/sincos/main.cc @@ -46,7 +46,7 @@ #include <dumux/linear/istlsolverfactorybackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" /*! * \brief Creates analytical solution. diff --git a/test/freeflow/navierstokes/sincos/problem.hh b/test/freeflow/navierstokes/sincos/problem.hh index 945b00247558b489f4a746104b36df1af28bc8d8..35544f55042d2356841e360fe2f4c9fceb9d0d93 100644 --- a/test/freeflow/navierstokes/sincos/problem.hh +++ b/test/freeflow/navierstokes/sincos/problem.hh @@ -19,60 +19,20 @@ /*! * \file * \ingroup NavierStokesTests - * \brief Test for the staggered grid Navier-Stokes model - * with analytical solution. + * \brief Test for the staggered grid Navier-Stokes model with analytical solution. */ #ifndef DUMUX_SINCOS_TEST_PROBLEM_HH #define DUMUX_SINCOS_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/constant.hh> -#include <dumux/material/fluidsystems/1pliquid.hh> - #include "../l2error.hh" namespace Dumux { -template <class TypeTag> -class SincosTestProblem; - -namespace Properties { -// Create new type tags -namespace TTag { -struct SincosTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::SincosTest> -{ -private: - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; -}; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::SincosTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::SincosTest> { using type = Dumux::SincosTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::SincosTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::SincosTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::SincosTest> { static constexpr bool value = true; }; -} // end namespace Properties /*! * \ingroup NavierStokesTests @@ -94,7 +54,6 @@ class SincosTestProblem : public NavierStokesProblem<TypeTag> using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>; using Scalar = GetPropType<TypeTag, Properties::Scalar>; using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>; - using TimeLoopPtr = std::shared_ptr<TimeLoop<Scalar>>; using SubControlVolume = typename GridGeometry::SubControlVolume; using FVElementGeometry = typename GridGeometry::LocalView; diff --git a/test/freeflow/navierstokes/sincos/properties.hh b/test/freeflow/navierstokes/sincos/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..5759a49f9226c04ddb750a917cb834d33efac9f5 --- /dev/null +++ b/test/freeflow/navierstokes/sincos/properties.hh @@ -0,0 +1,70 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesNCTests + * \brief The properties of the test for the staggered grid Navier-Stokes model with analytical solution. + */ +#ifndef DUMUX_SINCOS_TEST_PROPERTIES_HH +#define DUMUX_SINCOS_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/material/components/constant.hh> +#include <dumux/material/fluidsystems/1pliquid.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct SincosTest { using InheritsFrom = std::tuple<NavierStokes, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::SincosTest> +{ +private: + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = FluidSystems::OnePLiquid<Scalar, Components::Constant<1, Scalar> >; +}; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::SincosTest> { using type = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::SincosTest> { using type = Dumux::SincosTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::SincosTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::SincosTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::SincosTest> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokesnc/channel/main.cc b/test/freeflow/navierstokesnc/channel/main.cc index f2136767d4b6ab9be4ebad581ed7822afbcae49e..28e799b1064b86ceb110e7b4a5b7daedcde5b8dc 100644 --- a/test/freeflow/navierstokesnc/channel/main.cc +++ b/test/freeflow/navierstokesnc/channel/main.cc @@ -42,7 +42,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokesnc/channel/problem.hh b/test/freeflow/navierstokesnc/channel/problem.hh index cbafcdf5b02977e662a0da769d06bbea5929c143..0ab231674034b22609c268a396f17f4cfa40029c 100644 --- a/test/freeflow/navierstokesnc/channel/problem.hh +++ b/test/freeflow/navierstokesnc/channel/problem.hh @@ -25,77 +25,15 @@ #ifndef DUMUX_CHANNEL_NC_TEST_PROBLEM_HH #define DUMUX_CHANNEL_NC_TEST_PROBLEM_HH -#ifndef ENABLECACHING -#define ENABLECACHING 1 -#endif - -#include <dune/grid/yaspgrid.hh> - -#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/timeloop.hh> -#include <dumux/freeflow/compositional/navierstokesncmodel.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/simpleh2o.hh> -#include <dumux/material/fluidsystems/1padapter.hh> -#include <dumux/material/fluidsystems/h2oair.hh> - namespace Dumux { -template <class TypeTag> -class ChannelNCTestProblem; - -namespace Properties { - -// Create new type tags -namespace TTag { -#if !NONISOTHERMAL -struct ChannelNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; -#else -struct ChannelNCTest { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; -#endif -} // end namespace TTag - -// Select the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::ChannelNCTest> -{ - using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; - static constexpr int phaseIdx = H2OAir::liquidPhaseIdx; - using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; -}; - -template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::ChannelNCTest> { static constexpr int value = 0; }; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::ChannelNCTest> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::ChannelNCTest> { using type = Dumux::ChannelNCTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; -template<class TypeTag> -struct EnableGridFaceVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; - -// Use mole fraction formulation -#if USE_MASS -template<class TypeTag> -struct UseMoles<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = false; }; -#else -template<class TypeTag> -struct UseMoles<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = true; }; -#endif -} // end namespace Properties - /*! * \ingroup NavierStokesNCTests * \brief Test problem for the one-phase (Navier-)Stokes model. diff --git a/test/freeflow/navierstokesnc/channel/properties.hh b/test/freeflow/navierstokesnc/channel/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..67dd01c84bb53b0c0f8e6eeeea760cccf386caaf --- /dev/null +++ b/test/freeflow/navierstokesnc/channel/properties.hh @@ -0,0 +1,93 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesNCTests + * \brief The properties of the channel flow test for the multi-component staggered grid (Navier-)Stokes model. + */ +#ifndef DUMUX_CHANNEL_NC_TEST_PROPERTIES_HH +#define DUMUX_CHANNEL_NC_TEST_PROPERTIES_HH + +#ifndef ENABLECACHING +#define ENABLECACHING 1 +#endif + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/compositional/navierstokesncmodel.hh> +#include <dumux/material/components/simpleh2o.hh> +#include <dumux/material/fluidsystems/1padapter.hh> +#include <dumux/material/fluidsystems/h2oair.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +#if !NONISOTHERMAL +struct ChannelNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +#else +struct ChannelNCTest { using InheritsFrom = std::tuple<NavierStokesNCNI, StaggeredFreeFlowModel>; }; +#endif +} // end namespace TTag + +// Select the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::ChannelNCTest> +{ + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; + static constexpr int phaseIdx = H2OAir::liquidPhaseIdx; + using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; +}; + +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::ChannelNCTest> { static constexpr int value = 0; }; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::ChannelNCTest> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::ChannelNCTest> { using type = Dumux::ChannelNCTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; +template<class TypeTag> +struct EnableGridFaceVariablesCache<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = ENABLECACHING; }; + +// Use mole fraction formulation +#if USE_MASS +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = false; }; +#else +template<class TypeTag> +struct UseMoles<TypeTag, TTag::ChannelNCTest> { static constexpr bool value = true; }; +#endif + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/main.cc b/test/freeflow/navierstokesnc/densitydrivenflow/main.cc index 7b35716685649a014a3793fbacbddc62b6e8fabd..0f595dbe68f12e3c0bda9b8189322e2fd9a6e90d 100644 --- a/test/freeflow/navierstokesnc/densitydrivenflow/main.cc +++ b/test/freeflow/navierstokesnc/densitydrivenflow/main.cc @@ -42,7 +42,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh b/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh index ffe06166be7602f866727aef48d94e9110710a5f..c164124af1410040d5805b232f1506000e89be10 100644 --- a/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh +++ b/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh @@ -25,62 +25,14 @@ #ifndef DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH #define DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> -#include <dumux/discretization/staggered/freeflow/properties.hh> - -#include <dumux/freeflow/compositional/navierstokesncmodel.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> #include <dumux/freeflow/navierstokes/problem.hh> -#include <dumux/material/components/simpleh2o.hh> -#include <dumux/material/fluidsystems/1padapter.hh> -#include <dumux/material/fluidsystems/h2oair.hh> - namespace Dumux { -template <class TypeTag> -class DensityDrivenFlowProblem; - -namespace Properties { - -// Create new type tags -namespace TTag { -struct DensityDrivenFlow { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -// Select the fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::DensityDrivenFlow> -{ - using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; - static constexpr int phaseIdx = H2OAir::liquidPhaseIdx; - using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; -}; - -template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::DensityDrivenFlow> { static constexpr int value = 0; }; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::DensityDrivenFlow> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::DensityDrivenFlow> { using type = Dumux::DensityDrivenFlowProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; - -template<class TypeTag> -struct UseMoles<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; -} // end namespace Properties - /*! * \ingroup NavierStokesNCTests * \brief Test problem for the one-phase model. @@ -108,8 +60,6 @@ class DensityDrivenFlowProblem : public NavierStokesProblem<TypeTag> using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>; - static constexpr auto dimWorld = GridGeometry::GridView::dimensionworld; static constexpr auto transportCompIdx = Indices::conti0EqIdx + 1; diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/properties.hh b/test/freeflow/navierstokesnc/densitydrivenflow/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..8f5eb1da330b94455ccd03b82539f7618b60bf5d --- /dev/null +++ b/test/freeflow/navierstokesnc/densitydrivenflow/properties.hh @@ -0,0 +1,77 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesNCTests + * \brief The properties of the test for the compositional staggered grid (Navier-)Stokes model. + */ +#ifndef DUMUX_DENSITY_FLOW_NC_TEST_PROPERTIES_HH +#define DUMUX_DENSITY_FLOW_NC_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/compositional/navierstokesncmodel.hh> +#include <dumux/material/components/simpleh2o.hh> +#include <dumux/material/fluidsystems/1padapter.hh> +#include <dumux/material/fluidsystems/h2oair.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct DensityDrivenFlow { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +// Select the fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::DensityDrivenFlow> +{ + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; + static constexpr int phaseIdx = H2OAir::liquidPhaseIdx; + using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; +}; + +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::DensityDrivenFlow> { static constexpr int value = 0; }; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::DensityDrivenFlow> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::DensityDrivenFlow> { using type = Dumux::DensityDrivenFlowProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; + +template<class TypeTag> +struct UseMoles<TypeTag, TTag::DensityDrivenFlow> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/navierstokesnc/maxwellstefan/main.cc b/test/freeflow/navierstokesnc/maxwellstefan/main.cc index 646c2719e62d0abbc79215fb87a15fdb0b7f1dd0..a9348bc5ed2f7b367951775ce7b58af98dd06e66 100644 --- a/test/freeflow/navierstokesnc/maxwellstefan/main.cc +++ b/test/freeflow/navierstokesnc/maxwellstefan/main.cc @@ -42,7 +42,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" int main(int argc, char** argv) { diff --git a/test/freeflow/navierstokesnc/maxwellstefan/problem.hh b/test/freeflow/navierstokesnc/maxwellstefan/problem.hh index 3a00d4ffd7b5815bf6489d3fe6970be254634c56..d1579df240d710743315edf1885282fe4813295a 100644 --- a/test/freeflow/navierstokesnc/maxwellstefan/problem.hh +++ b/test/freeflow/navierstokesnc/maxwellstefan/problem.hh @@ -25,181 +25,15 @@ #ifndef DUMUX_CHANNEL_MAXWELL_STEFAN_TEST_PROBLEM_HH #define DUMUX_CHANNEL_MAXWELL_STEFAN_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> -#include <dumux/discretization/staggered/freeflow/properties.hh> - -#include <dumux/flux/maxwellstefanslaw.hh> - -#include <dumux/freeflow/compositional/navierstokesncmodel.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> #include <dumux/freeflow/navierstokes/problem.hh> #include <dumux/io/gnuplotinterface.hh> -#include <dumux/material/components/simpleh2o.hh> -#include <dumux/material/fluidsystems/h2oair.hh> - - namespace Dumux { -template <class TypeTag> -class MaxwellStefanNCTestProblem; - -namespace Properties { - -// Create new type tags -namespace TTag { -struct MaxwellStefanNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; -} // end namespace TTag - -template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr int value = 0; }; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::MaxwellStefanNCTest> { using type = Dune::YaspGrid<2>; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::MaxwellStefanNCTest> { using type = Dumux::MaxwellStefanNCTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; - -template<class TypeTag> -struct UseMoles<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; - - -//! Here we set FicksLaw or MaxwellStefansLaw -template<class TypeTag> -struct MolecularDiffusionType<TypeTag, TTag::MaxwellStefanNCTest> { using type = MaxwellStefansLaw<TypeTag>; }; - - -/*! - * \ingroup NavierStokesNCTests - * \brief A simple fluid system with three components for testing the multi-component diffusion with the Maxwell-Stefan formulation. - */ -template<class TypeTag> -class MaxwellStefanFluidSystem -: public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, MaxwellStefanFluidSystem<TypeTag>> - -{ - using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using ThisType = MaxwellStefanFluidSystem<TypeTag>; - using Base = FluidSystems::Base<Scalar, ThisType>; - -public: - //! The number of phases - static constexpr int numPhases = 1; - static constexpr int numComponents = 3; - - static constexpr int H2Idx = 0;//first major component - static constexpr int N2Idx = 1;//second major component - static constexpr int CO2Idx = 2;//secondary component - - //! Human readable component name (index compIdx) (for vtk output) - static std::string componentName(int compIdx) - { return "MaxwellStefan_" + std::to_string(compIdx); } - - //! Human readable phase name (index phaseIdx) (for velocity vtk output) - static std::string phaseName(int phaseIdx = 0) - { return "Gas"; } - - //! Molar mass in kg/mol of the component with index compIdx - static Scalar molarMass(unsigned int compIdx) - { return 0.02896; } - - - using Base::binaryDiffusionCoefficient; - /*! - * \brief Given a phase's composition, temperature and pressure, - * returns the binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for components - * \f$i\f$ and \f$j\f$ in this phase. - * - * \param fluidState An arbitrary fluid state - * \param phaseIdx The index of the fluid phase to consider - * \param compIIdx The index of the first component to consider - * \param compJIdx The index of the second component to consider - */ - template <class FluidState> - static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, - int phaseIdx, - int compIIdx, - int compJIdx) - { - if (compIIdx > compJIdx) - { - using std::swap; - swap(compIIdx, compJIdx); - } - - if (compIIdx == H2Idx && compJIdx == N2Idx) - return 83.3e-6; - if (compIIdx == H2Idx && compJIdx == CO2Idx) - return 68.0e-6; - if (compIIdx == N2Idx && compJIdx == CO2Idx) - return 16.8e-6; - DUNE_THROW(Dune::InvalidStateException, - "Binary diffusion coefficient of components " - << compIIdx << " and " << compJIdx << " is undefined!\n"); - } - using Base::density; - /*! - * \brief Given a phase's composition, temperature, pressure, and - * the partial pressures of all components, returns its - * density \f$\mathrm{[kg/m^3]}\f$. - * - * \param phaseIdx index of the phase - * \param fluidState the fluid state - * - */ - template <class FluidState> - static Scalar density(const FluidState &fluidState, - const int phaseIdx) - { - return 1; - } - - using Base::viscosity; - /*! - * \brief Calculates the dynamic viscosity of a fluid phase \f$\mathrm{[Pa*s]}\f$ - * - * \param fluidState An arbitrary fluid state - * \param phaseIdx The index of the fluid phase to consider - */ - template <class FluidState> - static Scalar viscosity(const FluidState &fluidState, - int phaseIdx) - { - return 1e-6; - } - - using Base::molarDensity; - /*! - * \brief The molar density \f$\rho_{mol,\alpha}\f$ - * of a fluid phase \f$\alpha\f$ in \f$\mathrm{[mol/m^3]}\f$ - * - * The molar density for the simple relation is defined by the - * mass density \f$\rho_\alpha\f$ and the molar mass of the main component \f$M_\kappa\f$: - * - * \f[\rho_{mol,\alpha} = \frac{\rho_\alpha}{M_\kappa} \;.\f] - */ - template <class FluidState> - static Scalar molarDensity(const FluidState &fluidState, int phaseIdx) - { - return density(fluidState, phaseIdx)/molarMass(0); - } -}; - -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::MaxwellStefanNCTest> { using type = MaxwellStefanFluidSystem<TypeTag>; }; - -} // end namespace Properties /*! * \ingroup NavierStokesNCTests @@ -221,8 +55,6 @@ class MaxwellStefanNCTestProblem : public NavierStokesProblem<TypeTag> using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using TimeLoopPtr = std::shared_ptr<CheckPointTimeLoop<Scalar>>; - static constexpr auto compOneIdx = Indices::conti0EqIdx; static constexpr auto compTwoIdx = Indices::conti0EqIdx + FluidSystem::N2Idx; static constexpr auto compThreeIdx = Indices::conti0EqIdx + FluidSystem::CO2Idx; diff --git a/test/freeflow/navierstokesnc/maxwellstefan/properties.hh b/test/freeflow/navierstokesnc/maxwellstefan/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..23aff3b95d86c3f5d34d6348a596fb0ae28dd3c2 --- /dev/null +++ b/test/freeflow/navierstokesnc/maxwellstefan/properties.hh @@ -0,0 +1,193 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesNCTests + * \brief The properties of the channel flow test for the multi-component staggered grid (Navier-)Stokes model. + */ +#ifndef DUMUX_CHANNEL_MAXWELL_STEPHAN_TEST_PROPERTIES_HH +#define DUMUX_CHANNEL_MAXWELL_STEPHAN_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/flux/maxwellstefanslaw.hh> + +#include <dumux/freeflow/compositional/navierstokesncmodel.hh> +#include <dumux/material/components/simpleh2o.hh> +#include <dumux/material/fluidsystems/h2oair.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct MaxwellStefanNCTest { using InheritsFrom = std::tuple<NavierStokesNC, StaggeredFreeFlowModel>; }; +} // end namespace TTag + +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr int value = 0; }; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::MaxwellStefanNCTest> { using type = Dune::YaspGrid<2>; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::MaxwellStefanNCTest> { using type = Dumux::MaxwellStefanNCTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; + +template<class TypeTag> +struct UseMoles<TypeTag, TTag::MaxwellStefanNCTest> { static constexpr bool value = true; }; + +//! Here we set FicksLaw or MaxwellStefansLaw +template<class TypeTag> +struct MolecularDiffusionType<TypeTag, TTag::MaxwellStefanNCTest> { using type = MaxwellStefansLaw<TypeTag>; }; + + +/*! + * \ingroup NavierStokesNCTests + * \brief A simple fluid system with three components for testing the multi-component diffusion with the Maxwell-Stefan formulation. + */ +template<class TypeTag> +class MaxwellStefanFluidSystem +: public FluidSystems::Base<GetPropType<TypeTag, Properties::Scalar>, MaxwellStefanFluidSystem<TypeTag>> + +{ + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using ThisType = MaxwellStefanFluidSystem<TypeTag>; + using Base = FluidSystems::Base<Scalar, ThisType>; + +public: + //! The number of phases + static constexpr int numPhases = 1; + static constexpr int numComponents = 3; + + static constexpr int H2Idx = 0;//first major component + static constexpr int N2Idx = 1;//second major component + static constexpr int CO2Idx = 2;//secondary component + + //! Human readable component name (index compIdx) (for vtk output) + static std::string componentName(int compIdx) + { return "MaxwellStefan_" + std::to_string(compIdx); } + + //! Human readable phase name (index phaseIdx) (for velocity vtk output) + static std::string phaseName(int phaseIdx = 0) + { return "Gas"; } + + //! Molar mass in kg/mol of the component with index compIdx + static Scalar molarMass(unsigned int compIdx) + { return 0.02896; } + + + using Base::binaryDiffusionCoefficient; + /*! + * \brief Given a phase's composition, temperature and pressure, + * returns the binary diffusion coefficient \f$\mathrm{[m^2/s]}\f$ for components + * \f$i\f$ and \f$j\f$ in this phase. + * + * \param fluidState An arbitrary fluid state + * \param phaseIdx The index of the fluid phase to consider + * \param compIIdx The index of the first component to consider + * \param compJIdx The index of the second component to consider + */ + template <class FluidState> + static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, + int phaseIdx, + int compIIdx, + int compJIdx) + { + if (compIIdx > compJIdx) + { + using std::swap; + swap(compIIdx, compJIdx); + } + + if (compIIdx == H2Idx && compJIdx == N2Idx) + return 83.3e-6; + if (compIIdx == H2Idx && compJIdx == CO2Idx) + return 68.0e-6; + if (compIIdx == N2Idx && compJIdx == CO2Idx) + return 16.8e-6; + DUNE_THROW(Dune::InvalidStateException, + "Binary diffusion coefficient of components " + << compIIdx << " and " << compJIdx << " is undefined!\n"); + } + using Base::density; + /*! + * \brief Given a phase's composition, temperature, pressure, and + * the partial pressures of all components, returns its + * density \f$\mathrm{[kg/m^3]}\f$. + * + * \param phaseIdx index of the phase + * \param fluidState the fluid state + * + */ + template <class FluidState> + static Scalar density(const FluidState &fluidState, + const int phaseIdx) + { + return 1; + } + + using Base::viscosity; + /*! + * \brief Calculates the dynamic viscosity of a fluid phase \f$\mathrm{[Pa*s]}\f$ + * + * \param fluidState An arbitrary fluid state + * \param phaseIdx The index of the fluid phase to consider + */ + template <class FluidState> + static Scalar viscosity(const FluidState &fluidState, + int phaseIdx) + { + return 1e-6; + } + + using Base::molarDensity; + /*! + * \brief The molar density \f$\rho_{mol,\alpha}\f$ + * of a fluid phase \f$\alpha\f$ in \f$\mathrm{[mol/m^3]}\f$ + * + * The molar density for the simple relation is defined by the + * mass density \f$\rho_\alpha\f$ and the molar mass of the main component \f$M_\kappa\f$: + * + * \f[\rho_{mol,\alpha} = \frac{\rho_\alpha}{M_\kappa} \;.\f] + */ + template <class FluidState> + static Scalar molarDensity(const FluidState &fluidState, int phaseIdx) + { + return density(fluidState, phaseIdx)/molarMass(0); + } +}; + +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::MaxwellStefanNCTest> { using type = MaxwellStefanFluidSystem<TypeTag>; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/rans/problem.hh b/test/freeflow/rans/problem.hh index 70fd9bfba8a55d1c748bd2b0b366ca13a10beb0e..43e2c0504a30b2056a9ed35955b2acbcace5f347 100644 --- a/test/freeflow/rans/problem.hh +++ b/test/freeflow/rans/problem.hh @@ -28,6 +28,9 @@ #define DUMUX_PIPE_LAUFER_PROBLEM_HH #include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/timeloop.hh> + #include <dumux/freeflow/navierstokes/boundarytypes.hh> #include <dumux/freeflow/rans/problem.hh> #include <dumux/freeflow/turbulencemodel.hh> diff --git a/test/freeflow/rans/properties.hh b/test/freeflow/rans/properties.hh index da4473d01cb2e4e56c0b7d99796ad8899c8fbd9c..f151b115689b2d6e38b5098e77996a81e2e69dae 100644 --- a/test/freeflow/rans/properties.hh +++ b/test/freeflow/rans/properties.hh @@ -93,6 +93,7 @@ template<class TypeTag> struct EnableGridFluxVariablesCache<TypeTag, TTag::RANSModel> { static constexpr bool value = true; }; template<class TypeTag> struct EnableGridVolumeVariablesCache<TypeTag, TTag::RANSModel> { static constexpr bool value = true; }; + } // end namespace Dumux::Properties #endif diff --git a/test/freeflow/ransnc/main.cc b/test/freeflow/ransnc/main.cc index f880e7b7261fdc86445408f83eeaa0e82988aff7..9b55db443ebe2951afbc919d545db07956150538 100644 --- a/test/freeflow/ransnc/main.cc +++ b/test/freeflow/ransnc/main.cc @@ -43,7 +43,7 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include "problem.hh" +#include "properties.hh" /*! * \brief Provides an interface for customizing error messages associated with diff --git a/test/freeflow/ransnc/problem.hh b/test/freeflow/ransnc/problem.hh index 0fda6c53714613394d5f8f02330db89276971512..65988823be183bd228d9175811c367ced9672cbd 100644 --- a/test/freeflow/ransnc/problem.hh +++ b/test/freeflow/ransnc/problem.hh @@ -24,89 +24,20 @@ #ifndef DUMUX_RANS_NC_TEST_PROBLEM_HH #define DUMUX_RANS_NC_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/timeloop.hh> #include <dumux/freeflow/navierstokes/boundarytypes.hh> -#include <dumux/discretization/staggered/freeflow/properties.hh> - #include <dumux/freeflow/turbulenceproperties.hh> - #include <dumux/freeflow/rans/zeroeq/problem.hh> -#include <dumux/freeflow/compositional/zeroeqncmodel.hh> - #include <dumux/freeflow/rans/oneeq/problem.hh> -#include <dumux/freeflow/compositional/oneeqncmodel.hh> - #include <dumux/freeflow/rans/twoeq/komega/problem.hh> -#include <dumux/freeflow/compositional/komegancmodel.hh> - #include <dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh> -#include <dumux/freeflow/compositional/lowrekepsilonncmodel.hh> - #include <dumux/freeflow/rans/twoeq/kepsilon/problem.hh> -#include <dumux/freeflow/compositional/kepsilonncmodel.hh> - -#include <dumux/material/fluidsystems/1padapter.hh> -#include <dumux/material/fluidsystems/h2oair.hh> namespace Dumux { -template <class TypeTag> -class FlatPlateNCTestProblem; - -namespace Properties { - -// Create new type tags -namespace TTag { -// Base Typetag -struct RANSNCModel { using InheritsFrom = std::tuple<StaggeredFreeFlowModel>; }; -// Isothermal Typetags -struct FlatPlateNCZeroEq { using InheritsFrom = std::tuple<RANSNCModel, ZeroEqNC>; }; -struct FlatPlateNCOneEq { using InheritsFrom = std::tuple<RANSNCModel, OneEqNC>; }; -struct FlatPlateNCKOmega { using InheritsFrom = std::tuple<RANSNCModel, KOmegaNC>; }; -struct FlatPlateNCLowReKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, LowReKEpsilonNC>; }; -struct FlatPlateNCKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, KEpsilonNC>; }; -// Isothermal Typetags -struct FlatPlateNCNIZeroEq { using InheritsFrom = std::tuple<RANSNCModel, ZeroEqNCNI>; }; -struct FlatPlateNCNIOneEq { using InheritsFrom = std::tuple<RANSNCModel, OneEqNCNI>; }; -struct FlatPlateNCNIKOmega { using InheritsFrom = std::tuple<RANSNCModel, KOmegaNCNI>; }; -struct FlatPlateNCNILowReKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, LowReKEpsilonNCNI>; }; -struct FlatPlateNCNIKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, KEpsilonNCNI>; }; -} // end namespace TTag - -// The fluid system -template<class TypeTag> -struct FluidSystem<TypeTag, TTag::RANSNCModel> -{ - using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; - static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase - using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; -}; - -// replace the main component balance eq with a total balance eq -template<class TypeTag> -struct ReplaceCompEqIdx<TypeTag, TTag::RANSNCModel> { static constexpr int value = 0; }; - -// Set the grid type -template<class TypeTag> -struct Grid<TypeTag, TTag::RANSNCModel> -{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::RANSNCModel> { using type = Dumux::FlatPlateNCTestProblem<TypeTag> ; }; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; - -template<class TypeTag> -struct UseMoles<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; -} // end namespace Properties - /*! * \ingroup RANSNCTests * \brief Test problem for the one-phase model. diff --git a/test/freeflow/ransnc/properties.hh b/test/freeflow/ransnc/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..fc161ddd7b8b24f7c209a8a269ccf9f47dad9f68 --- /dev/null +++ b/test/freeflow/ransnc/properties.hh @@ -0,0 +1,95 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup RANSNCTests + * \brief The properties of the flat plate test for the multi-component staggered grid Reynolds-averaged Navier-Stokes model. + */ +#ifndef DUMUX_RANS_NC_TEST_PROPERTIES_HH +#define DUMUX_RANS_NC_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> +#include <dumux/discretization/staggered/freeflow/properties.hh> + +#include <dumux/freeflow/compositional/zeroeqncmodel.hh> +#include <dumux/freeflow/compositional/oneeqncmodel.hh> +#include <dumux/freeflow/compositional/komegancmodel.hh> +#include <dumux/freeflow/compositional/lowrekepsilonncmodel.hh> +#include <dumux/freeflow/compositional/kepsilonncmodel.hh> + +#include <dumux/material/fluidsystems/1padapter.hh> +#include <dumux/material/fluidsystems/h2oair.hh> + +#include "problem.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +// Base Typetag +struct RANSNCModel { using InheritsFrom = std::tuple<StaggeredFreeFlowModel>; }; +// Isothermal Typetags +struct FlatPlateNCZeroEq { using InheritsFrom = std::tuple<RANSNCModel, ZeroEqNC>; }; +struct FlatPlateNCOneEq { using InheritsFrom = std::tuple<RANSNCModel, OneEqNC>; }; +struct FlatPlateNCKOmega { using InheritsFrom = std::tuple<RANSNCModel, KOmegaNC>; }; +struct FlatPlateNCLowReKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, LowReKEpsilonNC>; }; +struct FlatPlateNCKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, KEpsilonNC>; }; +// Isothermal Typetags +struct FlatPlateNCNIZeroEq { using InheritsFrom = std::tuple<RANSNCModel, ZeroEqNCNI>; }; +struct FlatPlateNCNIOneEq { using InheritsFrom = std::tuple<RANSNCModel, OneEqNCNI>; }; +struct FlatPlateNCNIKOmega { using InheritsFrom = std::tuple<RANSNCModel, KOmegaNCNI>; }; +struct FlatPlateNCNILowReKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, LowReKEpsilonNCNI>; }; +struct FlatPlateNCNIKEpsilon { using InheritsFrom = std::tuple<RANSNCModel, KEpsilonNCNI>; }; +} // end namespace TTag + +// The fluid system +template<class TypeTag> +struct FluidSystem<TypeTag, TTag::RANSNCModel> +{ + using H2OAir = FluidSystems::H2OAir<GetPropType<TypeTag, Properties::Scalar>>; + static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase + using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; +}; + +// replace the main component balance eq with a total balance eq +template<class TypeTag> +struct ReplaceCompEqIdx<TypeTag, TTag::RANSNCModel> { static constexpr int value = 0; }; + +// Set the grid type +template<class TypeTag> +struct Grid<TypeTag, TTag::RANSNCModel> +{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::RANSNCModel> { using type = Dumux::FlatPlateNCTestProblem<TypeTag> ; }; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; + +template<class TypeTag> +struct UseMoles<TypeTag, TTag::RANSNCModel> { static constexpr bool value = true; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/shallowwater/bowl/main.cc b/test/freeflow/shallowwater/bowl/main.cc index 6f18181f5bc9c7beb006c9eb2ec496c5d83c3d86..f777814f217e692d69ac1428d126046b11358e74 100644 --- a/test/freeflow/shallowwater/bowl/main.cc +++ b/test/freeflow/shallowwater/bowl/main.cc @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * diff --git a/test/freeflow/shallowwater/bowl/problem.hh b/test/freeflow/shallowwater/bowl/problem.hh index bb8b737f57287162f4a4c7c70740e765259fc8c6..f9ca2b3450a11b40b6fab07c720201e51a8514a8 100644 --- a/test/freeflow/shallowwater/bowl/problem.hh +++ b/test/freeflow/shallowwater/bowl/problem.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * @@ -25,6 +25,9 @@ #define DUMUX_BOWL_TEST_PROBLEM_HH #include <dumux/common/boundarytypes.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> + #include <dumux/freeflow/shallowwater/problem.hh> #include <dumux/freeflow/shallowwater/boundaryfluxes.hh> diff --git a/test/freeflow/shallowwater/bowl/properties.hh b/test/freeflow/shallowwater/bowl/properties.hh index 68a91568151edabc0ed4fe24bafff13e680eb1c3..ced852d5e4e758f8ad0c0613aad22c945b1dccff 100644 --- a/test/freeflow/shallowwater/bowl/properties.hh +++ b/test/freeflow/shallowwater/bowl/properties.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * @@ -18,6 +18,7 @@ *****************************************************************************/ /*! * \file + * \ingroup ShallowWaterTests * \brief The properties for the shallow water bowl test */ #ifndef DUMUX_BOWL_TEST_PROPERTIES_HH @@ -25,7 +26,6 @@ #include <dune/grid/yaspgrid.hh> #include <dumux/discretization/cctpfa.hh> -#include <dumux/common/properties.hh> #include <dumux/freeflow/shallowwater/model.hh> #include "spatialparams.hh" diff --git a/test/freeflow/shallowwater/bowl/spatialparams.hh b/test/freeflow/shallowwater/bowl/spatialparams.hh index 916ce70ab0983c65a152fb5b088554e64e40a28a..e86024572b71bf7c600119bf4cb0842cd333124a 100644 --- a/test/freeflow/shallowwater/bowl/spatialparams.hh +++ b/test/freeflow/shallowwater/bowl/spatialparams.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * diff --git a/test/freeflow/shallowwater/dambreak/main.cc b/test/freeflow/shallowwater/dambreak/main.cc index efadb1b1bb31d805f089aa0962bfa8a919a8e088..7755ceefac4cc759859221cc8d0d2b62cb5fb773 100644 --- a/test/freeflow/shallowwater/dambreak/main.cc +++ b/test/freeflow/shallowwater/dambreak/main.cc @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * @@ -52,7 +52,7 @@ #include <dumux/assembly/fvassembler.hh> -#include "problem.hh" +#include "properties.hh" //////////////////////// // the main function diff --git a/test/freeflow/shallowwater/dambreak/problem.hh b/test/freeflow/shallowwater/dambreak/problem.hh index 85ccde626393128547625fba14699ef58d5e0555..b2410f315a740e1204cd32346033e8b047c68a25 100644 --- a/test/freeflow/shallowwater/dambreak/problem.hh +++ b/test/freeflow/shallowwater/dambreak/problem.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * @@ -24,12 +24,10 @@ #ifndef DUMUX_DAM_BREAK_TEST_PROBLEM_HH #define DUMUX_DAM_BREAK_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> -#include <dumux/discretization/cctpfa.hh> -#include "spatialparams.hh" - #include <dumux/common/boundarytypes.hh> -#include <dumux/freeflow/shallowwater/model.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> + #include <dumux/freeflow/shallowwater/problem.hh> #include <dumux/flux/shallowwater/riemannproblem.hh> #include <dumux/flux/shallowwater/exactriemann.hh> @@ -40,52 +38,6 @@ namespace Dumux { * \ingroup ShallowWaterTests * \brief A simple dam break test for the shallow water equations */ -template <class TypeTag> -class DamBreakProblem; - - -// Specify the properties for the problem -namespace Properties { - -// Create new type tags -namespace TTag { -struct DamBreakWet { using InheritsFrom = std::tuple<ShallowWater, CCTpfaModel>; }; -} // end namespace TTag - -template<class TypeTag> -struct Grid<TypeTag, TTag::DamBreakWet> -{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::DamBreakWet> -{ using type = Dumux::DamBreakProblem<TypeTag>; }; - -// Set the spatial parameters -template<class TypeTag> -struct SpatialParams<TypeTag, TTag::DamBreakWet> -{ -private: - using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - using Scalar = GetPropType<TypeTag, Properties::Scalar>; -public: - using type = DamBreakSpatialParams<GridGeometry, Scalar>; -}; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::DamBreakWet> -{ static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::DamBreakWet> -{ static constexpr bool value = false; }; - -template<class TypeTag> -struct EnableGridFluxVariablesCache<TypeTag, TTag::DamBreakWet> -{ static constexpr bool value = false; }; - -} // end namespace Properties - /*! * \ingroup Shallow water equations model diff --git a/test/freeflow/shallowwater/dambreak/properties.hh b/test/freeflow/shallowwater/dambreak/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..08d15a526072672239eb2ebdfe1e6bb9f544d5a3 --- /dev/null +++ b/test/freeflow/shallowwater/dambreak/properties.hh @@ -0,0 +1,76 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup ShallowWaterTests + * \brief The properties of the test for the Shallow water model (wet dam break). + */ +#ifndef DUMUX_DAM_BREAK_TEST_PROPERTIES_HH +#define DUMUX_DAM_BREAK_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> + +#include <dumux/discretization/cctpfa.hh> +#include <dumux/freeflow/shallowwater/model.hh> + +#include "problem.hh" +#include "spatialparams.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct DamBreakWet { using InheritsFrom = std::tuple<ShallowWater, CCTpfaModel>; }; +} // end namespace TTag + +template<class TypeTag> +struct Grid<TypeTag, TTag::DamBreakWet> +{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::DamBreakWet> +{ using type = Dumux::DamBreakProblem<TypeTag>; }; + +// Set the spatial parameters +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::DamBreakWet> +{ +private: + using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; +public: + using type = DamBreakSpatialParams<GridGeometry, Scalar>; +}; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::DamBreakWet> +{ static constexpr bool value = true; }; + +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::DamBreakWet> +{ static constexpr bool value = false; }; + +template<class TypeTag> +struct EnableGridFluxVariablesCache<TypeTag, TTag::DamBreakWet> +{ static constexpr bool value = false; }; + +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/shallowwater/dambreak/spatialparams.hh b/test/freeflow/shallowwater/dambreak/spatialparams.hh index 8b2a832b309a36d01c04652eb7b8c58a5b4b6ec0..9fe370fc88bd0ae004dad9c8fd54ec487f2a335c 100644 --- a/test/freeflow/shallowwater/dambreak/spatialparams.hh +++ b/test/freeflow/shallowwater/dambreak/spatialparams.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * diff --git a/test/freeflow/shallowwater/poiseuilleflow/problem.hh b/test/freeflow/shallowwater/poiseuilleflow/problem.hh index 5becbc7e0fc06c4c08c24ffa348755d00d4a9d64..55f3d4aead52e71b239b210cf7926d29cd2c8752 100644 --- a/test/freeflow/shallowwater/poiseuilleflow/problem.hh +++ b/test/freeflow/shallowwater/poiseuilleflow/problem.hh @@ -20,14 +20,15 @@ #ifndef DUMUX_POISEUILLE_FLOW_TEST_PROBLEM_HH #define DUMUX_POISEUILLE_FLOW_TEST_PROBLEM_HH +#include <algorithm> +#include <cctype> + #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> + #include <dumux/freeflow/shallowwater/problem.hh> #include <dumux/freeflow/shallowwater/boundaryfluxes.hh> -#include <algorithm> -#include <cctype> - namespace Dumux { /*! diff --git a/test/freeflow/shallowwater/poiseuilleflow/properties.hh b/test/freeflow/shallowwater/poiseuilleflow/properties.hh index 75ac8c8e18c04568ccc8bc4e4b20cf76e94145d9..3b919b83ddcc4a23a3ef270ad6cf9a3f63bd1ec5 100644 --- a/test/freeflow/shallowwater/poiseuilleflow/properties.hh +++ b/test/freeflow/shallowwater/poiseuilleflow/properties.hh @@ -20,7 +20,6 @@ #ifndef DUMUX_POISEUILLE_FLOW_TEST_PROPERTIES_HH #define DUMUX_POISEUILLE_FLOW_TEST_PROPERTIES_HH -#include <dumux/common/properties.hh> #include <dumux/freeflow/shallowwater/model.hh> #include <dumux/discretization/cctpfa.hh> #include <dune/grid/yaspgrid.hh> diff --git a/test/freeflow/shallowwater/roughchannel/main.cc b/test/freeflow/shallowwater/roughchannel/main.cc index 8e5a9b053835e0a59c782cd41095ee416604afb1..3976a282c3a6025080b4b2c0fab4b80bc2229425 100644 --- a/test/freeflow/shallowwater/roughchannel/main.cc +++ b/test/freeflow/shallowwater/roughchannel/main.cc @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * @@ -42,7 +42,7 @@ #include <dumux/assembly/fvassembler.hh> -#include "problem.hh" +#include "properties.hh" //////////////////////// // the main function diff --git a/test/freeflow/shallowwater/roughchannel/problem.hh b/test/freeflow/shallowwater/roughchannel/problem.hh index e6a93babb51117ef1fa5ed91ce28a9c286c51353..b4d4f6e4e2641340043916645be2ab1f78a3766b 100644 --- a/test/freeflow/shallowwater/roughchannel/problem.hh +++ b/test/freeflow/shallowwater/roughchannel/problem.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * @@ -24,60 +24,15 @@ #ifndef DUMUX_ROUGH_CHANNEL_TEST_PROBLEM_HH #define DUMUX_ROUGH_CHANNEL_TEST_PROBLEM_HH -#include <dune/grid/yaspgrid.hh> -#include <dumux/discretization/cctpfa.hh> -#include "spatialparams.hh" -#include <dumux/common/parameters.hh> #include <dumux/common/boundarytypes.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/properties.hh> -#include <dumux/freeflow/shallowwater/model.hh> #include <dumux/freeflow/shallowwater/problem.hh> #include <dumux/freeflow/shallowwater/boundaryfluxes.hh> namespace Dumux { -template <class TypeTag> -class RoughChannelProblem; - -// Specify the properties for the problem -namespace Properties { - -// Create new type tags -namespace TTag { -struct RoughChannel { using InheritsFrom = std::tuple<ShallowWater, CCTpfaModel>; }; -} // end namespace TTag - -template<class TypeTag> -struct Grid<TypeTag, TTag::RoughChannel> -{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; - -// Set the problem property -template<class TypeTag> -struct Problem<TypeTag, TTag::RoughChannel> -{ using type = Dumux::RoughChannelProblem<TypeTag>; }; - -// Set the spatial parameters -template<class TypeTag> -struct SpatialParams<TypeTag, TTag::RoughChannel> -{ -private: - using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; - using Scalar = GetPropType<TypeTag, Properties::Scalar>; - using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; - using VolumeVariables = typename ElementVolumeVariables::VolumeVariables; -public: - using type = RoughChannelSpatialParams<GridGeometry, Scalar, VolumeVariables>; -}; - -template<class TypeTag> -struct EnableGridGeometryCache<TypeTag, TTag::RoughChannel> -{ static constexpr bool value = true; }; - -template<class TypeTag> -struct EnableGridVolumeVariablesCache<TypeTag, TTag::RoughChannel> -{ static constexpr bool value = false; }; -} // end namespace Properties - /*! * \ingroup ShallowWaterTests * \brief A simple flow in a rough channel with friction law after Manning. diff --git a/test/freeflow/shallowwater/roughchannel/properties.hh b/test/freeflow/shallowwater/roughchannel/properties.hh new file mode 100644 index 0000000000000000000000000000000000000000..98b81de36c911e405f2819d36bb22006aa76c1f1 --- /dev/null +++ b/test/freeflow/shallowwater/roughchannel/properties.hh @@ -0,0 +1,72 @@ +// -*- 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 3 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup ShallowWaterTests + * \brief The properties of a test for the Shallow water model (rough channel). + */ +#ifndef DUMUX_ROUGH_CHANNEL_TEST_PROPERTIES_HH +#define DUMUX_ROUGH_CHANNEL_TEST_PROPERTIES_HH + +#include <dune/grid/yaspgrid.hh> +#include <dumux/discretization/cctpfa.hh> +#include <dumux/freeflow/shallowwater/model.hh> + +#include "problem.hh" +#include "spatialparams.hh" + +namespace Dumux::Properties { + +// Create new type tags +namespace TTag { +struct RoughChannel { using InheritsFrom = std::tuple<ShallowWater, CCTpfaModel>; }; +} // end namespace TTag + +template<class TypeTag> +struct Grid<TypeTag, TTag::RoughChannel> +{ using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<GetPropType<TypeTag, Properties::Scalar>, 2> >; }; + +// Set the problem property +template<class TypeTag> +struct Problem<TypeTag, TTag::RoughChannel> +{ using type = Dumux::RoughChannelProblem<TypeTag>; }; + +// Set the spatial parameters +template<class TypeTag> +struct SpatialParams<TypeTag, TTag::RoughChannel> +{ +private: + using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using Scalar = GetPropType<TypeTag, Properties::Scalar>; + using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView; + using VolumeVariables = typename ElementVolumeVariables::VolumeVariables; +public: + using type = RoughChannelSpatialParams<GridGeometry, Scalar, VolumeVariables>; +}; + +template<class TypeTag> +struct EnableGridGeometryCache<TypeTag, TTag::RoughChannel> +{ static constexpr bool value = true; }; + +template<class TypeTag> +struct EnableGridVolumeVariablesCache<TypeTag, TTag::RoughChannel> +{ static constexpr bool value = false; }; +} // end namespace Dumux::Properties + +#endif diff --git a/test/freeflow/shallowwater/roughchannel/spatialparams.hh b/test/freeflow/shallowwater/roughchannel/spatialparams.hh index 73864db30eb6e97521aa1ad5d5752db9528429e6..d438936c1e3e4dd6745f17fd6b5fa1df46278322 100644 --- a/test/freeflow/shallowwater/roughchannel/spatialparams.hh +++ b/test/freeflow/shallowwater/roughchannel/spatialparams.hh @@ -5,7 +5,7 @@ * * * 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 * + * the Free Software Foundation, either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, *