Nektar++
Loading...
Searching...
No Matches
BndCondSlipWallCFEKernels.hpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: BndCondSlipWallCFEKernels.hpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Block kernels of the inviscid slip wall boundary condition.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#pragma once
36
38
39namespace Nektar::detail
40{
41
42/**
43 * @brief Mirror the momentum about the boundary plane.
44 *
45 * The caller has put the interior trace in the storage, so this works
46 * pointwise on values already in the right place and orientation. Density
47 * and energy pass through: only the normal component of the momentum is
48 * reversed, which is what leaves the averaged normal velocity zero and the
49 * tangential velocity free.
50 */
51template <typename ExecSpace, typename TData>
53 const size_t stride, const unsigned coordDim, const TData *norms,
54 TData *bndPtr, const unsigned int streamID = 0)
55{
57
58 Nektar::parallel_for<ExecSpace>(
59 0u, stride, NEKTAR_LAMBDA(const size_t i) {
60 TData momDotN = TData(0.0);
61 for (unsigned d = 1; d <= coordDim; ++d)
62 {
63 momDotN += bndPtr[d * stride + i] * norms[(d - 1) * stride + i];
64 }
65
66 for (unsigned d = 1; d <= coordDim; ++d)
67 {
68 bndPtr[d * stride + i] -=
69 TData(2.0) * momDotN * norms[(d - 1) * stride + i];
70 }
71 });
72
74}
75
76} // namespace Nektar::detail
#define NEKTAR_LAMBDA
#define NEK_FORCE_INLINE
Definition NekInline.hpp:46
static NEK_FORCE_INLINE void MirrorNormalMomentumBlock(const size_t stride, const unsigned coordDim, const TData *norms, TData *bndPtr, const unsigned int streamID=0)
Mirror the momentum about the boundary plane.
static void LoopExecutionSetStreamID(const unsigned int streamID)