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

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/PDE/MultiMat/Problem/EquilInterfaceAdvect.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 equilibrium interface advection
       9                 :            :   \details   This file defines a policy class for the multi-material
      10                 :            :     compressible flow equations, defined in PDE/MultiMat/MultiMat.hpp.
      11                 :            :     See PDE/MultiMat/Problem.hpp for general requirements on Problem policy
      12                 :            :     classes for MultiMat.
      13                 :            : */
      14                 :            : // *****************************************************************************
      15                 :            : #ifndef MultiMatProblemEquilInterfaceAdvect_h
      16                 :            : #define MultiMatProblemEquilInterfaceAdvect_h
      17                 :            : 
      18                 :            : #include <string>
      19                 :            : 
      20                 :            : #include "Types.hpp"
      21                 :            : #include "Fields.hpp"
      22                 :            : #include "Vector.hpp"
      23                 :            : #include "FunctionPrototypes.hpp"
      24                 :            : #include "Inciter/Options/Problem.hpp"
      25                 :            : #include "Inciter/InputDeck/InputDeck.hpp"
      26                 :            : #include "MultiMat/MultiMatIndexing.hpp"
      27                 :            : #include "EoS/EOS.hpp"
      28                 :            : 
      29                 :            : namespace inciter {
      30                 :            : 
      31                 :            : //! MultiMat system of PDEs problem: equilibrium interface advection
      32                 :            : class MultiMatProblemEquilInterfaceAdvect {
      33                 :            : 
      34                 :            :   protected:
      35                 :            :     using ncomp_t = tk::ncomp_t;
      36                 :            :     using eq = tag::multimat;
      37                 :            : 
      38                 :            :   public:
      39                 :            :     //! Initialize numerical solution
      40                 :            :     static tk::InitializeFn::result_type
      41                 :            :     initialize( ncomp_t ncomp, const std::vector< EOS >&,
      42                 :            :                 tk::real x, tk::real, tk::real, tk::real );
      43                 :            : 
      44                 :            :     //! Evaluate analytical solution at (x,y,z,t) for all components
      45                 :            :     static std::vector< tk::real >
      46                 :            :     analyticSolution( ncomp_t ncomp,
      47                 :            :                       const std::vector< EOS >& mat_blk, tk::real x,
      48                 :            :                       tk::real y, tk::real z, tk::real t )
      49                 :          0 :     { return initialize( ncomp, mat_blk, x, y, z, t ); }
      50                 :            : 
      51                 :            :     //! Compute and return source term for this problem
      52                 :            :     static tk::SrcFn::result_type
      53                 :          0 :     src( ncomp_t nmat, const std::vector< EOS >& mat_blk,
      54                 :            :          tk::real x, tk::real y, tk::real z, tk::real t,
      55                 :            :          std::vector< tk::real >& sv )
      56                 :            :     {
      57                 :          0 :       auto ncomp = 3*nmat+3;
      58                 :            :       Assert(sv.size() == ncomp, "Incorrect source vector size");
      59                 :            : 
      60                 :            :       // solution at given location and time
      61                 :          0 :       auto s = initialize(ncomp, mat_blk, x, y, z, t);
      62                 :            :       tk::real rhob(0.0);
      63         [ -  - ]:          0 :       for (std::size_t k=0; k<nmat; ++k) {
      64                 :          0 :         rhob += s[densityIdx(nmat,k)];
      65                 :            :       }
      66                 :          0 :       std::array< tk::real, 3 > u0 {{s[momentumIdx(nmat,0)]/rhob,
      67                 :          0 :         s[momentumIdx(nmat,1)]/rhob, s[momentumIdx(nmat,2)]/rhob}};
      68                 :            :       tk::real umag2 = tk::dot(u0, u0);
      69                 :            : 
      70                 :            :       // source terms
      71         [ -  - ]:          0 :       for (std::size_t i=0; i<3; ++i) {
      72                 :          0 :         sv[momentumIdx(nmat,i)] = 0.0;
      73                 :            :       }
      74         [ -  - ]:          0 :       for (std::size_t k=0; k<nmat; ++k) {
      75                 :          0 :         sv[volfracIdx(nmat,k)] = 0.0;
      76                 :          0 :         sv[densityIdx(nmat,k)] = (u0[0]+u0[1]+u0[2]) * s[volfracIdx(nmat,k)];
      77         [ -  - ]:          0 :         for (std::size_t i=0; i<3; ++i) {
      78                 :          0 :           sv[momentumIdx(nmat,i)] += u0[i] * sv[densityIdx(nmat,k)];
      79                 :            :         }
      80                 :          0 :         sv[energyIdx(nmat,k)] = 0.5 * umag2 * sv[densityIdx(nmat,k)];
      81                 :            :       }
      82                 :          0 :     }
      83                 :            : 
      84                 :            :     //! Return problem type
      85                 :            :     static ctr::ProblemType type() noexcept
      86                 :            :     { return ctr::ProblemType::EQUILINTERFACE_ADVECT; }
      87                 :            : };
      88                 :            : 
      89                 :            : } // inciter::
      90                 :            : 
      91                 :            : #endif // MultiMatProblemEquilInterfaceAdvect_h

Generated by: LCOV version 1.14