/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/DTUSpinnerSampler.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/DTUSpinnerSampler.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
DTUSpinnerSampler.H
Go to the documentation of this file.
1#ifndef DTUSPINNERSAMPLER_H
2#define DTUSPINNERSAMPLER_H
3
7
8namespace amr_wind::sampling {
9
11{
12 amrex::Real theta0{90};
13 amrex::Real rot{3.5};
14 amrex::Real azimuth{15.2};
15};
16
27{
28public:
29 // cppcheck-suppress duplInheritedMember
30 static std::string identifier() { return "DTUSpinnerSampler"; }
31
32 explicit DTUSpinnerSampler(const CFDSim& /*sim*/);
33
38 void initialize(const std::string& key) override;
39
44 void sampling_locations(SampleLocType& /*sample_locs*/) const override;
45
49 SampleLocType& /*sample_locs*/,
50 const amrex::Box& /*box*/) const override;
51
53 PrismParameters InnerPrism, PrismParameters OuterPrism, double time);
54
56 vs::Vector beamPt, double yaw, double pitch, double roll);
57
58#ifdef AMR_WIND_USE_OPENFAST
59
60 void bcast_turbine(
61 amrex::Array<double, 18>& /*turbine_pack*/, int /*root_proc*/);
62 void get_turbine_data(const std::string& turbine_label);
63
64#endif
65
69 bool update_sampling_locations() override;
70
71 void post_sample_actions() override {};
72
73 long num_points() const override { return (m_beam_points * m_ntotal); }
74
75 long num_output_points() const override
76 {
77 return (m_beam_points * m_ntotal);
78 }
79
80 void
81 define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
82 void
83 populate_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
85 const ncutils::NCGroup& /*unused*/,
86 const size_t /*unused*/) const override;
87
88private:
89 // Number of subsamples in this timestep
90 int m_ns{1};
91
92 // Max number of subsamples in all timesteps
93 long m_ntotal{1};
94
96 const amrex::Real m_radtodeg{180.0 / M_PI};
97 const amrex::Real m_pi{M_PI};
98 const amrex::Real m_twopi{2.0 * M_PI};
99 const amrex::Real m_threepi{3.0 * M_PI};
100 amrex::Real m_time_sampling{0};
103 amrex::Vector<amrex::Real> m_lidar_center{0.0, 0.0, 0.0};
104 amrex::Real m_scan_time{2};
105 amrex::Real m_num_samples{984};
106 amrex::Real m_beam_length{270};
108 amrex::Real m_fixed_yaw{0};
109 amrex::Real m_fixed_roll{0};
110 amrex::Real m_fixed_tilt{0};
111 amrex::Real m_hub_yaw{0};
112 amrex::Real m_hub_roll{0};
113 amrex::Real m_hub_tilt{0};
114 std::string m_spinner_mode{"fixed"};
115 std::string m_turbine_label;
116 bool m_hub_debug{false};
119
120#ifdef AMR_WIND_USE_OPENFAST
121
122 amrex::Array<float, 3> m_turbine_base_pos = {0, 0, 0};
123 amrex::Array<float, 3> m_current_hub_abs_pos = {0, 0, 0};
124 amrex::Array<float, 3> m_current_hub_rot_vel = {0, 0, 0};
125 amrex::Array<double, 9> m_current_hub_orient = {0, 0, 0, 0, 0, 0, 0, 0, 0};
126
127#endif
128
129 amrex::Real m_last_hub_yaw{0};
130 amrex::Real m_last_hub_roll{0};
131 amrex::Real m_last_hub_tilt{0};
132 amrex::Vector<amrex::Real> m_last_lidar_center{0.0, 0.0, 0.0};
133 amrex::Vector<amrex::Real> m_step_lidar_center{0.0, 0.0, 0.0};
134
135 amrex::Real m_fill_val{-99999.99};
136};
137
138} // namespace amr_wind::sampling
139
140#endif /* DTUSPINNERSAMPLER_H */
Definition CFDSim.H:47
Definition DTUSpinnerSampler.H:27
void sampling_locations(SampleLocType &) const override
Definition DTUSpinnerSampler.cpp:136
void post_sample_actions() override
Definition DTUSpinnerSampler.H:71
static vs::Vector generate_lidar_pattern(PrismParameters InnerPrism, PrismParameters OuterPrism, double time)
Definition DTUSpinnerSampler.cpp:112
amrex::Real m_num_samples
Definition DTUSpinnerSampler.H:105
void define_netcdf_metadata(const ncutils::NCGroup &) const override
Definition DTUSpinnerSampler.cpp:463
int m_update_count
Definition DTUSpinnerSampler.H:95
const amrex::Real m_threepi
Definition DTUSpinnerSampler.H:99
bool m_hub_debug
Definition DTUSpinnerSampler.H:116
long m_ntotal
Definition DTUSpinnerSampler.H:93
amrex::Real m_scan_time
Definition DTUSpinnerSampler.H:104
std::string m_spinner_mode
Definition DTUSpinnerSampler.H:114
const amrex::Real m_radtodeg
Definition DTUSpinnerSampler.H:96
const amrex::Real m_twopi
Definition DTUSpinnerSampler.H:98
amrex::Real m_fixed_tilt
Definition DTUSpinnerSampler.H:110
amrex::Real m_last_hub_roll
Definition DTUSpinnerSampler.H:130
amrex::Real m_beam_length
Definition DTUSpinnerSampler.H:106
const amrex::Real m_pi
Definition DTUSpinnerSampler.H:97
vs::Vector m_hub_location_init
Definition DTUSpinnerSampler.H:118
amrex::Real m_hub_roll
Definition DTUSpinnerSampler.H:112
int m_beam_points
Definition DTUSpinnerSampler.H:107
void initialize(const std::string &key) override
Definition DTUSpinnerSampler.cpp:20
PrismParameters m_InnerPrism
Definition DTUSpinnerSampler.H:101
long num_output_points() const override
Definition DTUSpinnerSampler.H:75
amrex::Real m_fixed_roll
Definition DTUSpinnerSampler.H:109
bool update_sampling_locations() override
Definition DTUSpinnerSampler.cpp:281
DTUSpinnerSampler(const CFDSim &)
Definition DTUSpinnerSampler.cpp:18
static std::string identifier()
Definition DTUSpinnerSampler.H:30
amrex::Real m_hub_yaw
Definition DTUSpinnerSampler.H:111
void populate_netcdf_metadata(const ncutils::NCGroup &) const override
Definition DTUSpinnerSampler.cpp:523
vs::Vector m_hub_location
Definition DTUSpinnerSampler.H:117
void output_netcdf_data(const ncutils::NCGroup &, const size_t) const override
Definition DTUSpinnerSampler.cpp:527
amrex::Real m_time_sampling
Definition DTUSpinnerSampler.H:100
long num_points() const override
Definition DTUSpinnerSampler.H:73
static vs::Vector adjust_lidar_pattern(vs::Vector beamPt, double yaw, double pitch, double roll)
Definition DTUSpinnerSampler.cpp:103
amrex::Vector< amrex::Real > m_last_lidar_center
Definition DTUSpinnerSampler.H:132
amrex::Vector< amrex::Real > m_step_lidar_center
Definition DTUSpinnerSampler.H:133
amrex::Real m_last_hub_yaw
Definition DTUSpinnerSampler.H:129
amrex::Real m_fill_val
Definition DTUSpinnerSampler.H:135
int m_ns
Definition DTUSpinnerSampler.H:90
amrex::Real m_fixed_yaw
Definition DTUSpinnerSampler.H:108
amrex::Real m_last_hub_tilt
Definition DTUSpinnerSampler.H:131
std::string m_turbine_label
Definition DTUSpinnerSampler.H:115
amrex::Vector< amrex::Real > m_lidar_center
Definition DTUSpinnerSampler.H:103
PrismParameters m_OuterPrism
Definition DTUSpinnerSampler.H:102
amrex::Real m_hub_tilt
Definition DTUSpinnerSampler.H:113
Definition LidarSampler.H:19
Representation of a NetCDF group.
Definition nc_interface.H:166
Definition DTUSpinnerSampler.cpp:16
Definition DTUSpinnerSampler.H:11
amrex::Real rot
Definition DTUSpinnerSampler.H:13
amrex::Real theta0
Definition DTUSpinnerSampler.H:12
amrex::Real azimuth
Definition DTUSpinnerSampler.H:14
Definition SamplerBase.H:15
Definition vector.H:13