ActuatorContainer Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
|
#include <ActuatorContainer.H>
Public Member Functions | |
ActuatorContainer (amrex::AmrCore &mesh, const int num_objects) | |
void | post_regrid_actions () |
void | initialize_container () |
void | reset_container () |
void | update_positions () |
void | sample_fields (const Field &vel, const Field &density) |
int | num_actuator_points () const |
void | interpolate_fields (const Field &vel, const Field &density) |
void | populate_field_buffers () |
void | initialize_particles (const int total_pts) |
Protected Member Functions | |
void | compute_local_coordinates () |
ActuatorCloud & | point_data () |
Private Attributes | |
amrex::AmrCore & | m_mesh |
ActuatorCloud | m_data |
amrex::Vector< vs::Vector > | m_proc_pos |
amrex::Gpu::DeviceVector< vs::Vector > | m_pos_device |
Device view of the process position vectors. | |
amrex::Vector< int > | m_proc_offsets |
amrex::Gpu::DeviceVector< int > | m_proc_offsets_device |
bool | m_container_initialized {false} |
Flag indicating whether memory has allocated for all data structures. | |
bool | m_is_scattered {false} |
Friends | |
class | Actuator |
Detailed Description
Specialization of AmrParticleContainer for sampling velocities.
Constructor & Destructor Documentation
◆ ActuatorContainer()
|
explicit |
Member Function Documentation
◆ compute_local_coordinates()
|
protected |
Determine position vector of a point within each MPI rank
Loops over the boxArray and determines the first patch that belongs to the current MPI rank. Uses that to generate a position vector that is known to exist in a given rank. Setting the position vectors of the particles to this know location will recall particles belonging to this rank during Redistribute.
◆ initialize_container()
void amr_wind::actuator::ActuatorContainer::initialize_container | ( | ) |
Allocate memory and initialize the particles within the container
This method is only called once during the simulation. It allocates the arrays for holding the position vector and velocity data on host memory and also initializes corresponding particles within the first available particle tile within the container. It is expected that the actuator manager instance has already populated the number of points per turbine before invoking this method.
◆ initialize_particles()
void amr_wind::actuator::ActuatorContainer::initialize_particles | ( | const int | total_pts | ) |
◆ interpolate_fields()
void amr_wind::actuator::ActuatorContainer::interpolate_fields | ( | const Field & | vel, |
const Field & | density ) |
Helper method for ActuatorContainer::sample_fields
Performs a trilinear interpolation of the velocity/density field to particle locations. It also updates the particle locations such that the next Redistribute call restores the particles back to their original MPI rank where they were created.
◆ num_actuator_points()
|
inline |
◆ point_data()
|
inlineprotected |
◆ populate_field_buffers()
void amr_wind::actuator::ActuatorContainer::populate_field_buffers | ( | ) |
Helper method for ActuatorContainer::sample_fields
Loops over the particle tiles and copies velocity data from particles to the velocity and density arrays.
◆ post_regrid_actions()
void amr_wind::actuator::ActuatorContainer::post_regrid_actions | ( | ) |
◆ reset_container()
void amr_wind::actuator::ActuatorContainer::reset_container | ( | ) |
◆ sample_fields()
void amr_wind::actuator::ActuatorContainer::sample_fields | ( | const Field & | vel, |
const Field & | density ) |
Interpolate the velocity field using a trilinear interpolation
This method performs three tasks:
- Sample the velocity field and interpolate onto particle location
- Restore the particles back to their original MPI rank
- Copy data from particles into the buffer used by actuator instances
After invocation if this method, the particles are back in their original rank and the position vectors can be updated safely.
◆ update_positions()
void amr_wind::actuator::ActuatorContainer::update_positions | ( | ) |
Update position vectors of the particles within a container based on the data provided by actuator instances.
This method assumes that the particles have been restored to their originating MPI ranks after any scattering. This happens during initialization (after AcutatorContainer::initialize_particles) and after ActuatorContainer::sample_velocities.
After executing this method, the particles have been scattered across the domain such that each particle is contained within a tile that has the cell enclosing the particle.
Friends And Related Symbol Documentation
◆ Actuator
|
friend |
Member Data Documentation
◆ m_container_initialized
|
private |
Flag indicating whether memory has allocated for all data structures.
◆ m_data
|
private |
◆ m_is_scattered
|
private |
Flag indicating whether the particles are scattered throughout the domain, or if they have been recalled to the original MPI rank
◆ m_mesh
|
private |
◆ m_pos_device
|
private |
Device view of the process position vectors.
◆ m_proc_offsets
|
private |
◆ m_proc_offsets_device
|
private |
◆ m_proc_pos
|
private |
Coordinates of points that are contained within boxes assigned to each MPI rank
The documentation for this class was generated from the following files:
- /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/ActuatorContainer.H
- /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/ActuatorContainer.cpp
Generated by 1.12.0