diff --git a/examples/freeflowchannel/README.md b/examples/freeflowchannel/README.md index e361dd3a4c3c21720c97a093f8ea5c33e2c770e0..d3076c89256e86704790f1cd120099653cdada41 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 <dumux/freeflow/navierstokes/model.hh> +#include <dumux/freeflow/navierstokes/staggered/problem.hh> ``` 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 <dumux/freeflow/navierstokes/problem.hh> +#include <dumux/freeflow/navierstokes/staggered/problem.hh> ``` 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 TypeTag> -class ChannelExampleProblem : public NavierStokesProblem<TypeTag> +class ChannelExampleProblem : public NavierStokesStaggeredProblem<TypeTag> { // A few convenience aliases used throughout this class. - using ParentType = NavierStokesProblem<TypeTag>; + using ParentType = NavierStokesStaggeredProblem<TypeTag>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; diff --git a/examples/freeflowchannel/problem.hh b/examples/freeflowchannel/problem.hh index d12d8058a96b710a8496348f19a1b0fbf7984779..060201836f146a79be6a554ea54f0efdda22ef7b 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 <dumux/freeflow/navierstokes/problem.hh> +#include <dumux/freeflow/navierstokes/staggered/problem.hh> // Include the `NavierStokesBoundaryTypes` class which specifies the boundary types set in this problem. #include <dumux/freeflow/navierstokes/boundarytypes.hh> // ### 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 TypeTag> -class ChannelExampleProblem : public NavierStokesProblem<TypeTag> +class ChannelExampleProblem : public NavierStokesStaggeredProblem<TypeTag> { // A few convenience aliases used throughout this class. - using ParentType = NavierStokesProblem<TypeTag>; + using ParentType = NavierStokesStaggeredProblem<TypeTag>; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace; diff --git a/examples/freeflowchannel/properties.hh b/examples/freeflowchannel/properties.hh index 56e717db3944fb12836334f670b6c0d3dc786248..0d8d3c8375c3a1f02dbb35136b4a31a84423c693 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 <dumux/freeflow/navierstokes/model.hh> +#include <dumux/freeflow/navierstokes/staggered/problem.hh> // We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: #include <dune/grid/yaspgrid.hh> diff --git a/examples/liddrivencavity/doc/problem.md b/examples/liddrivencavity/doc/problem.md index 4bff3996414c3e1a90d397c309af91b156bd31f7..e70cd12f88b5f66a8bb214caa2677cdb83befd38 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 <dumux/freeflow/navierstokes/momentum/model.hh> #include <dumux/freeflow/navierstokes/mass/1p/model.hh> +#include <dumux/freeflow/navierstokes/momentum/problem.hh> +#include <dumux/freeflow/navierstokes/mass/problem.hh> #include <dumux/multidomain/traits.hh> -#include <dumux/multidomain/staggeredfreeflow/couplingmanager.hh> +#include <dumux/multidomain/freeflow/couplingmanager.hh> ``` We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: @@ -97,9 +99,15 @@ struct FluidSystem<TypeTag, TTag::LidDrivenCavityExample> template<class TypeTag> struct Grid<TypeTag, TTag::LidDrivenCavityExample> { 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<class TypeTag> -struct Problem<TypeTag, TTag::LidDrivenCavityExample> { using type = Dumux::LidDrivenCavityExampleProblem<TypeTag> ; }; +struct Problem<TypeTag, TTag::LidDrivenCavityExampleMomentum> +{ using type = LidDrivenCavityExampleProblem<TypeTag, Dumux::NavierStokesMomentumProblem<TypeTag>>; }; + +template<class TypeTag> +struct Problem<TypeTag, TTag::LidDrivenCavityExampleMass> +{ using type = LidDrivenCavityExampleProblem<TypeTag, Dumux::NavierStokesMassProblem<TypeTag>>; }; ``` We also set some properties related to memory management @@ -135,7 +143,7 @@ template<class TypeTag> struct CouplingManager<TypeTag, TTag::LidDrivenCavityExample> { using Traits = MultiDomainTraits<TTag::LidDrivenCavityExampleMomentum, TTag::LidDrivenCavityExampleMass>; - using type = StaggeredFreeFlowCouplingManager<Traits>; + using type = FreeFlowCouplingManager<Traits>; }; } // end namespace Dumux::Properties ``` @@ -163,13 +171,6 @@ conditions for the Navier-Stokes single-phase flow simulation. #include <dumux/common/parameters.hh> ``` -Include the `NavierStokesProblem` class, the base -class from which we will derive. - -```cpp -#include <dumux/freeflow/navierstokes/problem.hh> -``` - 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 TypeTag> -class LidDrivenCavityExampleProblem : public NavierStokesProblem<TypeTag> +template <class TypeTag, class BaseProblem> +class LidDrivenCavityExampleProblem : public BaseProblem { - using ParentType = NavierStokesProblem<TypeTag>; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; @@ -379,7 +380,6 @@ systems arising from the staggered-grid discretization. #include <dumux/linear/seqsolverbackend.hh> #include <dumux/multidomain/fvassembler.hh> #include <dumux/multidomain/traits.hh> -#include <dumux/multidomain/staggeredfreeflow/couplingmanager.hh> #include <dumux/multidomain/newtonsolver.hh> ``` @@ -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<MomentumTypeTag, MassTypeTag>; - using CouplingManager = StaggeredFreeFlowCouplingManager<Traits>; + using CouplingManager = GetPropType<MomentumTypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(); ``` @@ -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<MomentumTypeTag, MassTypeTag>; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; momentumProblem->applyInitialSolution(x[momentumIdx]); diff --git a/examples/liddrivencavity/main.cc b/examples/liddrivencavity/main.cc index 9e99893bf10f884bd1d2a9d5cf4665d9294412fb..8d66e3608665e855d50e56a977be1fd3e2239a5a 100644 --- a/examples/liddrivencavity/main.cc +++ b/examples/liddrivencavity/main.cc @@ -44,7 +44,6 @@ #include <dumux/linear/seqsolverbackend.hh> #include <dumux/multidomain/fvassembler.hh> #include <dumux/multidomain/traits.hh> -#include <dumux/multidomain/staggeredfreeflow/couplingmanager.hh> #include <dumux/multidomain/newtonsolver.hh> // 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<MassGridGeometry>(leafGridView); // We introduce the multidomain coupling manager, which will coupled the mass and the momentum problems - using Traits = MultiDomainTraits<MomentumTypeTag, MassTypeTag>; - using CouplingManager = StaggeredFreeFlowCouplingManager<Traits>; + using CouplingManager = GetPropType<MomentumTypeTag, Properties::CouplingManager>; auto couplingManager = std::make_shared<CouplingManager>(); // 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<MomentumTypeTag, MassTypeTag>; using SolutionVector = typename Traits::SolutionVector; SolutionVector x; momentumProblem->applyInitialSolution(x[momentumIdx]); diff --git a/examples/liddrivencavity/problem.hh b/examples/liddrivencavity/problem.hh index 12552f4b6514191d58eba214ff0a09451f2ecffe..945293319bb24c75dd864b3b1679c2529055529d 100644 --- a/examples/liddrivencavity/problem.hh +++ b/examples/liddrivencavity/problem.hh @@ -32,22 +32,18 @@ #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -// Include the `NavierStokesProblem` class, the base -// class from which we will derive. -#include <dumux/freeflow/navierstokes/problem.hh> - // Include the `NavierStokesBoundaryTypes` class which specifies the boundary types set in this problem. #include <dumux/freeflow/navierstokes/boundarytypes.hh> // ### 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 TypeTag> -class LidDrivenCavityExampleProblem : public NavierStokesProblem<TypeTag> +template <class TypeTag, class BaseProblem> +class LidDrivenCavityExampleProblem : public BaseProblem { - using ParentType = NavierStokesProblem<TypeTag>; + using ParentType = BaseProblem; using BoundaryTypes = typename ParentType::BoundaryTypes; using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; diff --git a/examples/liddrivencavity/properties.hh b/examples/liddrivencavity/properties.hh index 9921e3075fc92ada53fb302688aba7f94e9d08eb..5b0e30ce20e9db843f548c8b7f37fba1e5566aad 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 <dumux/freeflow/navierstokes/momentum/model.hh> #include <dumux/freeflow/navierstokes/mass/1p/model.hh> +#include <dumux/freeflow/navierstokes/momentum/problem.hh> +#include <dumux/freeflow/navierstokes/mass/problem.hh> #include <dumux/multidomain/traits.hh> -#include <dumux/multidomain/staggeredfreeflow/couplingmanager.hh> +#include <dumux/multidomain/freeflow/couplingmanager.hh> // We want to use `YaspGrid`, an implementation of the dune grid interface for structured grids: #include <dune/grid/yaspgrid.hh> @@ -85,9 +87,15 @@ struct FluidSystem<TypeTag, TTag::LidDrivenCavityExample> template<class TypeTag> struct Grid<TypeTag, TTag::LidDrivenCavityExample> { 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<class TypeTag> -struct Problem<TypeTag, TTag::LidDrivenCavityExample> { using type = Dumux::LidDrivenCavityExampleProblem<TypeTag> ; }; +struct Problem<TypeTag, TTag::LidDrivenCavityExampleMomentum> +{ using type = LidDrivenCavityExampleProblem<TypeTag, Dumux::NavierStokesMomentumProblem<TypeTag>>; }; + +template<class TypeTag> +struct Problem<TypeTag, TTag::LidDrivenCavityExampleMass> +{ using type = LidDrivenCavityExampleProblem<TypeTag, Dumux::NavierStokesMassProblem<TypeTag>>; }; // [[/codeblock]] @@ -122,7 +130,7 @@ template<class TypeTag> struct CouplingManager<TypeTag, TTag::LidDrivenCavityExample> { using Traits = MultiDomainTraits<TTag::LidDrivenCavityExampleMomentum, TTag::LidDrivenCavityExampleMass>; - using type = StaggeredFreeFlowCouplingManager<Traits>; + using type = FreeFlowCouplingManager<Traits>; }; } // end namespace Dumux::Properties // [[/content]]