/home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/vof/vof_bciface.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/vof/vof_bciface.H Source File
AMR-Wind 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 amr_wind {
7
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 if (side == amrex::Orientation::low) {
45 set_bcrec_lo(dir, amrex::BCType::foextrap);
46 } else {
47 set_bcrec_hi(dir, amrex::BCType::foextrap);
48 }
49 break;
50
51 case BC::slip_wall:
52 case BC::wall_model:
53 if (side == amrex::Orientation::low) {
54 set_bcrec_lo(dir, amrex::BCType::hoextrap);
55 } else {
56 set_bcrec_hi(dir, amrex::BCType::hoextrap);
57 }
58 break;
59
61 case BC::mass_inflow:
62 if (side == amrex::Orientation::low) {
63 set_bcrec_lo(dir, amrex::BCType::ext_dir);
64 } else {
65 set_bcrec_hi(dir, amrex::BCType::ext_dir);
66 }
67 break;
68
69 // Fixed gradient BC is not allowed for VOF
71 default:
72 amrex::Abort("Invalid BC type for VOF encountered");
73 }
74 }
75 }
76 // Copied from BC interface for scalars
77 void read_values() override
78 {
79 const auto& fname = m_field.name();
80 const auto& bctype = m_field.bc_type();
81 auto& bcval = m_field.bc_values();
82 const int ndim = m_field.num_comp();
83 for (amrex::OrientationIter oit; oit != nullptr; ++oit) {
84 auto ori = oit();
85 const auto& bcid = bcnames[ori];
86 const auto bct = bctype[ori];
87
88 amrex::ParmParse pp(bcid);
89 if (bct == BC::mass_inflow) {
90 pp.getarr(fname.c_str(), bcval[ori], 0, ndim);
91 } else {
92 pp.queryarr(fname.c_str(), bcval[ori], 0, ndim);
93 }
94 }
95 }
96};
97
98} // namespace amr_wind
99
100#endif /* VOF_BCIFACE_H */
Definition BCInterface.H:40
Field & m_field
Field instance where BC is being set.
Definition BCInterface.H:91
void set_bcrec_lo(int dir, amrex::BCType::mathematicalBndryTypes bcrec)
Set AMReX mathematical boundary types for the lower boundaries.
Definition BCInterface.H:72
void set_bcrec_hi(int dir, amrex::BCType::mathematicalBndryTypes bcrec)
Set AMReX mathematical boundary types for the upper boundaries.
Definition BCInterface.H:82
Definition vof_bciface.H:13
void read_values() override
Read input data for specific fields based on BC types.
Definition vof_bciface.H:77
BCVOF(Field &field)
Definition vof_bciface.H:15
void set_bcrec() override
Setup AMReX mathematical BC types.
Definition vof_bciface.H:19
Definition Field.H:116
const amrex::GpuArray< BC, AMREX_SPACEDIM *2 > & bc_type() const
Definition Field.H:171
amrex::Vector< amrex::Vector< amrex::Real > > & bc_values()
Return reference to the host view of BC values array.
Definition Field.H:182
const std::string & name() const
Name of this field (including state information)
Definition Field.H:125
int num_comp() const
Number of components for this field.
Definition Field.H:134
@ slip_wall
@ zero_gradient
@ fixed_gradient
@ wall_model
@ mass_inflow
@ wave_generation
@ symmetric_wall
@ pressure_outflow
@ no_slip_wall
@ periodic
Definition BCInterface.cpp:7