/home/runner/work/kynema-sgf/kynema-sgf/src/equation_systems/vof/vof_bciface.H Source File

Kynema-SGF API: /home/runner/work/kynema-sgf/kynema-sgf/src/equation_systems/vof/vof_bciface.H Source File
Kynema-SGF API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
vof_bciface.H
Go to the documentation of this file.
1#ifndef VOF_BCIFACE_H
2#define VOF_BCIFACE_H
3
5
6namespace kynema_sgf {
7
11
12class BCVOF : public BCIface
13{
14public:
15 explicit BCVOF(Field& field) : BCIface(field) {}
16
17protected:
18 // Only the process of reading BCs needs to be modified
19 void set_bcrec() override
20 {
21 const auto& ibctype = m_field.bc_type();
22
23 for (amrex::OrientationIter oit; oit != nullptr; ++oit) {
24 auto ori = oit();
25 const auto side = ori.faceDir();
26 const auto bct = ibctype[ori];
27 const int dir = ori.coordDir();
28
29 switch (bct) {
30 case BC::periodic:
31 if (side == amrex::Orientation::low) {
32 set_bcrec_lo(dir, amrex::BCType::int_dir);
33 } else {
34 set_bcrec_hi(dir, amrex::BCType::int_dir);
35 }
36 break;
37
38 // For the wall cases, the fillpatch BC is effectively a
39 // contact-line model
44 case BC::slip_wall:
45 case BC::wall_model:
46 if (side == amrex::Orientation::low) {
47 set_bcrec_lo(dir, amrex::BCType::foextrap);
48 } else {
49 set_bcrec_hi(dir, amrex::BCType::foextrap);
50 }
51 break;
52
53 // Never do hoextrap because it is unbounded
54
56 case BC::mass_inflow:
58 if (side == amrex::Orientation::low) {
59 set_bcrec_lo(dir, amrex::BCType::ext_dir);
60 } else {
61 set_bcrec_hi(dir, amrex::BCType::ext_dir);
62 }
63 break;
64
65 // Fixed gradient BC is not allowed for VOF
67 default:
68 amrex::Abort(
69 "Invalid BC type for VOF encountered: fixed_gradient");
70 }
71 }
72 }
73 amrex::Array<const std::string, 3> inflow_udfs() override
74 {
75 return {"ConstDirichlet", "ConstDirichlet", "ConstDirichlet"};
76 }
77
78 void read_values() override { read_inflow_values(); }
79};
80
81class BCDensityMod : public BCIface
82{
83public:
84 explicit BCDensityMod(Field& field) : BCIface(field) {}
85
86protected:
87 void set_bcrec() override
88 {
89 const auto& ibctype = m_field.bc_type();
90
91 for (amrex::OrientationIter oit; oit != nullptr; ++oit) {
92 auto ori = oit();
93 const auto side = ori.faceDir();
94 const auto bct = ibctype[ori];
95 const int dir = ori.coordDir();
96
97 switch (bct) {
98 case BC::periodic:
99 if (side == amrex::Orientation::low) {
100 set_bcrec_lo(dir, amrex::BCType::int_dir);
101 } else {
102 set_bcrec_hi(dir, amrex::BCType::int_dir);
103 }
104 break;
105
106 // Both extrapolations are consistent between vof and density
109 case BC::no_slip_wall:
111 case BC::slip_wall:
112 case BC::wall_model:
113 if (side == amrex::Orientation::low) {
114 set_bcrec_lo(dir, amrex::BCType::foextrap);
115 } else {
116 set_bcrec_hi(dir, amrex::BCType::foextrap);
117 }
118 break;
119
120 // Never do hoextrap because it is unbounded
121
123 case BC::mass_inflow:
125 if (side == amrex::Orientation::low) {
126 set_bcrec_lo(dir, amrex::BCType::ext_dir);
127 } else {
128 set_bcrec_hi(dir, amrex::BCType::ext_dir);
129 }
130 break;
131
133 default:
134 amrex::Abort(
135 "Invalid BC type for density (vof-compatible) encountered: "
136 "fixed_gradient");
137 }
138 }
139 }
140
141 amrex::Array<const std::string, 3> inflow_udfs() override
142 {
143 return {"ConstDirichlet", "ConstDirichlet", "ConstDirichlet"};
144 }
145
146 void read_values() override { read_inflow_values(); }
147};
148
149} // namespace kynema_sgf
150
151#endif /* VOF_BCIFACE_H */
void read_values() override
Read input data for specific fields based on BC types.
Definition vof_bciface.H:146
amrex::Array< const std::string, 3 > inflow_udfs() override
Definition vof_bciface.H:141
void set_bcrec() override
Setup AMReX mathematical BC types.
Definition vof_bciface.H:87
BCDensityMod(Field &field)
Definition vof_bciface.H:84
void set_bcrec_hi(int dir, amrex::BCType::mathematicalBndryTypes bcrec)
Set AMReX mathematical boundary types for the upper boundaries.
Definition BCInterface.H:100
void set_bcrec_lo(int dir, amrex::BCType::mathematicalBndryTypes bcrec)
Set AMReX mathematical boundary types for the lower boundaries.
Definition BCInterface.H:91
Field & m_field
Field instance where BC is being set.
Definition BCInterface.H:109
BCIface(Field &field)
Definition BCInterface.cpp:14
void read_inflow_values()
Definition BCInterface.cpp:344
void read_values() override
Read input data for specific fields based on BC types.
Definition vof_bciface.H:78
void set_bcrec() override
Setup AMReX mathematical BC types.
Definition vof_bciface.H:19
amrex::Array< const std::string, 3 > inflow_udfs() override
Definition vof_bciface.H:73
BCVOF(Field &field)
Definition vof_bciface.H:15
Definition Field.H:115
@ slip_wall
Definition incflo_enums.H:19
@ zero_gradient
Definition incflo_enums.H:17
@ mass_inflow_outflow
Definition incflo_enums.H:16
@ fixed_gradient
Definition incflo_enums.H:21
@ wall_model
Definition incflo_enums.H:20
@ mass_inflow
Definition incflo_enums.H:15
@ wave_generation
Definition incflo_enums.H:23
@ symmetric_wall
Definition incflo_enums.H:24
@ pressure_outflow
Definition incflo_enums.H:14
@ no_slip_wall
Definition incflo_enums.H:18
@ periodic
Definition incflo_enums.H:22
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:12