Branch data Line data Source code
1 : : // ***************************************************************************** 2 : : /*! 3 : : \file src/PDE/CompFlow/Problem/TaylorGreen.hpp 4 : : \copyright 2012-2015 J. Bakosi, 5 : : 2016-2018 Los Alamos National Security, LLC., 6 : : 2019-2021 Triad National Security, LLC. 7 : : All rights reserved. See the LICENSE file for details. 8 : : \brief Problem configuration for the compressible flow equations 9 : : \details This file defines a policy class for the compressible flow 10 : : equations, defined in PDE/CompFlow/CompFlow.h. See PDE/CompFlow/Problem.h 11 : : for general requirements on Problem policy classes for CompFlow. 12 : : */ 13 : : // ***************************************************************************** 14 : : #ifndef CompFlowProblemTaylorGreen_h 15 : : #define CompFlowProblemTaylorGreen_h 16 : : 17 : : #include <string> 18 : : #include <unordered_set> 19 : : 20 : : #include "Types.hpp" 21 : : #include "Fields.hpp" 22 : : #include "FunctionPrototypes.hpp" 23 : : #include "SystemComponents.hpp" 24 : : #include "Inciter/Options/Problem.hpp" 25 : : 26 : : namespace inciter { 27 : : 28 : : //! CompFlow system of PDEs problem: Taylor-Green 29 : : //! \see G.I. Taylor, A.E. Green, "Mechanism of the Production of Small Eddies 30 : : //! from Large Ones", Proc. R. Soc. Lond. A 1937 158 499-521; DOI: 31 : : //! 10.1098/rspa.1937.0036. Published 3 February 1937 32 : : //! \see Waltz, et. al, "Verification of a three-dimensional unstructured finite 33 : : //! element method using analytic and manufactured solutions", Computers and 34 : : //! Fluids, 2013, Vol.81, pp.57-67. 35 : : class CompFlowProblemTaylorGreen { 36 : : 37 : : private: 38 : : using ncomp_t = tk::ctr::ncomp_t; 39 : : using eq = tag::compflow; 40 : : static constexpr ncomp_t m_ncomp = 5; //!< Number of scalar components 41 : : 42 : : public: 43 : : //! Initialize numerical solution 44 : : static tk::InitializeFn::result_type 45 : : initialize( ncomp_t system, ncomp_t, 46 : : tk::real x, tk::real y, tk::real, tk::real ); 47 : : 48 : : //! Evaluate analytical solution at (x,y,z,t) for all components 49 : : static tk::InitializeFn::result_type 50 : : analyticSolution( ncomp_t system, ncomp_t, tk::real x, tk::real y, tk::real, 51 : : tk::real ); 52 : : 53 : : //! Compute and return source term for Rayleigh-Taylor manufactured solution 54 : : //! \param[in] x X coordinate where to evaluate the source 55 : : //! \param[in] y Y coordinate where to evaluate the source 56 : : //! \param[in,out] r Density source 57 : : //! \param[in,out] ru X momentum source 58 : : //! \param[in,out] rv Y momentum source 59 : : //! \param[in,out] rw Z momentum source 60 : : //! \param[in,out] re Specific total energy source 61 : : //! \note The function signature must follow tk::SrcFn 62 : : static tk::CompFlowSrcFn::result_type 63 : 5781600 : src( ncomp_t, tk::real x, tk::real y, tk::real, tk::real, 64 : : tk::real& r, tk::real& ru, tk::real& rv, tk::real& rw, tk::real& re ) 65 : : { 66 : 5781600 : r = ru = rv = rw = 0.0; 67 : 5781600 : re = 3.0*M_PI/8.0*( cos(3.0*M_PI*x)*cos(M_PI*y) 68 : 5781600 : - cos(3.0*M_PI*y)*cos(M_PI*x) ); 69 : 5781600 : } 70 : : 71 : : //! Return field names to be output to file 72 : : std::vector< std::string > analyticFieldNames( ncomp_t ) const; 73 : : 74 : : //! Return names of integral variables to be output to diagnostics file 75 : : std::vector< std::string > names( ncomp_t ) const; 76 : : 77 : : //! Return problem type 78 : 4695 : static ctr::ProblemType type() noexcept 79 : 4695 : { return ctr::ProblemType::TAYLOR_GREEN; } 80 : : }; 81 : : 82 : : } // inciter:: 83 : : 84 : : #endif // CompFlowProblemTaylorGreen_h