diff --git a/test/freeflow/navierstokesnc/CMakeLists.txt b/test/freeflow/navierstokesnc/CMakeLists.txt index 5d4693339bc8300dcee753107c661be480ab7fd3..57e3f6182f58d95ab257501951d1e4896b33f3b8 100644 --- a/test/freeflow/navierstokesnc/CMakeLists.txt +++ b/test/freeflow/navierstokesnc/CMakeLists.txt @@ -61,5 +61,5 @@ dune_add_test(NAME test_msfreeflow COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py CMD_ARGS --script fuzzy --files ${CMAKE_SOURCE_DIR}/test/references/maxwellstefanfreeflow-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_msfreeflow-00025.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_msfreeflow-00005.vtu --command "${CMAKE_CURRENT_BINARY_DIR}/test_msfreeflow test_msfreeflow.input") diff --git a/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh b/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh index 5b560311f796833754a3b53fee25d3c46741576e..5cfbbce35b4632ee05743fe83abe2aa649308288 100644 --- a/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh +++ b/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh @@ -42,11 +42,7 @@ class MaxwellStefanNCTestProblem; namespace Properties { -#if !NONISOTHERMAL NEW_TYPE_TAG(MaxwellStefanNCTestTypeTag, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNC)); -#else -NEW_TYPE_TAG(MaxwellStefanNCTestTypeTag, INHERITS_FROM(StaggeredFreeFlowModel, NavierStokesNCNI)); -#endif NEW_PROP_TAG(FluidSystem); @@ -66,7 +62,7 @@ SET_BOOL_PROP(MaxwellStefanNCTestTypeTag, EnableGridVolumeVariablesCache, true); SET_BOOL_PROP(MaxwellStefanNCTestTypeTag, UseMoles, true); // #if ENABLE_NAVIERSTOKES -SET_BOOL_PROP(MaxwellStefanNCTestTypeTag, EnableInertiaTerms, true); +SET_BOOL_PROP(MaxwellStefanNCTestTypeTag, EnableInertiaTerms, false); //! Here we set FicksLaw or MaxwellStefansLaw SET_TYPE_PROP(MaxwellStefanNCTestTypeTag, MolecularDiffusionType, MaxwellStefansLaw<TypeTag>); @@ -186,8 +182,7 @@ class MaxwellStefanNCTestProblem : public NavierStokesProblem<TypeTag> using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); // copy some indices for convenience - typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; - enum { dimWorld = GridView::dimensionworld }; + using Indices = typename GET_PROP_TYPE(TypeTag, Indices); enum { massBalanceIdx = Indices::massBalanceIdx, compTwoIdx = FluidSystem::N2Idx, @@ -199,12 +194,9 @@ class MaxwellStefanNCTestProblem : public NavierStokesProblem<TypeTag> }; using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); - - using Element = typename GridView::template Codim<0>::Entity; - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; + using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimensionworld>; using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); @@ -214,10 +206,9 @@ class MaxwellStefanNCTestProblem : public NavierStokesProblem<TypeTag> public: MaxwellStefanNCTestProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry), eps_(1e-6) + : ParentType(fvGridGeometry) { - name_ = getParam<std::string>("Problem.Name"); - plotOutput_ = false; + plotOutput_ = getParam<bool>("Problem.PlotOutput", false); } /*! @@ -225,21 +216,6 @@ public: */ // \{ - /*! - * \brief The problem name. - * - * This is used as a prefix for files generated by the simulation. - */ - std::string name() const - { - return name_; - } - - bool shouldWriteRestartFile() const - { - return false; - } - /*! * \brief Output the diffusion rates from left to right * @@ -251,7 +227,7 @@ public: */ void postTimeStep(const SolutionVector& curSol, const GridVariables& gridVariables, - Scalar time) + const Scalar time) { if (plotOutput_) @@ -372,10 +348,11 @@ public: BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const { BoundaryTypes values; - values.setAllNeumann(); // set Dirichlet values for the velocity everywhere values.setDirichlet(momentumBalanceIdx); - values.setDirichlet(massBalanceIdx); + values.setOutflow(compTwoIdx); + values.setOutflow(compThreeIdx); + values.setOutflow(massBalanceIdx); return values; } @@ -387,9 +364,7 @@ public: */ PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const { - PrimaryVariables values = initialAtPos(globalPos); - return values; - + return initialAtPos(globalPos); } /*! @@ -417,6 +392,7 @@ public: } initialValues[pressureIdx] = 1.1e+5; + initialValues[velocityXIdx] = 0.0; initialValues[velocityYIdx] = 0.0; return initialValues; @@ -424,37 +400,21 @@ public: private: - bool isInlet(const GlobalPosition& globalPos) const - { - return globalPos[0] < eps_; - } - - bool isOutlet(const GlobalPosition& globalPos) const - { - return globalPos[0] > this->bBoxMax()[0] - eps_; - } - - bool isWall(const GlobalPosition& globalPos) const - { - return globalPos[0] > eps_ || globalPos[0] < this->bBoxMax()[0] - eps_; - } - bool plotOutput_; const Scalar eps_{1e-6}; - std::string name_; - - Dumux::GnuplotInterface<double> gnuplot_; - Dumux::GnuplotInterface<double> gnuplot2_; - Dumux::GnuplotInterface<double> gnuplot3_; - - std::vector<double> x_; - std::vector<double> y_; - std::vector<double> y2_; - std::vector<double> y3_; - std::vector<double> y4_; - std::vector<double> y5_; - std::vector<double> y6_; + + Dumux::GnuplotInterface<Scalar> gnuplot_; + Dumux::GnuplotInterface<Scalar> gnuplot2_; + Dumux::GnuplotInterface<Scalar> gnuplot3_; + + std::vector<Scalar> x_; + std::vector<Scalar> y_; + std::vector<Scalar> y2_; + std::vector<Scalar> y3_; + std::vector<Scalar> y4_; + std::vector<Scalar> y5_; + std::vector<Scalar> y6_; }; } //end namespace diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 6ab3394118d662e5212d86fccb3b58ddb3a7ba34..80e7db07403491379c6aa1b76ae2f331f1d64799 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -176,6 +176,9 @@ int main(int argc, char** argv) try auto newtonController = std::make_shared<NewtonController>(timeLoop); NewtonMethod nonLinearSolver(newtonController, assembler, linearSolver); + //! set some check points for the time loop + timeLoop->setPeriodicCheckPoint(tEnd/5.0); + // time loop timeLoop->start(); do { @@ -209,8 +212,9 @@ int main(int argc, char** argv) try // advance to the time loop to the next step timeLoop->advanceTimeStep(); - // write vtk output - vtkWriter.write(timeLoop->time()); + // write vtk output on check points + if (timeLoop->isCheckPoint()) + vtkWriter.write(timeLoop->time()); // report statistics of this time step timeLoop->reportTimeStep();