From b7b993e87ac2215413a3371f665a3ab2b9ca7c3d Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 14:41:37 +0200 Subject: [PATCH 1/8] [test][ff] Use new separated problems, couplingmanager --- test/freeflow/navierstokes/angeli/main.cc | 4 ++-- test/freeflow/navierstokes/angeli/problem.hh | 7 +++---- test/freeflow/navierstokes/angeli/properties.hh | 13 ++++++++++--- test/freeflow/navierstokes/channel/1d/main.cc | 5 ++--- test/freeflow/navierstokes/channel/1d/problem.hh | 7 +++---- .../freeflow/navierstokes/channel/1d/properties.hh | 13 ++++++++++--- test/freeflow/navierstokes/channel/2d/main.cc | 4 ++-- test/freeflow/navierstokes/channel/2d/problem.hh | 7 +++---- .../freeflow/navierstokes/channel/2d/properties.hh | 14 ++++++++++---- test/freeflow/navierstokes/channel/3d/main.cc | 4 ++-- test/freeflow/navierstokes/channel/3d/problem.hh | 7 +++---- .../freeflow/navierstokes/channel/3d/properties.hh | 13 ++++++++++--- .../navierstokes/channel/3d_nonuniform/main.cc | 4 ++-- test/freeflow/navierstokes/channel/pipe/main.cc | 5 ++--- .../navierstokes/channel/pipe/momentum/problem.hh | 6 +++--- test/freeflow/navierstokes/channel/pipe/problem.hh | 7 +++---- .../navierstokes/channel/pipe/properties.hh | 14 ++++++++++---- test/freeflow/navierstokes/donea/main.cc | 5 ++--- test/freeflow/navierstokes/donea/properties.hh | 4 ++-- test/freeflow/navierstokes/kovasznay/problem.hh | 6 +++--- test/freeflow/navierstokes/periodic/main.cc | 4 ++-- test/freeflow/navierstokes/periodic/problem.hh | 7 +++---- test/freeflow/navierstokes/periodic/properties.hh | 13 ++++++++++--- test/freeflow/navierstokes/sincos/main.cc | 4 ++-- test/freeflow/navierstokes/sincos/problem.hh | 7 +++---- test/freeflow/navierstokes/sincos/properties.hh | 13 ++++++++++--- test/freeflow/navierstokes/unstructured/main.cc | 4 ++-- test/freeflow/navierstokesnc/channel/problem.hh | 6 +++--- .../navierstokesnc/densitydrivenflow/problem.hh | 6 +++--- .../navierstokesnc/maxwellstefan/problem.hh | 6 +++--- 30 files changed, 128 insertions(+), 91 deletions(-) diff --git a/test/freeflow/navierstokes/angeli/main.cc b/test/freeflow/navierstokes/angeli/main.cc index 9f0ce7fe6c..d13d56d996 100644 --- a/test/freeflow/navierstokes/angeli/main.cc +++ b/test/freeflow/navierstokes/angeli/main.cc @@ -91,8 +91,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); @@ -104,6 +103,7 @@ int main(int argc, char** argv) auto massProblem = std::make_shared(massGridGeometry, couplingManager); // get some time loop parameters + using Traits = MultiDomainTraits; using Scalar = typename Traits::Scalar; const auto tStart = getParam("TimeLoop.TStart", 0.0); const auto tEnd = getParam("TimeLoop.TEnd"); diff --git a/test/freeflow/navierstokes/angeli/problem.hh b/test/freeflow/navierstokes/angeli/problem.hh index 1ba164afb3..d66187dfde 100644 --- a/test/freeflow/navierstokes/angeli/problem.hh +++ b/test/freeflow/navierstokes/angeli/problem.hh @@ -32,7 +32,6 @@ #include #include -#include namespace Dumux { @@ -45,10 +44,10 @@ namespace Dumux { * The velocities and pressures decay exponentially. The Dirichlet boundary conditions are * time-dependent and consistent with the analytical solution. */ -template -class AngeliTestProblem : public NavierStokesProblem +template +class AngeliTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/test/freeflow/navierstokes/angeli/properties.hh b/test/freeflow/navierstokes/angeli/properties.hh index 4874fcde23..727570a518 100644 --- a/test/freeflow/navierstokes/angeli/properties.hh +++ b/test/freeflow/navierstokes/angeli/properties.hh @@ -29,6 +29,8 @@ #include #include +#include +#include #include #include #include @@ -36,7 +38,7 @@ #include #include -#include +#include #include "problem.hh" @@ -65,7 +67,12 @@ struct Grid { using type = Dune::YaspGrid<2, Dune::Eq // Set the problem property template -struct Problem { using type = Dumux::AngeliTestProblem ; }; +struct Problem +{ using type = AngeliTestProblem>; }; + +template +struct Problem +{ using type = AngeliTestProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; @@ -81,7 +88,7 @@ struct CouplingManager private: using Traits = MultiDomainTraits; public: - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/channel/1d/main.cc b/test/freeflow/navierstokes/channel/1d/main.cc index 1ec180bc5e..a17cc4da6a 100644 --- a/test/freeflow/navierstokes/channel/1d/main.cc +++ b/test/freeflow/navierstokes/channel/1d/main.cc @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -86,8 +85,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problem (initial and boundary conditions) @@ -99,6 +97,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokes/channel/1d/problem.hh b/test/freeflow/navierstokes/channel/1d/problem.hh index e2b1dc972a..5d36638230 100644 --- a/test/freeflow/navierstokes/channel/1d/problem.hh +++ b/test/freeflow/navierstokes/channel/1d/problem.hh @@ -31,7 +31,6 @@ #include #include #include -#include namespace Dumux { @@ -39,10 +38,10 @@ namespace Dumux { * \ingroup NavierStokesTests * \brief Test for the 1-D Navier-Stokes model with an analytical solution. */ -template -class NavierStokesAnalyticProblem : public NavierStokesProblem +template +class NavierStokesAnalyticProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = Dumux::NavierStokesBoundaryTypes::numEq()>; using GridGeometry = GetPropType; diff --git a/test/freeflow/navierstokes/channel/1d/properties.hh b/test/freeflow/navierstokes/channel/1d/properties.hh index ce8b3f187d..473a55bec8 100644 --- a/test/freeflow/navierstokes/channel/1d/properties.hh +++ b/test/freeflow/navierstokes/channel/1d/properties.hh @@ -31,11 +31,13 @@ #include #include +#include +#include #include #include #include -#include +#include #include "problem.hh" @@ -62,7 +64,12 @@ struct Grid { using type = Dune::YaspGrid<1 // Set the problem property template -struct Problem { using type = Dumux::NavierStokesAnalyticProblem ; }; +struct Problem +{ using type = NavierStokesAnalyticProblem>; }; + +template +struct Problem +{ using type = NavierStokesAnalyticProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; @@ -78,7 +85,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/channel/2d/main.cc b/test/freeflow/navierstokes/channel/2d/main.cc index 23d0b01877..8d33f25d76 100644 --- a/test/freeflow/navierstokes/channel/2d/main.cc +++ b/test/freeflow/navierstokes/channel/2d/main.cc @@ -91,8 +91,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problem (boundary conditions) @@ -114,6 +113,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokes/channel/2d/problem.hh b/test/freeflow/navierstokes/channel/2d/problem.hh index ac8bf4144c..9436521b0b 100644 --- a/test/freeflow/navierstokes/channel/2d/problem.hh +++ b/test/freeflow/navierstokes/channel/2d/problem.hh @@ -30,7 +30,6 @@ #include #include -#include #include #include @@ -49,10 +48,10 @@ namespace Dumux { * For the non-isothermal test, water of increased temperature is injected at the inlet * while the walls are fully isolating. */ -template -class ChannelTestProblem : public NavierStokesProblem +template +class ChannelTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/test/freeflow/navierstokes/channel/2d/properties.hh b/test/freeflow/navierstokes/channel/2d/properties.hh index 944f2fe302..c631b9b2ab 100644 --- a/test/freeflow/navierstokes/channel/2d/properties.hh +++ b/test/freeflow/navierstokes/channel/2d/properties.hh @@ -31,12 +31,14 @@ #include #include +#include +#include #include #include #include -#include +#include #include #include "problem.hh" @@ -56,8 +58,12 @@ struct ChannelTestMass { using InheritsFrom = std::tuple -struct Problem -{ using type = ChannelTestProblem; }; +struct Problem +{ using type = ChannelTestProblem>; }; + +template +struct Problem +{ using type = ChannelTestProblem>; }; // the fluid system template @@ -93,7 +99,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/channel/3d/main.cc b/test/freeflow/navierstokes/channel/3d/main.cc index a01eb6b322..0ace80a0c7 100644 --- a/test/freeflow/navierstokes/channel/3d/main.cc +++ b/test/freeflow/navierstokes/channel/3d/main.cc @@ -112,8 +112,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problems (boundary conditions) @@ -125,6 +124,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokes/channel/3d/problem.hh b/test/freeflow/navierstokes/channel/3d/problem.hh index 7a4a5c2148..966b5b385d 100644 --- a/test/freeflow/navierstokes/channel/3d/problem.hh +++ b/test/freeflow/navierstokes/channel/3d/problem.hh @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -51,10 +50,10 @@ namespace Dumux { * For sake of efficiency, the 3D problem can be reduced to a two-dimensional one by including * an additional wall friction term to the momentum balance (Flekkoy et al., 1995 \cite flekkoy1995a). */ -template -class ThreeDChannelTestProblem : public NavierStokesProblem +template +class ThreeDChannelTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/test/freeflow/navierstokes/channel/3d/properties.hh b/test/freeflow/navierstokes/channel/3d/properties.hh index a9e0182192..9e156518b2 100644 --- a/test/freeflow/navierstokes/channel/3d/properties.hh +++ b/test/freeflow/navierstokes/channel/3d/properties.hh @@ -40,10 +40,12 @@ #include #include -#include +#include #include #include #include +#include +#include #include #include @@ -94,7 +96,12 @@ struct SpatialParams // Set the problem property template -struct Problem { using type = ThreeDChannelTestProblem ; }; +struct Problem +{ using type = ThreeDChannelTestProblem>; }; + +template +struct Problem +{ using type = ThreeDChannelTestProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = ENABLECACHING; }; @@ -107,7 +114,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/channel/3d_nonuniform/main.cc b/test/freeflow/navierstokes/channel/3d_nonuniform/main.cc index 72c08bc084..f5e6919581 100644 --- a/test/freeflow/navierstokes/channel/3d_nonuniform/main.cc +++ b/test/freeflow/navierstokes/channel/3d_nonuniform/main.cc @@ -87,8 +87,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = FreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problems (boundary conditions) @@ -100,6 +99,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokes/channel/pipe/main.cc b/test/freeflow/navierstokes/channel/pipe/main.cc index 1a3b5ce67a..45ef3105b5 100644 --- a/test/freeflow/navierstokes/channel/pipe/main.cc +++ b/test/freeflow/navierstokes/channel/pipe/main.cc @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -80,8 +79,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(gridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); @@ -95,6 +93,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; momentumProblem->applyInitialSolution(x[momentumIdx]); diff --git a/test/freeflow/navierstokes/channel/pipe/momentum/problem.hh b/test/freeflow/navierstokes/channel/pipe/momentum/problem.hh index 646bf09b49..3533a0616c 100644 --- a/test/freeflow/navierstokes/channel/pipe/momentum/problem.hh +++ b/test/freeflow/navierstokes/channel/pipe/momentum/problem.hh @@ -23,7 +23,7 @@ #include #include -#include +#include namespace Dumux { /*! @@ -32,9 +32,9 @@ namespace Dumux { * Simulation of a radially-symmetric pipe flow with circular cross-section */ template -class FreeFlowPipeProblem : public NavierStokesProblem +class FreeFlowPipeProblem : public NavierStokesMomentumProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesMomentumProblem; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; diff --git a/test/freeflow/navierstokes/channel/pipe/problem.hh b/test/freeflow/navierstokes/channel/pipe/problem.hh index aa4fd0bb7d..97bd7fbfa5 100644 --- a/test/freeflow/navierstokes/channel/pipe/problem.hh +++ b/test/freeflow/navierstokes/channel/pipe/problem.hh @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -34,10 +33,10 @@ namespace Dumux { * \brief Freeflow problem for pipe flow * Simulation of a radially-symmetric pipe flow with circular cross-section */ -template -class FreeFlowPipeProblem : public NavierStokesProblem +template +class FreeFlowPipeProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; diff --git a/test/freeflow/navierstokes/channel/pipe/properties.hh b/test/freeflow/navierstokes/channel/pipe/properties.hh index 4f9fd0f915..9b242318d1 100644 --- a/test/freeflow/navierstokes/channel/pipe/properties.hh +++ b/test/freeflow/navierstokes/channel/pipe/properties.hh @@ -29,6 +29,8 @@ #include #include +#include +#include #include #include @@ -36,7 +38,7 @@ #include #include -#include +#include #include #include "problem.hh" @@ -65,8 +67,12 @@ struct Grid // Set the problem property template -struct Problem -{ using type = FreeFlowPipeProblem ; }; +struct Problem +{ using type = FreeFlowPipeProblem>; }; + +template +struct Problem +{ using type = FreeFlowPipeProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; @@ -107,7 +113,7 @@ struct CouplingManager private: using Traits = MultiDomainTraits; public: - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/donea/main.cc b/test/freeflow/navierstokes/donea/main.cc index 5630023704..46b1252152 100644 --- a/test/freeflow/navierstokes/donea/main.cc +++ b/test/freeflow/navierstokes/donea/main.cc @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -87,8 +86,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // mass-momentum coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problems (boundary conditions) @@ -101,6 +99,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokes/donea/properties.hh b/test/freeflow/navierstokes/donea/properties.hh index 52ffa22a27..e2c90a4fc2 100644 --- a/test/freeflow/navierstokes/donea/properties.hh +++ b/test/freeflow/navierstokes/donea/properties.hh @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -92,7 +92,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/kovasznay/problem.hh b/test/freeflow/navierstokes/kovasznay/problem.hh index c323d490f5..4d45903fbc 100644 --- a/test/freeflow/navierstokes/kovasznay/problem.hh +++ b/test/freeflow/navierstokes/kovasznay/problem.hh @@ -30,7 +30,7 @@ #include #include -#include +#include namespace Dumux { @@ -43,9 +43,9 @@ namespace Dumux { * and is chosen in a way such that an exact solution is available. */ template -class KovasznayTestProblem : public NavierStokesProblem +class KovasznayTestProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using BoundaryTypes = Dumux::NavierStokesBoundaryTypes::numEq()>; using GridGeometry = GetPropType; diff --git a/test/freeflow/navierstokes/periodic/main.cc b/test/freeflow/navierstokes/periodic/main.cc index 03ac976b2d..bbfade1112 100644 --- a/test/freeflow/navierstokes/periodic/main.cc +++ b/test/freeflow/navierstokes/periodic/main.cc @@ -85,8 +85,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problem (boundary conditions) @@ -98,6 +97,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokes/periodic/problem.hh b/test/freeflow/navierstokes/periodic/problem.hh index 2aebd8a7b9..841b154f03 100644 --- a/test/freeflow/navierstokes/periodic/problem.hh +++ b/test/freeflow/navierstokes/periodic/problem.hh @@ -27,7 +27,6 @@ #include #include -#include namespace Dumux { @@ -38,10 +37,10 @@ namespace Dumux { * A two-dimensional Navier-Stokes flow with a periodicity in one direction * is considered. */ -template -class PeriodicTestProblem : public NavierStokesProblem +template +class PeriodicTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; diff --git a/test/freeflow/navierstokes/periodic/properties.hh b/test/freeflow/navierstokes/periodic/properties.hh index 7bb135b868..6588d2e337 100644 --- a/test/freeflow/navierstokes/periodic/properties.hh +++ b/test/freeflow/navierstokes/periodic/properties.hh @@ -33,8 +33,10 @@ #include #include +#include +#include -#include +#include #include #include @@ -66,7 +68,12 @@ struct Grid { using type = Dune::SPGrid; // Set the problem property template -struct Problem { using type = PeriodicTestProblem ; }; +struct Problem +{ using type = PeriodicTestProblem>; }; + +template +struct Problem +{ using type = PeriodicTestProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; @@ -79,7 +86,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/sincos/main.cc b/test/freeflow/navierstokes/sincos/main.cc index 199d984b1f..2b261b0786 100644 --- a/test/freeflow/navierstokes/sincos/main.cc +++ b/test/freeflow/navierstokes/sincos/main.cc @@ -116,8 +116,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // get some time loop parameters @@ -139,6 +138,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; momentumProblem->applyInitialSolution(x[momentumIdx]); diff --git a/test/freeflow/navierstokes/sincos/problem.hh b/test/freeflow/navierstokes/sincos/problem.hh index 6c15b95992..a8daceca61 100644 --- a/test/freeflow/navierstokes/sincos/problem.hh +++ b/test/freeflow/navierstokes/sincos/problem.hh @@ -30,7 +30,6 @@ #include #include -#include namespace Dumux { @@ -43,10 +42,10 @@ namespace Dumux { * For the instationary case, the velocities and pressures are periodical in time. The Dirichlet boundary conditions are * consistent with the analytical solution and in the instationary case time-dependent. */ -template -class SincosTestProblem : public NavierStokesProblem +template +class SincosTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/test/freeflow/navierstokes/sincos/properties.hh b/test/freeflow/navierstokes/sincos/properties.hh index 8810efed5f..4f4ecddd5e 100644 --- a/test/freeflow/navierstokes/sincos/properties.hh +++ b/test/freeflow/navierstokes/sincos/properties.hh @@ -28,6 +28,8 @@ #include #include +#include +#include #include #include @@ -35,7 +37,7 @@ #include #include -#include +#include #include #include "problem.hh" @@ -64,7 +66,12 @@ struct Grid { using type = Dune::YaspGrid<2, Dune::Eq // Set the problem property template -struct Problem { using type = SincosTestProblem ; }; +struct Problem +{ using type = SincosTestProblem>; }; + +template +struct Problem +{ using type = SincosTestProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; @@ -77,7 +84,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties diff --git a/test/freeflow/navierstokes/unstructured/main.cc b/test/freeflow/navierstokes/unstructured/main.cc index 5273655e25..521b79b4da 100644 --- a/test/freeflow/navierstokes/unstructured/main.cc +++ b/test/freeflow/navierstokes/unstructured/main.cc @@ -85,8 +85,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // the coupling manager - using Traits = MultiDomainTraits; - using CouplingManager = FreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // the problems (boundary conditions) @@ -98,6 +97,7 @@ int main(int argc, char** argv) // the solution vector constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; x[momentumIdx].resize(momentumGridGeometry->numDofs()); diff --git a/test/freeflow/navierstokesnc/channel/problem.hh b/test/freeflow/navierstokesnc/channel/problem.hh index 3cce1ceb54..fd790487c2 100644 --- a/test/freeflow/navierstokesnc/channel/problem.hh +++ b/test/freeflow/navierstokesnc/channel/problem.hh @@ -31,7 +31,7 @@ #include #include -#include +#include namespace Dumux { @@ -45,9 +45,9 @@ namespace Dumux { * represent solid walls with no-slip/no-flow conditions. */ template -class ChannelNCTestProblem : public NavierStokesProblem +class ChannelNCTestProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using BoundaryTypes = Dumux::NavierStokesBoundaryTypes::numEq()>; using FluidSystem = GetPropType; diff --git a/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh b/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh index 5d562ddc24..76bae3d7ce 100644 --- a/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh +++ b/test/freeflow/navierstokesnc/densitydrivenflow/problem.hh @@ -30,7 +30,7 @@ #include #include -#include +#include namespace Dumux { @@ -46,9 +46,9 @@ namespace Dumux { * small numerical instabilities, fingers of denser water will form and sink downwards. */ template -class DensityDrivenFlowProblem : public NavierStokesProblem +class DensityDrivenFlowProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using BoundaryTypes = Dumux::NavierStokesBoundaryTypes::numEq()>; using FluidSystem = GetPropType; diff --git a/test/freeflow/navierstokesnc/maxwellstefan/problem.hh b/test/freeflow/navierstokesnc/maxwellstefan/problem.hh index fcf13b6b3d..373028db26 100644 --- a/test/freeflow/navierstokesnc/maxwellstefan/problem.hh +++ b/test/freeflow/navierstokesnc/maxwellstefan/problem.hh @@ -30,7 +30,7 @@ #include #include -#include +#include #include @@ -41,9 +41,9 @@ namespace Dumux { * \brief Test problem for the Maxwell-Stefan model */ template -class MaxwellStefanNCTestProblem : public NavierStokesProblem +class MaxwellStefanNCTestProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using BoundaryTypes = Dumux::NavierStokesBoundaryTypes::numEq()>; using FluidSystem = GetPropType; -- GitLab From 299d9d48e856b80ebe3ed1dc9fc40f60fe52cb2d Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 14:44:27 +0200 Subject: [PATCH 2/8] [examples] Use separated freeflow problems --- examples/freeflowchannel/README.md | 11 ++++---- examples/freeflowchannel/problem.hh | 10 +++---- examples/freeflowchannel/properties.hh | 1 + examples/liddrivencavity/doc/problem.md | 36 ++++++++++++------------- examples/liddrivencavity/main.cc | 5 ++-- examples/liddrivencavity/problem.hh | 12 +++------ examples/liddrivencavity/properties.hh | 16 ++++++++--- 7 files changed, 48 insertions(+), 43 deletions(-) diff --git a/examples/freeflowchannel/README.md b/examples/freeflowchannel/README.md index e361dd3a4c..d3076c8925 100644 --- a/examples/freeflowchannel/README.md +++ b/examples/freeflowchannel/README.md @@ -87,6 +87,7 @@ type tag, which we want to modify or for which no meaningful default can be set. ```cpp #include +#include ``` We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: @@ -206,11 +207,11 @@ conditions for the Navier-Stokes single-phase flow simulation. ### Include files -Include the `NavierStokesProblem` class, the base +Include the `NavierStokesStaggeredProblem` class, the base class from which we will derive. ```cpp -#include +#include ``` Include the `NavierStokesBoundaryTypes` class which specifies the boundary types set in this problem. @@ -221,16 +222,16 @@ Include the `NavierStokesBoundaryTypes` class which specifies the boundary types ### The problem class We enter the problem class where all necessary boundary conditions and initial conditions are set for our simulation. -As we are solving a problem related to free flow, we inherit from the base class `NavierStokesProblem`. +As we are solving a problem related to free flow, we inherit from the base class `NavierStokesStaggeredProblem`. ```cpp namespace Dumux { template -class ChannelExampleProblem : public NavierStokesProblem +class ChannelExampleProblem : public NavierStokesStaggeredProblem { // A few convenience aliases used throughout this class. - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; diff --git a/examples/freeflowchannel/problem.hh b/examples/freeflowchannel/problem.hh index d12d8058a9..060201836f 100644 --- a/examples/freeflowchannel/problem.hh +++ b/examples/freeflowchannel/problem.hh @@ -29,23 +29,23 @@ // // ### Include files // -// Include the `NavierStokesProblem` class, the base +// Include the `NavierStokesStaggeredProblem` class, the base // class from which we will derive. -#include +#include // Include the `NavierStokesBoundaryTypes` class which specifies the boundary types set in this problem. #include // ### The problem class // We enter the problem class where all necessary boundary conditions and initial conditions are set for our simulation. -// As we are solving a problem related to free flow, we inherit from the base class `NavierStokesProblem`. +// As we are solving a problem related to free flow, we inherit from the base class `NavierStokesStaggeredProblem`. // [[codeblock]] namespace Dumux { template -class ChannelExampleProblem : public NavierStokesProblem +class ChannelExampleProblem : public NavierStokesStaggeredProblem { // A few convenience aliases used throughout this class. - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridGeometry = GetPropType; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; diff --git a/examples/freeflowchannel/properties.hh b/examples/freeflowchannel/properties.hh index 56e717db39..0d8d3c8375 100644 --- a/examples/freeflowchannel/properties.hh +++ b/examples/freeflowchannel/properties.hh @@ -35,6 +35,7 @@ // respective properties and subsequently specialize those properties for our // type tag, which we want to modify or for which no meaningful default can be set. #include +#include // We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: #include diff --git a/examples/liddrivencavity/doc/problem.md b/examples/liddrivencavity/doc/problem.md index 4bff399641..e70cd12f88 100644 --- a/examples/liddrivencavity/doc/problem.md +++ b/examples/liddrivencavity/doc/problem.md @@ -29,8 +29,10 @@ The single-phase flow Navier-Stokes equations are solved by coupling a momentum ```cpp #include #include +#include +#include #include -#include +#include ``` We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: @@ -97,9 +99,15 @@ struct FluidSystem template struct Grid { using type = Dune::YaspGrid<2>; }; -// This sets our problem class (see problem.hh) containing initial and boundary conditions. +// This sets our problem class (see problem.hh) containing initial and boundary conditions for the +// momentum and mass subproblem. template -struct Problem { using type = Dumux::LidDrivenCavityExampleProblem ; }; +struct Problem +{ using type = LidDrivenCavityExampleProblem>; }; + +template +struct Problem +{ using type = LidDrivenCavityExampleProblem>; }; ``` We also set some properties related to memory management @@ -135,7 +143,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties ``` @@ -163,13 +171,6 @@ conditions for the Navier-Stokes single-phase flow simulation. #include ``` -Include the `NavierStokesProblem` class, the base -class from which we will derive. - -```cpp -#include -``` - Include the `NavierStokesBoundaryTypes` class which specifies the boundary types set in this problem. ```cpp @@ -178,14 +179,14 @@ Include the `NavierStokesBoundaryTypes` class which specifies the boundary types ### The problem class As we are solving a problem related to free flow, we create a new class called `LidDrivenCavityExampleProblem` -and let it inherit from the class `NavierStokesProblem`. +and let it inherit from a base class for the momentum and mass subproblems (selected in properties.hh). ```cpp namespace Dumux { -template -class LidDrivenCavityExampleProblem : public NavierStokesProblem +template +class LidDrivenCavityExampleProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; @@ -379,7 +380,6 @@ systems arising from the staggered-grid discretization. #include #include #include -#include #include ``` @@ -501,8 +501,7 @@ This is done for both the momentum and mass grid geometries We introduce the multidomain coupling manager, which will coupled the mass and the momentum problems ```cpp - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); ``` @@ -523,6 +522,7 @@ We initialize the solution vector by what was defined as the initial solution of ```cpp constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; momentumProblem->applyInitialSolution(x[momentumIdx]); diff --git a/examples/liddrivencavity/main.cc b/examples/liddrivencavity/main.cc index 9e99893bf1..8d66e36086 100644 --- a/examples/liddrivencavity/main.cc +++ b/examples/liddrivencavity/main.cc @@ -44,7 +44,6 @@ #include #include #include -#include #include // The gridmanager constructs a grid from the information in the input or grid file. @@ -145,8 +144,7 @@ int main(int argc, char** argv) auto massGridGeometry = std::make_shared(leafGridView); // We introduce the multidomain coupling manager, which will coupled the mass and the momentum problems - using Traits = MultiDomainTraits; - using CouplingManager = StaggeredFreeFlowCouplingManager; + using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); // We now instantiate the problems, in which we define the boundary and initial conditions. @@ -161,6 +159,7 @@ int main(int argc, char** argv) // We initialize the solution vector by what was defined as the initial solution of the the problem. constexpr auto momentumIdx = CouplingManager::freeFlowMomentumIndex; constexpr auto massIdx = CouplingManager::freeFlowMassIndex; + using Traits = MultiDomainTraits; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; momentumProblem->applyInitialSolution(x[momentumIdx]); diff --git a/examples/liddrivencavity/problem.hh b/examples/liddrivencavity/problem.hh index 12552f4b65..945293319b 100644 --- a/examples/liddrivencavity/problem.hh +++ b/examples/liddrivencavity/problem.hh @@ -32,22 +32,18 @@ #include #include -// Include the `NavierStokesProblem` class, the base -// class from which we will derive. -#include - // Include the `NavierStokesBoundaryTypes` class which specifies the boundary types set in this problem. #include // ### The problem class // As we are solving a problem related to free flow, we create a new class called `LidDrivenCavityExampleProblem` -// and let it inherit from the class `NavierStokesProblem`. +// and let it inherit from a base class for the momentum and mass subproblems (selected in properties.hh). // [[codeblock]] namespace Dumux { -template -class LidDrivenCavityExampleProblem : public NavierStokesProblem +template +class LidDrivenCavityExampleProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/examples/liddrivencavity/properties.hh b/examples/liddrivencavity/properties.hh index 9921e3075f..5b0e30ce20 100644 --- a/examples/liddrivencavity/properties.hh +++ b/examples/liddrivencavity/properties.hh @@ -33,8 +33,10 @@ // The single-phase flow Navier-Stokes equations are solved by coupling a momentum balance model to a mass balance model. #include #include +#include +#include #include -#include +#include // We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: #include @@ -85,9 +87,15 @@ struct FluidSystem template struct Grid { using type = Dune::YaspGrid<2>; }; -// This sets our problem class (see problem.hh) containing initial and boundary conditions. +// This sets our problem class (see problem.hh) containing initial and boundary conditions for the +// momentum and mass subproblem. template -struct Problem { using type = Dumux::LidDrivenCavityExampleProblem ; }; +struct Problem +{ using type = LidDrivenCavityExampleProblem>; }; + +template +struct Problem +{ using type = LidDrivenCavityExampleProblem>; }; // [[/codeblock]] @@ -122,7 +130,7 @@ template struct CouplingManager { using Traits = MultiDomainTraits; - using type = StaggeredFreeFlowCouplingManager; + using type = FreeFlowCouplingManager; }; } // end namespace Dumux::Properties // [[/content]] -- GitLab From 6b6bbc242b41d64b98454617ea5cd069d4d96b67 Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 14:45:11 +0200 Subject: [PATCH 3/8] [ff][rans] Use renamed staggered problem --- dumux/freeflow/rans/problem.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh index 702d7587e3..d68ea250bf 100644 --- a/dumux/freeflow/rans/problem.hh +++ b/dumux/freeflow/rans/problem.hh @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "model.hh" namespace Dumux { @@ -55,9 +55,9 @@ using RANSProblem = RANSProblemImpl -class RANSProblemBase : public NavierStokesProblem +class RANSProblemBase : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using Implementation = GetPropType; using Scalar = GetPropType; -- GitLab From 9069df7c5967f709ae0e2ff9b9941bb8ed96d54c Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 15:46:55 +0200 Subject: [PATCH 4/8] [test][md] Use separated freeflow problems --- .../freeflowporenetwork/1p_1p/problem_freeflow.hh | 7 +++---- .../boundary/freeflowporenetwork/1p_1p/properties.hh | 9 ++++++++- .../1p_1p/convergence/problem_freeflow.hh | 7 +++---- .../1p_1p/convergence/properties.hh | 10 ++++++++-- .../freeflowporousmedium/1p_1p/problem_freeflow.hh | 7 +++---- .../boundary/freeflowporousmedium/1p_1p/properties.hh | 9 ++++++++- .../1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh | 6 +++--- .../boundary/stokesdarcy/1p2c_1p2c/problem_stokes.hh | 6 +++--- .../boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh | 6 +++--- .../boundary/stokesdarcy/1p3c_1p3c/problem_stokes.hh | 6 +++--- .../1p_1p/convergencetest/problem_stokes.hh | 6 +++--- .../boundary/stokesdarcy/1p_1p/problem_stokes.hh | 6 +++--- .../boundary/stokesdarcy/1p_2p/problem_stokes.hh | 6 +++--- 13 files changed, 54 insertions(+), 37 deletions(-) diff --git a/test/multidomain/boundary/freeflowporenetwork/1p_1p/problem_freeflow.hh b/test/multidomain/boundary/freeflowporenetwork/1p_1p/problem_freeflow.hh index 522686b73f..dc2fcc4a30 100644 --- a/test/multidomain/boundary/freeflowporenetwork/1p_1p/problem_freeflow.hh +++ b/test/multidomain/boundary/freeflowporenetwork/1p_1p/problem_freeflow.hh @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -38,10 +37,10 @@ namespace Dumux { * \brief Free-flow sub-problem for the coupled 1p_1p free-flow/pore-network-model test * A two-dimensional Stokes flow region coupled to a pore-network model. */ -template -class FreeFlowOnePTestProblem : public NavierStokesProblem +template +class FreeFlowOnePTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/test/multidomain/boundary/freeflowporenetwork/1p_1p/properties.hh b/test/multidomain/boundary/freeflowporenetwork/1p_1p/properties.hh index 9c220faae5..edcda7c3ea 100644 --- a/test/multidomain/boundary/freeflowporenetwork/1p_1p/properties.hh +++ b/test/multidomain/boundary/freeflowporenetwork/1p_1p/properties.hh @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -109,7 +111,12 @@ struct SpatialParams // Set the problem property template -struct Problem { using type = Dumux::FreeFlowOnePTestProblem ; }; +struct Problem +{ using type = Dumux::FreeFlowOnePTestProblem>; }; + +template +struct Problem +{ using type = Dumux::FreeFlowOnePTestProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; diff --git a/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/problem_freeflow.hh b/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/problem_freeflow.hh index c71c5d1ca0..37a9d1770a 100644 --- a/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/problem_freeflow.hh +++ b/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/problem_freeflow.hh @@ -25,7 +25,6 @@ #ifndef DUMUX_FREEFLOW_SUBPROBLEM_HH #define DUMUX_FREEFLOW_SUBPROBLEM_HH -#include #include #include #include @@ -41,10 +40,10 @@ namespace Dumux { * \ingroup BoundaryTests * \brief The Stokes sub-problem of coupled Stokes-Darcy convergence test */ -template -class FreeFlowSubProblem : public NavierStokesProblem +template +class FreeFlowSubProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using Scalar = GetPropType; using GridGeometry = GetPropType; using GridView = typename GridGeometry::GridView; diff --git a/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/properties.hh b/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/properties.hh index 70c62ded2f..d61a718946 100644 --- a/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/properties.hh +++ b/test/multidomain/boundary/freeflowporousmedium/1p_1p/convergence/properties.hh @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -100,8 +102,12 @@ struct Grid // Set the problem property template -struct Problem -{ using type = FreeFlowSubProblem; }; +struct Problem +{ using type = FreeFlowSubProblem>; }; + +template +struct Problem +{ using type = FreeFlowSubProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; diff --git a/test/multidomain/boundary/freeflowporousmedium/1p_1p/problem_freeflow.hh b/test/multidomain/boundary/freeflowporousmedium/1p_1p/problem_freeflow.hh index 868d732610..7baf03095f 100644 --- a/test/multidomain/boundary/freeflowporousmedium/1p_1p/problem_freeflow.hh +++ b/test/multidomain/boundary/freeflowporousmedium/1p_1p/problem_freeflow.hh @@ -26,7 +26,6 @@ #define DUMUX_KOVASZNAY_TEST_PROBLEM_NEW_HH -#include #include #include #include @@ -42,10 +41,10 @@ namespace Dumux { * is considered. The set-up represents a wake behind a two-dimensional grid * and is chosen in a way such that an exact solution is available. */ -template -class FreeFlowOnePTestProblem : public NavierStokesProblem +template +class FreeFlowOnePTestProblem : public BaseProblem { - using ParentType = NavierStokesProblem; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType; diff --git a/test/multidomain/boundary/freeflowporousmedium/1p_1p/properties.hh b/test/multidomain/boundary/freeflowporousmedium/1p_1p/properties.hh index 4bf95acba7..faffe0f09c 100644 --- a/test/multidomain/boundary/freeflowporousmedium/1p_1p/properties.hh +++ b/test/multidomain/boundary/freeflowporousmedium/1p_1p/properties.hh @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -97,7 +99,12 @@ struct Grid // Set the problem property template -struct Problem { using type = Dumux::FreeFlowOnePTestProblem ; }; +struct Problem +{ using type = Dumux::FreeFlowOnePTestProblem>; }; + +template +struct Problem +{ using type = Dumux::FreeFlowOnePTestProblem>; }; template struct EnableGridGeometryCache { static constexpr bool value = true; }; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh index 0eb8ea2577..9ef06ac365 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/diffusionlawcomparison/problem_stokes.hh @@ -35,7 +35,7 @@ #include #include -#include +#include // for StokesDarcyCouplingOptions #include @@ -49,9 +49,9 @@ namespace Dumux { * Horizontal flow from left to right with a parabolic velocity profile. */ template -class StokesSubProblem : public NavierStokesProblem +class StokesSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridView = typename GetPropType::GridView; using Scalar = GetPropType; using Indices = typename GetPropType::Indices; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/problem_stokes.hh index 9798b3a644..db167430ab 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/problem_stokes.hh @@ -30,7 +30,7 @@ #include #include #include -#include +#include namespace Dumux { @@ -41,9 +41,9 @@ namespace Dumux { * Horizontal flow from left to right with a parabolic velocity profile. */ template -class StokesSubProblem : public NavierStokesProblem +class StokesSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridView = typename GetPropType::GridView; using Scalar = GetPropType; using Indices = typename GetPropType::Indices; diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh index 84850eaa1f..ea6c2539c7 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/problem_stokes.hh @@ -31,7 +31,7 @@ #include #include -#include +#include #include @@ -44,9 +44,9 @@ namespace Dumux { * Horizontal flow from left to right with a parabolic velocity profile. */ template -class StokesSubProblem : public NavierStokesProblem +class StokesSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridView = typename GetPropType::GridView; using Scalar = GetPropType; diff --git a/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/problem_stokes.hh index 662ceaf26d..82df15aedc 100644 --- a/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p3c_1p3c/problem_stokes.hh @@ -27,7 +27,7 @@ #include #include -#include +#include #include @@ -46,9 +46,9 @@ class StokesSubProblem; * Horizontal flow from left to right with a parabolic velocity profile. */ template -class StokesSubProblem : public NavierStokesProblem +class StokesSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridView = typename GetPropType::GridView; using Scalar = GetPropType; using Indices = typename GetPropType::Indices; diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/problem_stokes.hh index 2d7da0aa16..7498046d61 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/convergencetest/problem_stokes.hh @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include @@ -49,9 +49,9 @@ class FreeFlowSubProblem; * \brief The Stokes sub-problem of coupled Stokes-Darcy convergence test */ template -class FreeFlowSubProblem : public NavierStokesProblem +class FreeFlowSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using Scalar = GetPropType; using BoundaryTypes = Dumux::NavierStokesBoundaryTypes::numEq()>; using GridGeometry = GetPropType; diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_1p/problem_stokes.hh index de97f088f1..c0a61fd6d7 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/problem_stokes.hh @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include @@ -45,9 +45,9 @@ namespace Dumux { * Horizontal flow from left to right with a parabolic velocity profile. */ template -class StokesSubProblem : public NavierStokesProblem +class StokesSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridView = typename GetPropType::GridView; using Scalar = GetPropType; diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh index 175f650046..2c53e3dc24 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/problem_stokes.hh @@ -30,7 +30,7 @@ #include #include -#include +#include namespace Dumux { @@ -41,9 +41,9 @@ namespace Dumux { * Vertical flow from top to bottom with a parabolic velocity profile. */ template -class StokesSubProblem : public NavierStokesProblem +class StokesSubProblem : public NavierStokesStaggeredProblem { - using ParentType = NavierStokesProblem; + using ParentType = NavierStokesStaggeredProblem; using GridView = typename GetPropType::GridView; using Scalar = GetPropType; -- GitLab From dde5a4ec05b773023791a47d6c1b999b72748e30 Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 15:48:13 +0200 Subject: [PATCH 5/8] [md] Use renamed freeflow couplingmanager --- .../boundary/freeflowporenetwork/couplingmanager.hh | 4 ++-- .../boundary/freeflowporousmedium/couplingmanager.hh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dumux/multidomain/boundary/freeflowporenetwork/couplingmanager.hh b/dumux/multidomain/boundary/freeflowporenetwork/couplingmanager.hh index bd616c1b98..572e704a12 100644 --- a/dumux/multidomain/boundary/freeflowporenetwork/couplingmanager.hh +++ b/dumux/multidomain/boundary/freeflowporenetwork/couplingmanager.hh @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include "couplingconditions.hh" @@ -134,7 +134,7 @@ struct CouplingManagers >; using FreeFlowCouplingManager - = Dumux::StaggeredFreeFlowCouplingManager; + = Dumux::FreeFlowCouplingManager; using FreeFlowMomentumPoreNetworkCouplingManager = Dumux::FreeFlowMomentumPoreNetworkCouplingManager; using FreeFlowMassPoreNetworkCouplingManager diff --git a/dumux/multidomain/boundary/freeflowporousmedium/couplingmanager.hh b/dumux/multidomain/boundary/freeflowporousmedium/couplingmanager.hh index 8bb06f30a5..379444fd2b 100644 --- a/dumux/multidomain/boundary/freeflowporousmedium/couplingmanager.hh +++ b/dumux/multidomain/boundary/freeflowporousmedium/couplingmanager.hh @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include "couplingconditions.hh" @@ -133,7 +133,7 @@ struct CouplingManagers >; using FreeFlowCouplingManager - = Dumux::StaggeredFreeFlowCouplingManager; + = Dumux::FreeFlowCouplingManager; using FreeFlowMomentumPorousMediumCouplingManager = Dumux::FreeFlowMomentumPorousMediumCouplingManager; using FreeFlowMassPorousMediumCouplingManager -- GitLab From 32b6548838e14942b95559a123c4eb1199cd52e8 Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 16:31:34 +0200 Subject: [PATCH 6/8] [test][io] Use renamed staggered freeflow problem --- test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc index 5d873f8ac7..39460a8d91 100644 --- a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include #include @@ -121,7 +121,7 @@ private: static constexpr auto nComp = MTraits::numFluidComponents(); static constexpr auto numEq = MTraits::numEq(); - using BaseProblem = std::conditional_t, NavierStokesProblem>; + using BaseProblem = std::conditional_t, NavierStokesStaggeredProblem>; template class MockProblem : public BaseProblem -- GitLab From b1e606022028f029cac54f4116601ee8ebc355ce Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Mon, 5 Sep 2022 16:05:46 +0200 Subject: [PATCH 7/8] [box] Use unified cvfe class and get operator --- dumux/multidomain/facet/box/localresidual.hh | 2 +- dumux/porenetwork/common/boundaryflux.hh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dumux/multidomain/facet/box/localresidual.hh b/dumux/multidomain/facet/box/localresidual.hh index aff125fe8a..7d1d2568e9 100644 --- a/dumux/multidomain/facet/box/localresidual.hh +++ b/dumux/multidomain/facet/box/localresidual.hh @@ -108,7 +108,7 @@ public: else { const auto& scv = fvGeometry.scv(scvf.insideScvIdx()); - const auto& bcTypes = elemBcTypes[scv.localDofIndex()]; + const auto& bcTypes = elemBcTypes.get(fvGeometry, scv); // Neumann and Robin ("solution dependent Neumann") boundary conditions if (bcTypes.hasNeumann()) diff --git a/dumux/porenetwork/common/boundaryflux.hh b/dumux/porenetwork/common/boundaryflux.hh index 780c7bcc5b..03e38b4da2 100644 --- a/dumux/porenetwork/common/boundaryflux.hh +++ b/dumux/porenetwork/common/boundaryflux.hh @@ -34,7 +34,7 @@ #include #include -#include +#include namespace Dumux::PoreNetwork { @@ -53,7 +53,7 @@ class BoundaryFlux using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using BoundaryTypes = typename ProblemTraits::BoundaryTypes; - using ElementBoundaryTypes = BoxElementBoundaryTypes; + using ElementBoundaryTypes = CVFEElementBoundaryTypes; using NumEqVector = typename SolutionVector::block_type; static constexpr auto numEq = NumEqVector::dimension; @@ -230,7 +230,7 @@ private: isConsidered_[scv.dofIndex()] = true; // get the type of the boundary condition on the scv - const auto& bcTypes = elemBcTypes[scv.localDofIndex()]; + const auto& bcTypes = elemBcTypes.get(fvGeometry, scv); NumEqVector flux(0.0); for (int eqIdx = 0; eqIdx < NumEqVector::dimension; ++eqIdx) -- GitLab From b1224dcff789a65354ef6fe818c7d4629aca853c Mon Sep 17 00:00:00 2001 From: Mathis Kelm Date: Wed, 7 Sep 2022 09:36:59 +0200 Subject: [PATCH 8/8] [examples] Add explanation for the coupling manager --- examples/liddrivencavity/main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/liddrivencavity/main.cc b/examples/liddrivencavity/main.cc index 8d66e36086..4563115cff 100644 --- a/examples/liddrivencavity/main.cc +++ b/examples/liddrivencavity/main.cc @@ -143,7 +143,8 @@ int main(int argc, char** argv) using MassGridGeometry = GetPropType; auto massGridGeometry = std::make_shared(leafGridView); - // We introduce the multidomain coupling manager, which will coupled the mass and the momentum problems + // We introduce the multidomain coupling manager, which will couple the mass and the momentum problems + // We can obtain the type from either the `MomentumTypeTag` or the `MassTypeTag` because they are mutually coupled with the same manager using CouplingManager = GetPropType; auto couplingManager = std::make_shared(); -- GitLab