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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/ActuatorContainer.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
ActuatorContainer.H
Go to the documentation of this file.
1#ifndef ACTUATORCONTAINER_H
2#define ACTUATORCONTAINER_H
3
5
6#include "AMReX_AmrParticles.H"
7
8namespace amr_wind {
9
10class Field;
11
12namespace actuator {
13
14class Actuator;
15
24{
26 amrex::Vector<int> num_pts;
27
29 amrex::Vector<int> global_id;
30
32 amrex::Vector<vs::Vector> position;
33
35 amrex::Vector<vs::Vector> velocity;
36
38 amrex::Vector<amrex::Real> density;
39
42
43 explicit ActuatorCloud(const int nobjects);
44};
45
47static constexpr int NumPStructReal = AMREX_SPACEDIM + 1;
49static constexpr int NumPStructInt = 1;
51static constexpr int NumPArrayReal = 0;
53static constexpr int NumPArrayInt = 0;
54
60 : public amrex::AmrParticleContainer<
61 NumPStructReal,
62 NumPStructInt,
63 NumPArrayReal,
64 NumPArrayInt>
65{
66public:
67 friend class Actuator;
68
69 explicit ActuatorContainer(amrex::AmrCore& mesh, const int num_objects);
70
72
74
75 void reset_container();
76
77 void update_positions();
78
79 void sample_fields(const Field& vel, const Field& density);
80
82 {
83 return static_cast<int>(m_data.position.size());
84 }
85
86 // public for CUDA, not safe for general access
87
88 void interpolate_fields(const Field& vel, const Field& density);
89
91
92 void initialize_particles(const int total_pts);
93
94protected:
96
97 // Accessor to allow unit testing
99
100private:
101 amrex::AmrCore& m_mesh;
102
103 // Object that holds the position and velocity information
105
108 amrex::Vector<vs::Vector> m_proc_pos;
109
111 amrex::Gpu::DeviceVector<vs::Vector> m_pos_device;
112
113 amrex::Vector<int> m_proc_offsets;
114 amrex::Gpu::DeviceVector<int> m_proc_offsets_device;
115
118
121 bool m_is_scattered{false};
122};
123
124} // namespace actuator
125} // namespace amr_wind
126
127#endif /* ACTUATORCONTAINER_H */
Definition Field.H:116
Definition ActuatorContainer.H:65
amrex::Vector< int > m_proc_offsets
Definition ActuatorContainer.H:113
ActuatorCloud & point_data()
Definition ActuatorContainer.H:98
bool m_is_scattered
Definition ActuatorContainer.H:121
void interpolate_fields(const Field &vel, const Field &density)
Definition ActuatorContainer.cpp:285
amrex::Gpu::DeviceVector< vs::Vector > m_pos_device
Device view of the process position vectors.
Definition ActuatorContainer.H:111
amrex::Gpu::DeviceVector< int > m_proc_offsets_device
Definition ActuatorContainer.H:114
void update_positions()
Definition ActuatorContainer.cpp:157
amrex::Vector< vs::Vector > m_proc_pos
Definition ActuatorContainer.H:108
amrex::AmrCore & m_mesh
Definition ActuatorContainer.H:101
void populate_field_buffers()
Definition ActuatorContainer.cpp:223
ActuatorCloud m_data
Definition ActuatorContainer.H:104
void initialize_particles(const int total_pts)
Definition ActuatorContainer.cpp:78
int num_actuator_points() const
Definition ActuatorContainer.H:81
void initialize_container()
Definition ActuatorContainer.cpp:41
void compute_local_coordinates()
Definition ActuatorContainer.cpp:369
void sample_fields(const Field &vel, const Field &density)
Definition ActuatorContainer.cpp:199
void reset_container()
Definition ActuatorContainer.cpp:124
bool m_container_initialized
Flag indicating whether memory has allocated for all data structures.
Definition ActuatorContainer.H:117
ActuatorContainer(amrex::AmrCore &mesh, const int num_objects)
Definition ActuatorContainer.cpp:17
Definition Actuator.H:31
static constexpr int NumPArrayReal
Number of real entries in Struct of Arrays (SOA)
Definition ActuatorContainer.H:51
static constexpr int NumPStructInt
Number of integer entries in Array of Structs (AOS)
Definition ActuatorContainer.H:49
static constexpr int NumPStructReal
Number or real entries in Array of Structs (AOS)
Definition ActuatorContainer.H:47
static constexpr int NumPArrayInt
Number of int entries in Struct of Arrays (SOA)
Definition ActuatorContainer.H:53
Definition BCInterface.cpp:7
Definition ActuatorContainer.H:24
amrex::Vector< vs::Vector > velocity
Velocity vectors of all actuator nodes belonging to this MPI rank.
Definition ActuatorContainer.H:35
amrex::Vector< vs::Vector > position
Position vectors of all actuator nodes belonging to this MPI rank.
Definition ActuatorContainer.H:32
amrex::Vector< int > num_pts
Number of nodes per turbine on this MPI rank.
Definition ActuatorContainer.H:26
int num_objects
Total number of turbines located on this MPI rank.
Definition ActuatorContainer.H:41
amrex::Vector< amrex::Real > density
Density of all actuator nodes belonging to this MPI rank.
Definition ActuatorContainer.H:38
amrex::Vector< int > global_id
Global IDs of the turbines on this MPI rank.
Definition ActuatorContainer.H:29
ActuatorCloud(const int nobjects)
Definition ActuatorContainer.cpp:13