/home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/wing/flat_plate_ops.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/wing/flat_plate_ops.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
flat_plate_ops.H
Go to the documentation of this file.
1#ifndef FLAT_PLATE_OPS_H
2#define FLAT_PLATE_OPS_H
3
7
8namespace amr_wind::actuator {
9
10template <>
15
16namespace ops {
17
18template <>
20{
22 {
23 auto& wdata = data.meta();
24 auto& info = data.info();
25 pp.get("num_points", wdata.num_pts);
26 pp.get("start", wdata.start);
27 pp.get("end", wdata.end);
28 pp.get_either("epsilon", wdata.eps_inp);
29 pp.get("pitch", wdata.pitch);
30
31 pp.query("chord", wdata.chord_inp);
32 pp.query("cd_factor", wdata.cd_factor);
33
34 amrex::Real max_eps =
35 *std::max_element(wdata.eps_inp.begin(), wdata.eps_inp.end());
36 amrex::Real search_radius = max_eps * wdata.chord_inp * 3.0;
37 const auto& p1 = wdata.start;
38 const auto& p2 = wdata.end;
39 // clang-format off
40 info.bound_box = amrex::RealBox(
41 amrex::min(p1.x(), p2.x()) - search_radius,
42 amrex::min(p1.y(), p2.y()) - search_radius,
43 amrex::min(p1.z(), p2.z()) - search_radius,
44 amrex::max(p1.x(), p2.x()) + search_radius,
45 amrex::max(p1.y(), p2.y()) + search_radius,
46 amrex::max(p1.z(), p2.z()) + search_radius
47 );
48 // clang-format on
49 }
50};
51
52template <>
54{
56 {
57 wing::init_data_structures(data.meta(), data.grid());
58
59 auto& wdata = data.meta();
60 const int npts = wdata.num_pts;
61 wdata.chord.assign(npts, wdata.chord_inp);
62
63 wdata.aflookup.cd_factor() = wdata.cd_factor;
64 }
65};
66
67template <>
69{
70 return data.meta().aflookup;
71}
72
73} // namespace ops
74} // namespace amr_wind::actuator
75
76#endif /* FLAT_PLATE_OPS_H */
Definition actuator_types.H:184
ActTrait::GridType & grid()
Definition actuator_types.H:217
ActTrait::InfoType & info()
Definition actuator_types.H:214
ActTrait::MetaType & meta()
Definition actuator_types.H:220
Definition AirfoilTable.H:47
Definition MultiParser.H:18
void get(const std::string &name, vs::Vector &value) const
Definition MultiParser.H:42
void get_either(const std::string &name, vs::Vector &value) const
Definition MultiParser.H:74
void query(const std::string &name, vs::Vector &value) const
Definition MultiParser.H:57
const ThinAirfoil & airfoil_lookup< FlatPlate >(FlatPlate::DataType &data)
Definition flat_plate_ops.H:68
void init_data_structures(WingBaseData &wdata, ActGrid &grid)
Definition wing_ops.cpp:10
Definition ActParser.H:6
Definition actuator_types.H:38
Definition AirfoilTable.H:79
Definition FlatPlate.H:18
void operator()(FlatPlate::DataType &data)
Definition flat_plate_ops.H:55
Definition actuator_ops.H:32
void operator()(FlatPlate::DataType &data, const utils::ActParser &pp)
Definition flat_plate_ops.H:21
Definition actuator_ops.H:19