Quinoa all test code coverage report
Current view: top level - PDE/MultiMat/Problem - ShockHeBubble.cpp (source / functions) Hit Total Coverage
Commit: -128-NOTFOUND Lines: 0 29 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 22 0.0 %

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/MultiMat/Problem/ShockHeBubble.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 multi-material flow equations
       9                 :            :   \details   This file defines a Problem policy class for the multi-material
      10                 :            :     compressible flow equations, defined in PDE/MultiMat/DGMultiMat.hpp. See
      11                 :            :     PDE/MultiMat/Problem.hpp for general requirements on Problem policy classes
      12                 :            :     for MultiMat.
      13                 :            : */
      14                 :            : // *****************************************************************************
      15                 :            : 
      16                 :            : #include "ShockHeBubble.hpp"
      17                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      18                 :            : #include "MultiMat/MultiMatIndexing.hpp"
      19                 :            : 
      20                 :            : namespace inciter {
      21                 :            : 
      22                 :            : extern ctr::InputDeck g_inputdeck;
      23                 :            : 
      24                 :            : } // ::inciter
      25                 :            : 
      26                 :            : using inciter::MultiMatProblemShockHeBubble;
      27                 :            : 
      28                 :            : tk::InitializeFn::result_type
      29                 :          0 : MultiMatProblemShockHeBubble::initialize( ncomp_t ncomp,
      30                 :            :                                           const std::vector< EOS >& mat_blk,
      31                 :            :                                           tk::real x,
      32                 :            :                                           tk::real y,
      33                 :            :                                           tk::real z,
      34                 :            :                                           tk::real )
      35                 :            : // *****************************************************************************
      36                 :            : //! Evaluate analytical solution at (x,y,z,t) for all components
      37                 :            : //! \param[in] ncomp Number of scalar components in this PDE system
      38                 :            : //! \param[in] x X coordinate where to evaluate the solution
      39                 :            : //! \param[in] y Y coordinate where to evaluate the solution
      40                 :            : //! \param[in] z Z coordinate where to evaluate the solution
      41                 :            : //! \return Values of all components evaluated at (x)
      42                 :            : //! \note The function signature must follow tk::InitializeFn
      43                 :            : //! \details This function only initializes the shock He-bubble interaction
      44                 :            : //!   problem, but does not actually give the analytical solution at time
      45                 :            : //!   greater than 0.
      46                 :            : // *****************************************************************************
      47                 :            : {
      48                 :            :   // see also Control/Inciter/InputDeck/Grammar.hpp
      49                 :            :   Assert( ncomp == 9, "Number of scalar components must be 9" );
      50                 :            : 
      51                 :          0 :   auto nmat = g_inputdeck.get< eq, tag::nmat >();
      52                 :            : 
      53 [ -  - ][ -  - ]:          0 :   std::vector< tk::real > s(ncomp, 0.0), r(nmat, 0.0);
      54                 :            :   tk::real p, u, v, w, temp;
      55                 :            :   auto alphamin = 1.0e-12;
      56                 :            : 
      57                 :            :   // pre-shock state
      58                 :          0 :   s[volfracIdx(nmat, 0)] = alphamin;
      59                 :          0 :   s[volfracIdx(nmat, 1)] = 1.0-alphamin;
      60                 :          0 :   p = 1.0e5;
      61                 :          0 :   u = 0.0;
      62                 :          0 :   v = 0.0;
      63                 :          0 :   w = 0.0;
      64                 :          0 :   temp = 248.88;
      65                 :            : 
      66                 :            :   // post-shock state
      67         [ -  - ]:          0 :   if (x >= 0.2125) {
      68                 :            :     // volume-fraction
      69                 :          0 :     s[volfracIdx(nmat, 0)] = alphamin;
      70                 :            :     s[volfracIdx(nmat, 1)] = 1.0-alphamin;
      71                 :            :     // pressure
      72                 :          0 :     p = 1.5698e5;
      73                 :            :     // velocity
      74                 :          0 :     u = -113.5;
      75                 :            :     // temperature
      76                 :          0 :     temp = 283.86;
      77                 :            :   }
      78                 :            : 
      79                 :            :   // bubble
      80                 :          0 :   auto radb = std::sqrt((x-0.1725)*(x-0.1725) + y*y + z*z);
      81         [ -  - ]:          0 :   if (radb <= 0.025) {
      82                 :            :     // volume-fraction
      83                 :          0 :     s[volfracIdx(nmat, 0)] = 1.0-alphamin;
      84                 :          0 :     s[volfracIdx(nmat, 1)] = alphamin;
      85                 :            :   }
      86                 :            : 
      87                 :            :   auto rb(0.0);
      88         [ -  - ]:          0 :   for (std::size_t k=0; k<nmat; ++k)
      89                 :            :   {
      90                 :            :     // densities
      91 [ -  - ][ -  - ]:          0 :     r[k] = mat_blk[k].compute< EOS::density >( p, temp );
      92                 :            :     // partial density
      93         [ -  - ]:          0 :     s[densityIdx(nmat, k)] = s[volfracIdx(nmat, k)]*r[k];
      94                 :            :     // total specific energy
      95                 :          0 :     s[energyIdx(nmat, k)] = s[volfracIdx(nmat, k)]*
      96         [ -  - ]:          0 :       mat_blk[k].compute< EOS::totalenergy >( r[k], u, v, w, p );
      97                 :          0 :     rb += s[densityIdx(nmat, k)];
      98                 :            :   }
      99                 :            : 
     100         [ -  - ]:          0 :   s[momentumIdx(nmat, 0)] = rb * u;
     101                 :          0 :   s[momentumIdx(nmat, 1)] = rb * v;
     102         [ -  - ]:          0 :   s[momentumIdx(nmat, 2)] = rb * w;
     103                 :            : 
     104                 :          0 :   return s;
     105                 :            : }

Generated by: LCOV version 1.14