Quinoa regression test code coverage report
Current view: top level - PDE/CompFlow/Problem - VorticalFlow.hpp (source / functions) Hit Total Coverage
Commit: Quinoa_v0.3-957-gb4f0efae0 Lines: 13 13 100.0 %
Date: 2021-11-11 13:17:06 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/CompFlow/Problem/VorticalFlow.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 single-material compressible flow
       9                 :            :     equations
      10                 :            :   \details   This file defines a Problem policy class for the single-material
      11                 :            :     compressible flow equations, defined under PDE/CompFlow/. See
      12                 :            :     PDE/CompFlow/Problem.h for general requirements on Problem policy classes
      13                 :            :     for CompFlow.
      14                 :            : */
      15                 :            : // *****************************************************************************
      16                 :            : #ifndef CompFlowProblemVorticalFlow_h
      17                 :            : #define CompFlowProblemVorticalFlow_h
      18                 :            : 
      19                 :            : #include <string>
      20                 :            : #include <unordered_set>
      21                 :            : 
      22                 :            : #include "Types.hpp"
      23                 :            : #include "Fields.hpp"
      24                 :            : #include "FunctionPrototypes.hpp"
      25                 :            : #include "SystemComponents.hpp"
      26                 :            : #include "Inciter/Options/Problem.hpp"
      27                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      28                 :            : #include "EoS/EoS.hpp"
      29                 :            : 
      30                 :            : namespace inciter {
      31                 :            : 
      32                 :            : extern ctr::InputDeck g_inputdeck;
      33                 :            : 
      34                 :            : //! CompFlow system of PDEs problem: vortical flow
      35                 :            : //! \see Waltz, et. al, "Manufactured solutions for the three-dimensional Euler
      36                 :            : //!   equations with relevance to Inertial Confinement Fusion", Journal of
      37                 :            : //!   Computational Physics 267 (2014) 196-209.
      38                 :            : class CompFlowProblemVorticalFlow {
      39                 :            : 
      40                 :            :   private:
      41                 :            :     using ncomp_t = tk::ctr::ncomp_t;
      42                 :            :     using eq = tag::compflow;
      43                 :            : 
      44                 :            :   public:
      45                 :            :     //! Initialize numerical solution
      46                 :            :     static tk::InitializeFn::result_type
      47                 :            :     initialize( ncomp_t system, ncomp_t, tk::real x, tk::real y,
      48                 :            :                 tk::real z, tk::real );
      49                 :            : 
      50                 :            :     //! Evaluate analytical solution at (x,y,z) for all components
      51                 :            :     static tk::InitializeFn::result_type
      52                 :            :     analyticSolution( ncomp_t system, ncomp_t, tk::real x, tk::real y,
      53                 :            :                       tk::real z, tk::real );
      54                 :            : 
      55                 :            :     //! Compute and return source term for vortical flow manufactured solution
      56                 :            :     //! \param[in] system Equation system index, i.e., which compressible
      57                 :            :     //!   flow equation system we operate on among the systems of PDEs
      58                 :            :     //! \param[in] x X coordinate where to evaluate the solution
      59                 :            :     //! \param[in] y Y coordinate where to evaluate the solution
      60                 :            :     //! \param[in] z Z coordinate where to evaluate the solution
      61                 :            :     //! \param[in,out] r Density source
      62                 :            :     //! \param[in,out] ru X momentum source
      63                 :            :     //! \param[in,out] rv Y momentum source
      64                 :            :     //! \param[in,out] rw Z momentum source
      65                 :            :     //! \param[in,out] re Specific total energy source
      66                 :            :     //! \note The function signature must follow tk::SrcFn
      67                 :            :     static tk::CompFlowSrcFn::result_type
      68                 :   12047190 :     src( ncomp_t system, tk::real x, tk::real y, tk::real z, tk::real,
      69                 :            :          tk::real& r, tk::real& ru, tk::real& rv, tk::real& rw, tk::real& re )
      70                 :            :     {
      71                 :            :       using tag::param; using tag::compflow;
      72                 :            : 
      73                 :            :       // manufactured solution parameters
      74                 :            :       const auto& a =
      75                 :   12047190 :         g_inputdeck.get< param, compflow, tag::alpha >()[ system ];
      76                 :   12047190 :       const auto& b = g_inputdeck.get< param, compflow, tag::beta >()[ system ];
      77                 :            :       // ratio of specific heats
      78         [ +  - ]:   12047190 :       tk::real g = gamma< tag::compflow >(system);
      79                 :            :       // evaluate solution at x,y,z
      80         [ +  - ]:   12047190 :       auto s = initialize( system, 5, x, y, z, 0.0 );
      81                 :            : 
      82                 :            :       // density source
      83                 :   12047190 :       r = 0.0;
      84                 :            :       // momentum source
      85                 :   12047190 :       ru = a*s[1]/s[0] - b*s[2]/s[0];
      86                 :   12047190 :       rv = b*s[1]/s[0] + a*s[2]/s[0];
      87                 :   12047190 :       rw = 0.0;
      88                 :            :       // energy source
      89                 :   12047190 :       re = (ru*s[1] + rv*s[2])/s[0] + 8.0*a*a*a*z*z/(g-1.0);
      90                 :   12047190 :     }
      91                 :            : 
      92                 :            :     //! Return analytic field names to be output to file
      93                 :            :     std::vector< std::string > analyticFieldNames( ncomp_t ) const;
      94                 :            : 
      95                 :            :     //! Return names of integral variables to be output to diagnostics file
      96                 :            :     std::vector< std::string > names( ncomp_t ) const;
      97                 :            : 
      98                 :            :     //! Return problem type
      99                 :       4695 :     static ctr::ProblemType type() noexcept
     100                 :       4695 :     { return ctr::ProblemType::VORTICAL_FLOW; }
     101                 :            : };
     102                 :            : 
     103                 :            : } // inciter::
     104                 :            : 
     105                 :            : #endif // CompFlowProblemVorticalFlow_h

Generated by: LCOV version 1.14