Quinoa all test code coverage report
Current view: top level - PDE/CompFlow/Problem - VorticalFlow.hpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 11 11 100.0 %
Date: 2024-11-22 09:12:55 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 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 "Inciter/Options/Problem.hpp"
      26                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      27                 :            : #include "EoS/GetMatProp.hpp"
      28                 :            : 
      29                 :            : namespace inciter {
      30                 :            : 
      31                 :            : extern ctr::InputDeck g_inputdeck;
      32                 :            : 
      33                 :            : //! CompFlow system of PDEs problem: vortical flow
      34                 :            : //! \see Waltz, et. al, "Manufactured solutions for the three-dimensional Euler
      35                 :            : //!   equations with relevance to Inertial Confinement Fusion", Journal of
      36                 :            : //!   Computational Physics 267 (2014) 196-209.
      37                 :            : class CompFlowProblemVorticalFlow {
      38                 :            : 
      39                 :            :   private:
      40                 :            :     using ncomp_t = tk::ncomp_t;
      41                 :            :     using eq = tag::compflow;
      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 z, tk::real );
      48                 :            : 
      49                 :            :     //! Evaluate analytical solution at (x,y,z) for all components
      50                 :            :     static tk::InitializeFn::result_type
      51                 :            :     analyticSolution( ncomp_t, const std::vector< EOS >&,
      52                 :            :                       tk::real x, tk::real y, tk::real z, tk::real );
      53                 :            : 
      54                 :            :     //! Compute and return source term for vortical flow manufactured solution
      55                 :            :     //! \param[in] x X coordinate where to evaluate the solution
      56                 :            :     //! \param[in] y Y coordinate where to evaluate the solution
      57                 :            :     //! \param[in] z Z coordinate where to evaluate the solution
      58                 :            :     //! \param[in,out] sv Source term vector
      59                 :            :     //! \note The function signature must follow tk::SrcFn
      60                 :            :     static tk::SrcFn::result_type
      61                 :    9123540 :     src( ncomp_t, const std::vector< EOS >& mat_blk,
      62                 :            :          tk::real x, tk::real y, tk::real z, tk::real,
      63                 :            :          std::vector< tk::real >& sv )
      64                 :            :     {
      65                 :            :       Assert(sv.size() == 5, "Incorrect source vector size");
      66                 :            : 
      67                 :            :       // manufactured solution parameters
      68                 :    9123540 :       auto a = g_inputdeck.get< eq, tag::alpha >();
      69                 :    9123540 :       auto b = g_inputdeck.get< eq, tag::beta >();
      70                 :            :       // ratio of specific heats
      71                 :    9123540 :       tk::real g = getmatprop< tag::gamma >();
      72                 :            :       // evaluate solution at x,y,z
      73                 :    9123540 :       auto s = initialize( 5, mat_blk, x, y, z, 0.0 );
      74                 :            : 
      75                 :            :       // density source
      76                 :    9123540 :       sv[0] = 0.0;
      77                 :            :       // momentum source
      78                 :    9123540 :       sv[1] = a*s[1]/s[0] - b*s[2]/s[0];
      79                 :    9123540 :       sv[2] = b*s[1]/s[0] + a*s[2]/s[0];
      80                 :    9123540 :       sv[3] = 0.0;
      81                 :            :       // energy source
      82                 :    9123540 :       sv[4] = (sv[1]*s[1] + sv[2]*s[2])/s[0] + 8.0*a*a*a*z*z/(g-1.0);
      83                 :    9123540 :     }
      84                 :            : 
      85                 :            :     //! Return analytic field names to be output to file
      86                 :            :     std::vector< std::string > analyticFieldNames( ncomp_t ) const;
      87                 :            : 
      88                 :            :     //! Return names of integral variables to be output to diagnostics file
      89                 :            :     std::vector< std::string > names( ncomp_t ) const;
      90                 :            : 
      91                 :            :     //! Return problem type
      92                 :            :     static ctr::ProblemType type() noexcept
      93                 :            :     { return ctr::ProblemType::VORTICAL_FLOW; }
      94                 :            : };
      95                 :            : 
      96                 :            : } // inciter::
      97                 :            : 
      98                 :            : #endif // CompFlowProblemVorticalFlow_h

Generated by: LCOV version 1.14