https://mooseframework.inl.gov
INSFVAttributes.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "Attributes.h"
13 
14 enum class INSFVBCs
15 {
16  INSFVFlowBC = 1 << 1,
18  INSFVNoSlipWallBC = 1 << 3,
19  INSFVSlipWallBC = 1 << 4,
20  INSFVSymmetryBC = 1 << 5,
21  INSFVFreeSurfaceBC = 1 << 6
22 };
23 
24 #define clonefunc(T) \
25  virtual std::unique_ptr<Attribute> clone() const override \
26  { \
27  return std::unique_ptr<Attribute>(new T(*this)); \
28  }
29 
30 #define hashfunc(...) \
31  virtual size_t hash() const override \
32  { \
33  size_t h = 0; \
34  Moose::hash_combine(h, __VA_ARGS__); \
35  return h; \
36  }
37 
42 class AttribINSFVBCs : public Attribute
43 {
44 public:
45  typedef INSFVBCs Key;
46  void setFrom(Key k) { _val = static_cast<uint64_t>(k); }
47 
48  AttribINSFVBCs(TheWarehouse & w) : Attribute(w, "insfvbcs") {}
50  : Attribute(w, "insfvbcs"), _val(static_cast<uint64_t>(mask))
51  {
52  }
53  AttribINSFVBCs(TheWarehouse & w, unsigned int mask) : Attribute(w, "insfvbcs"), _val(mask) {}
54  virtual void initFrom(const MooseObject * obj) override;
55  virtual bool isMatch(const Attribute & other) const override;
56  virtual bool isEqual(const Attribute & other) const override;
57  hashfunc(_val);
59 
60 private:
61  uint64_t _val = 0;
62 };
63 
69 {
70 public:
71  typedef bool Key;
72  void setFrom(const Key k) { _val = k; }
74  : Attribute(w, "insfv_residual_object"), _val(false)
75  {
76  }
78  : Attribute(w, "insfv_residual_object"), _val(k)
79  {
80  }
81  void initFrom(const MooseObject * obj) override;
82  bool isMatch(const Attribute & other) const override;
83  bool isEqual(const Attribute & other) const override;
84  hashfunc(_val);
86 
87 private:
89 };
90 
91 #undef clonefunc
92 #undef hashfunc
AttribINSFVBCs(TheWarehouse &w, INSFVBCs mask)
An attribute specifying that a boundary condition is a member of a subset of boundary conditions appr...
bool isMatch(const Attribute &other) const override
An attribute specifying that an object is a residual object applicable to the Navier-Stokes momentum ...
virtual void initFrom(const MooseObject *obj) override
AttribINSFVBCs(TheWarehouse &w, unsigned int mask)
clonefunc(AttribINSFVBCs)
bool isEqual(const Attribute &other) const override
clonefunc(AttribINSFVMomentumResidualObject)
AttribINSFVBCs(TheWarehouse &w)
INSFVBCs
void setFrom(Key k)
virtual bool isEqual(const Attribute &other) const override
A parent class for boundary conditions for freely moving surfaces.
AttribINSFVMomentumResidualObject(TheWarehouse &w)
A class for no slip velocity boundary condtions.
A parent class for slip/no-slip wall boundary conditions.
A parent class for INSFV symmetry boundary conditions.
virtual bool isMatch(const Attribute &other) const override
AttribINSFVMomentumResidualObject(TheWarehouse &w, Key k)
void initFrom(const MooseObject *obj) override
A parent class for INSFV flow boundary conditions.
Definition: INSFVFlowBC.h:17
static const std::string k
Definition: NS.h:130
A parent class for INSFV fully developed flow boundary conditions.