/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
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:
63 if (side == amrex::Orientation::low) {
64 set_bcrec_lo(dir, amrex::BCType::ext_dir);
65 } else {
66 set_bcrec_hi(dir, amrex::BCType::ext_dir);
67 }
68 break;
69
70 // Fixed gradient BC is not allowed for VOF
72 default:
73 amrex::Abort("Invalid BC type for VOF encountered");
74 }
75 }
76 }
77 // Copied from BC interface for scalars
78 void read_values() override
79 {
80 const auto& fname = m_field.name();
81 const auto& bctype = m_field.bc_type();
82 auto& bcval = m_field.bc_values();
83 const int ndim = m_field.num_comp();
84 for (amrex::OrientationIter oit; oit != nullptr; ++oit) {
85 auto ori = oit();
86 const auto& bcid = bcnames[ori];
87 const auto bct = bctype[ori];
88
89 amrex::ParmParse pp(bcid);
90 if (bct == BC::mass_inflow || bct == BC::mass_inflow_outflow) {
91 pp.getarr(fname.c_str(), bcval[ori], 0, ndim);
92 } else {
93 pp.queryarr(fname.c_str(), bcval[ori], 0, ndim);
94 }
95 }
96 }
97};
98
99} // namespace amr_wind
100
101#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:78
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
@ mass_inflow_outflow
@ fixed_gradient
@ wall_model
@ mass_inflow
@ wave_generation
@ symmetric_wall
@ pressure_outflow
@ no_slip_wall
@ periodic
Definition BCInterface.cpp:7