NeoN
A framework for CFD software
Loading...
Searching...
No Matches
slip.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2023 - 2026 NeoN authors
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include <Kokkos_Core.hpp>
8
14
16{
17
18// Slip is a frictionless-wall boundary condition: scalar => zero-gradient, vector => tangential
19// projection + normal damping. It shares its implementation with Symmetry via
20// detail::setSlipSymmetryValue; the two differ only in the registered name and in where they may be
21// applied (slip on wall/patch types, symmetry on a symmetry-plane patch). The optional "implicit"
22// key selects the normal-damping treatment.
23template<typename ValueType>
24class Slip : public VolumeBoundaryFactory<ValueType>::template Register<Slip<ValueType>>
25{
27
28public:
29
30 using Base::correctBoundaryCondition;
31
33
34 Slip(const UnstructuredMesh& mesh, const Dictionary& dict, localIdx patchID)
35 : Base(
36 mesh,
37 dict,
38 patchID,
39 {.assignable = false,
40 .fixesValue = false,
41 .transformImplicit = detail::readTransformImplicit(dict)}
42 ),
43 mesh_(mesh), implicit_(detail::readTransformImplicit(dict))
44 {}
45
46 virtual void correctBoundaryCondition(Field<ValueType>& domainVector) final
47 {
49 domainVector, mesh_, this->range(), detail::normalDampingMode(implicit_)
50 );
51 }
52
53 static std::string name() { return "slip"; }
54
55 std::string getName() const override { return name(); }
56
57 static std::string doc()
58 {
59 return "Slip wall (scalar: zero-gradient; vector: tangential projection + normal damping).";
60 }
61
62 static std::string schema() { return "none"; }
63
64 virtual std::unique_ptr<VolumeBoundaryFactory<ValueType>> clone() const final
65 {
66 return std::make_unique<Slip>(*this);
67 }
68
69private:
70
71 const UnstructuredMesh& mesh_;
72 bool implicit_;
73};
74
75} // namespace NeoN::finiteVolume::cellCentred::volumeBoundary
A class representing a dictionary that stores key-value pairs.
Represents the domain fields for a computational domain.
Definition field.hpp:34
Represents an unstructured mesh in NeoN.
virtual std::unique_ptr< VolumeBoundaryFactory< ValueType > > clone() const final
Definition slip.hpp:64
Slip(const UnstructuredMesh &mesh, const Dictionary &dict, localIdx patchID)
Definition slip.hpp:34
virtual void correctBoundaryCondition(Field< ValueType > &domainVector) final
Definition slip.hpp:46
A template class for registering derived classes with a base class.
NormalDamping normalDampingMode(bool implicit)
Map the implicit flag onto the NormalDamping mode.
void setSlipSymmetryValue(Field< ValueType > &domainVector, const UnstructuredMesh &mesh, std::pair< localIdx, localIdx > range, NormalDamping mode)
bool readTransformImplicit(const Dictionary &dict)
Read the "implicit" flag from a slip/symmetry patch dictionary.
int32_t localIdx
Definition label.hpp:50