Quinoa all test code coverage report
Current view: top level - PDE/MultiMat/Problem - RichtmyerMeshkov.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 0 26 0.0 %
Date: 2024-04-22 13:03:21 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 12 0.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/MultiMat/Problem/RichtmyerMeshkov.cpp
       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 Problem policy class for the multi-material
      10                 :            :     compressible flow equations, defined in PDE/MultiMat/MultiMat.hpp. See
      11                 :            :     PDE/MultiMat/Problem.hpp for general requirements on Problem policy classes
      12                 :            :     for MultiMat.
      13                 :            : */
      14                 :            : // *****************************************************************************
      15                 :            : 
      16                 :            : #include "RichtmyerMeshkov.hpp"
      17                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      18                 :            : 
      19                 :            : namespace inciter {
      20                 :            : 
      21                 :            : extern ctr::InputDeck g_inputdeck;
      22                 :            : 
      23                 :            : } // ::inciter
      24                 :            : 
      25                 :            : using inciter::MultiMatProblemRichtmyerMeshkov;
      26                 :            : 
      27                 :            : tk::InitializeFn::result_type
      28                 :          0 : MultiMatProblemRichtmyerMeshkov::initialize( ncomp_t ncomp,
      29                 :            :   const std::vector< EOS >& mat_blk,
      30                 :            :   tk::real x, tk::real y, tk::real,
      31                 :            :   tk::real )
      32                 :            : // *****************************************************************************
      33                 :            : //! Evaluate analytical solution at (x,y,z,t) for all components
      34                 :            : //! \param[in] ncomp Number of scalar components in this PDE system
      35                 :            : //! \param[in] x X coordinate where to evaluate the solution
      36                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      37                 :            : //! \return Values of all components evaluated at (x,y,z,t)
      38                 :            : //! \note The function signature must follow tk::InitializeFn
      39                 :            : //! \details This function only initializes the Richtmyer-Meshkov instability
      40                 :            : //!   problem, but does not actually give the analytical solution at time
      41                 :            : //!   greater than 0.
      42                 :            : // *****************************************************************************
      43                 :            : {
      44                 :            :   // see also Control/Inciter/InputDeck/Grammar.hpp
      45                 :            :   Assert( ncomp == 9, "Number of scalar components must be 9" );
      46                 :            : 
      47                 :          0 :   auto nmat = g_inputdeck.get< eq, tag::nmat >();
      48                 :            : 
      49                 :          0 :   std::vector< tk::real > s( ncomp, 0.0 );
      50                 :            :   tk::real p, T, u, v, w;
      51                 :            :   auto alphamin = 1.0e-12;
      52                 :            : 
      53                 :            :   // unshocked state
      54                 :          0 :   p = 95600.0;
      55                 :          0 :   T = 296.0;
      56                 :          0 :   u = 0.0;
      57                 :          0 :   v = 0.0;
      58                 :          0 :   w = 0.0;
      59                 :          0 :   s[volfracIdx(nmat,0)] = 1.0-alphamin;
      60                 :            : 
      61                 :            :   // shocked state
      62         [ -  - ]:          0 :   if (x < 0.01) {
      63                 :          0 :     p = 145347.8785;
      64                 :          0 :     T = 324.6772971;
      65                 :          0 :     u = 101.2761625;
      66                 :            :   }
      67                 :            : 
      68                 :            :   // location of interface
      69                 :            :   auto pi = 4.0 * std::atan(1.0);
      70                 :            :   auto wvln = 0.059333;
      71                 :            :   auto ampl = 0.002;
      72         [ -  - ]:          0 :   if (x>0.03+ampl*std::sin(2.0*pi*y/wvln + pi/2.0)) {
      73                 :          0 :     s[volfracIdx(nmat,0)] = alphamin;
      74                 :            :   }
      75                 :            : 
      76                 :            :   // volume-fraction of 2nd material
      77                 :          0 :   s[volfracIdx(nmat, 1)] = 1.0 - s[volfracIdx(nmat, 0)];
      78                 :            : 
      79                 :            :   auto rb = 0.0;
      80         [ -  - ]:          0 :   for (std::size_t k=0; k<nmat; ++k) {
      81                 :            :     // density
      82         [ -  - ]:          0 :     auto r = mat_blk[k].compute< EOS::density >(p, T);
      83         [ -  - ]:          0 :     s[densityIdx(nmat, k)] = s[volfracIdx(nmat, k)]*r;
      84                 :          0 :     rb += s[densityIdx(nmat, k)];
      85                 :            :     // total specific energy
      86                 :          0 :     s[energyIdx(nmat, k)] = s[volfracIdx(nmat, k)]*
      87         [ -  - ]:          0 :       mat_blk[k].compute< EOS::totalenergy >( r, u, v, w, p );
      88                 :            :   }
      89                 :            :   // momentum
      90                 :          0 :   s[momentumIdx(nmat, 0)] = rb*u;
      91                 :          0 :   s[momentumIdx(nmat, 1)] = rb*v;
      92                 :          0 :   s[momentumIdx(nmat, 2)] = rb*w;
      93                 :            : 
      94                 :          0 :   return s;
      95                 :            : }

Generated by: LCOV version 1.14