ActuatorContainer Class Reference

AMR-Wind API: amr_wind::actuator::ActuatorContainer Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <ActuatorContainer.H>

Inheritance diagram for amr_wind::actuator::ActuatorContainer:
[legend]
Collaboration diagram for amr_wind::actuator::ActuatorContainer:
[legend]

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 ()
 
ActuatorCloudpoint_data ()
 

Private Attributes

amrex::AmrCore & m_mesh
 
ActuatorCloud m_data
 
amrex::Vector< vs::Vectorm_proc_pos
 
amrex::Gpu::DeviceVector< vs::Vectorm_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()

amr_wind::actuator::ActuatorContainer::ActuatorContainer ( amrex::AmrCore & mesh,
const int num_objects )
explicit

Member Function Documentation

◆ compute_local_coordinates()

void amr_wind::actuator::ActuatorContainer::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()

int amr_wind::actuator::ActuatorContainer::num_actuator_points ( ) const
inline

◆ point_data()

ActuatorCloud & amr_wind::actuator::ActuatorContainer::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 class Actuator
friend

Member Data Documentation

◆ m_container_initialized

bool amr_wind::actuator::ActuatorContainer::m_container_initialized {false}
private

Flag indicating whether memory has allocated for all data structures.

◆ m_data

ActuatorCloud amr_wind::actuator::ActuatorContainer::m_data
private

◆ m_is_scattered

bool amr_wind::actuator::ActuatorContainer::m_is_scattered {false}
private

Flag indicating whether the particles are scattered throughout the domain, or if they have been recalled to the original MPI rank

◆ m_mesh

amrex::AmrCore& amr_wind::actuator::ActuatorContainer::m_mesh
private

◆ m_pos_device

amrex::Gpu::DeviceVector<vs::Vector> amr_wind::actuator::ActuatorContainer::m_pos_device
private

Device view of the process position vectors.

◆ m_proc_offsets

amrex::Vector<int> amr_wind::actuator::ActuatorContainer::m_proc_offsets
private

◆ m_proc_offsets_device

amrex::Gpu::DeviceVector<int> amr_wind::actuator::ActuatorContainer::m_proc_offsets_device
private

◆ m_proc_pos

amrex::Vector<vs::Vector> amr_wind::actuator::ActuatorContainer::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: