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 "Inciter/Options/Problem.hpp" 24 : : #include "EoS/EOS.hpp" 25 : : #include "Inciter/InputDeck/InputDeck.hpp" 26 : : 27 : : namespace inciter { 28 : : 29 : : //! CompFlow system of PDEs problem: Taylor-Green 30 : : //! \see G.I. Taylor, A.E. Green, "Mechanism of the Production of Small Eddies 31 : : //! from Large Ones", Proc. R. Soc. Lond. A 1937 158 499-521; DOI: 32 : : //! 10.1098/rspa.1937.0036. Published 3 February 1937 33 : : //! \see Waltz, et. al, "Verification of a three-dimensional unstructured finite 34 : : //! element method using analytic and manufactured solutions", Computers and 35 : : //! Fluids, 2013, Vol.81, pp.57-67. 36 : : class CompFlowProblemTaylorGreen { 37 : : 38 : : private: 39 : : using ncomp_t = tk::ncomp_t; 40 : : using eq = tag::compflow; 41 : : static constexpr ncomp_t m_ncomp = 5; //!< Number of scalar components 42 : : 43 : : public: 44 : : //! Initialize numerical solution 45 : : static tk::InitializeFn::result_type 46 : : initialize( ncomp_t, const std::vector< EOS >&, 47 : : tk::real x, tk::real y, tk::real, tk::real ); 48 : : 49 : : //! Evaluate analytical solution at (x,y,z,t) for all components 50 : : static tk::InitializeFn::result_type 51 : : analyticSolution( ncomp_t, 52 : : const std::vector< EOS >&, tk::real x, tk::real y, 53 : : tk::real, tk::real ); 54 : : 55 : : //! Compute and return source term for Rayleigh-Taylor manufactured solution 56 : : //! \param[in] x X coordinate where to evaluate the source 57 : : //! \param[in] y Y coordinate where to evaluate the source 58 : : //! \param[in,out] sv Source term vector 59 : : //! \note The function signature must follow tk::SrcFn 60 : : static tk::SrcFn::result_type 61 : 4730400 : src( ncomp_t, const std::vector< EOS >&, tk::real x, 62 : : tk::real y, tk::real, tk::real, std::vector< tk::real >& sv ) 63 : : { 64 : : Assert(sv.size() == 5, "Incorrect source vector size"); 65 : 4730400 : sv[0] = sv[1] = sv[2] = sv[3] = 0.0; 66 : 4730400 : sv[4] = 3.0*M_PI/8.0*( cos(3.0*M_PI*x)*cos(M_PI*y) 67 : 4730400 : - cos(3.0*M_PI*y)*cos(M_PI*x) ); 68 : 4730400 : } 69 : : 70 : : //! Return field names to be output to file 71 : : std::vector< std::string > analyticFieldNames( ncomp_t ) const; 72 : : 73 : : //! Return names of integral variables to be output to diagnostics file 74 : : std::vector< std::string > names( ncomp_t ) const; 75 : : 76 : : //! Return problem type 77 : : static ctr::ProblemType type() noexcept 78 : : { return ctr::ProblemType::TAYLOR_GREEN; } 79 : : }; 80 : : 81 : : } // inciter:: 82 : : 83 : : #endif // CompFlowProblemTaylorGreen_h