Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radar and Spinner Lidar Sampling #954

Merged
merged 53 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e59fa32
First commit: add radar files
ndevelder Dec 9, 2022
45f3c0e
First draft of cone sampler and dummy radar sampler
ndevelder Feb 20, 2023
422b921
Draft of radar sampler with debug output
ndevelder Jun 6, 2023
cd2ffdb
Start on changes for LOS velocity
ndevelder Jun 13, 2023
a3b645f
Draft 1 of Radar Final, Basic working
ndevelder Jun 15, 2023
fc85d32
Debug print cleanup
ndevelder Jun 15, 2023
b81e1f4
Projection matrix fix and finalize inputs
ndevelder Jun 16, 2023
795ad90
Formatting
ndevelder Jun 16, 2023
213838a
Add default return for SamplerBase mod function
ndevelder Jun 17, 2023
d5f7724
Fixed warnings, unused vars etc
ndevelder Jun 20, 2023
939f9c9
Velocity component output supression for samplers using LOS
ndevelder Jun 22, 2023
0f97d1b
Formatting
ndevelder Jun 22, 2023
49caa7a
ifdefs causing linker error in ci, fixed
ndevelder Jun 22, 2023
bb96101
Missing return val
ndevelder Jun 22, 2023
3760d44
Unused param fix for debug
ndevelder Jun 22, 2023
0ad480c
Fix various warnings
ndevelder Jun 26, 2023
cccd955
Fix formatting
ndevelder Jun 26, 2023
7f0267b
Fix index on los velocity assignment
ndevelder Jul 27, 2023
6b7341f
Convert cone angle to radians
ndevelder Aug 8, 2023
8739e85
Formatting
ndevelder Aug 8, 2023
fe9fd81
Add radar and spinner
ndevelder Sep 19, 2023
f456909
Cleanup excessive print statements
ndevelder Sep 19, 2023
955569a
Incorrect type fix
ndevelder Sep 19, 2023
75b6581
Merging Spinner sampler and Radar sampler to avoid future conflicts
ndevelder Sep 29, 2023
087130b
MMore formatting
ndevelder Sep 29, 2023
2ac0a70
Fixing def and type conv errors
ndevelder Sep 29, 2023
00fc5c8
Format and comment removal
ndevelder Sep 29, 2023
2e7337c
Codespell ignore and fixes to comments
ndevelder Jan 9, 2024
d887e90
Merge branch 'Exawind:main' into radar-lidar
ndevelder Feb 7, 2024
3137cf7
Print statement removal and fixes
ndevelder Feb 7, 2024
2b54f22
Merge branch 'radar-lidar' of https://github.com/ndevelder/amr-wind i…
ndevelder Feb 7, 2024
56472aa
Mod volume sampler for base sampling changes
ndevelder Feb 8, 2024
0d7f691
Formatting
ndevelder Feb 8, 2024
4f6d633
Make some const
ndevelder Feb 8, 2024
fe9ab9e
Round one clang-tidy changes
ndevelder Feb 8, 2024
d6f2314
Round two clang-tidy changes
ndevelder Feb 8, 2024
e664fa7
Round three clang-tidy changes
ndevelder Feb 9, 2024
083fc08
Round four clang-tidy changes
ndevelder Feb 9, 2024
81ce384
Round five clang-tidy changes
ndevelder Feb 9, 2024
decc71f
Last long/int conversion
ndevelder Feb 9, 2024
b0781fa
more int/long conversion chain
ndevelder Feb 9, 2024
9dc9445
First spinner unit test structure
ndevelder Feb 22, 2024
3d0e888
Spinner and radar basic test setup
ndevelder Feb 22, 2024
9a915d4
Remove ConeSampler for further testing
ndevelder Feb 22, 2024
1b1aba4
Weird erro, added explicit std string
ndevelder Feb 22, 2024
e2654b9
Clang-tidy fixes
ndevelder Feb 22, 2024
179d0f1
Merge branch 'Exawind:main' into radar-lidar
ndevelder Feb 22, 2024
0b2731a
Merge branch 'main' into radar-lidar
mbkuhn Feb 27, 2024
307ebf2
Merge branch 'Exawind:main' into radar-lidar
ndevelder Mar 7, 2024
630a002
Add some sampling utilities tests
ndevelder Mar 8, 2024
5dacad8
Merge branch 'radar-lidar' of https://github.com/ndevelder/amr-wind i…
ndevelder Mar 8, 2024
92b0d9a
Fix unused variable
ndevelder Mar 8, 2024
16e98b8
One more test
ndevelder Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .codespell-ignore-words
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ vell
nd
fo
ue
structed
structed
acount
2 changes: 2 additions & 0 deletions amr-wind/utilities/sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ target_sources(${amr_wind_lib_name}

Sampling.cpp
SamplingContainer.cpp
SamplingUtils.cpp
LineSampler.cpp
LidarSampler.cpp
RadarSampler.cpp
DTUSpinnerSampler.cpp
PlaneSampler.cpp
ProbeSampler.cpp
Expand Down
70 changes: 66 additions & 4 deletions amr-wind/utilities/sampling/DTUSpinnerSampler.H
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#ifndef DTUSPINNERSAMPLER_H
#define DTUSPINNERSAMPLER_H

#include "amr-wind/utilities/sampling/SamplingUtils.H"
#include "amr-wind/utilities/sampling/LidarSampler.H"
#include "amr-wind/core/vs/vector_space.H"

namespace amr_wind::sampling {

struct PrismParameters
{
amrex::Real theta0{90};
amrex::Real rot{3.5};
amrex::Real azimuth{15.2};
};

/** Sample data along a line that moves in time
* \ingroup sampling
*
Expand Down Expand Up @@ -35,15 +43,27 @@ public:
*/
void sampling_locations(SampleLocType& /*locs*/) const override;

static vs::Vector generate_lidar_pattern(
PrismParameters InnerPrism, PrismParameters OuterPrism, double time);

static vs::Vector adjust_lidar_pattern(
vs::Vector beamPt, double yaw, double pitch, double roll);

#ifdef AMR_WIND_USE_OPENFAST

void bcast_turbine(double* /*turbine_pack*/, int /*root_proc*/);
void get_turbine_data(std::string turbine_label);

#endif

/** Determine how the subsampling will be done
*
*/
void update_sampling_locations() override;

int num_points() const override { return (m_npts * m_ns); }
void post_sample_actions() override{};

bool output_netcdf_field(
double* /*unused*/, ncutils::NCVar& /*unused*/) override;
long num_points() const override { return (m_beam_points * m_ntotal); }

void
define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override;
Expand All @@ -54,9 +74,51 @@ public:
const size_t /*unused*/) const override;

private:
// Number of subsamples in this timestep
int m_ns{1};
amrex::Real m_dt_s{0.01};

// Max number of subsamples in all timesteps
long m_ntotal{1};

int m_update_count{0};
const amrex::Real radtodeg{180.0 / M_PI};
const amrex::Real pi{M_PI};
const amrex::Real twopi{2.0 * M_PI};
const amrex::Real threepi{3.0 * M_PI};
amrex::Real m_time_sampling{0};
PrismParameters m_InnerPrism;
PrismParameters m_OuterPrism;
amrex::Vector<amrex::Real> m_lidar_center{0.0, 0.0, 0.0};
amrex::Real m_scan_time{2};
amrex::Real m_num_samples{984};
amrex::Real m_beam_length{270};
int m_beam_points{432};
amrex::Real m_fixed_yaw{0};
amrex::Real m_fixed_roll{0};
amrex::Real m_fixed_tilt{0};
amrex::Real m_hub_yaw{0};
amrex::Real m_hub_roll{0};
amrex::Real m_hub_tilt{0};
std::string m_spinner_mode{"fixed"};
std::string m_turbine_label;
bool m_hub_debug{false};
vs::Vector m_hub_location{0, 0, 0};
vs::Vector m_hub_location_init{0, 0, 0};

#ifdef AMR_WIND_USE_OPENFAST

float turbine_base_pos[3]{0, 0, 0};
float current_hub_abs_pos[3]{0, 0, 0};
float current_hub_rot_vel[3]{0, 0, 0};
double current_hub_orient[9]{0, 0, 0, 0, 0, 0, 0, 0, 0};

#endif

amrex::Real m_last_hub_yaw{0};
amrex::Real m_last_hub_roll{0};
amrex::Real m_last_hub_tilt{0};
amrex::Vector<amrex::Real> m_last_lidar_center{0.0, 0.0, 0.0};
amrex::Vector<amrex::Real> step_lidar_center{0.0, 0.0, 0.0};
};

} // namespace amr_wind::sampling
Expand Down
Loading
Loading