AeroDynInflowLibrary Class Reference

Kynema API: kynema::util::AeroDynInflowLibrary Class Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
kynema::util::AeroDynInflowLibrary Class Reference

Wrapper class for the AeroDynInflow (ADI) shared library. More...

#include <aerodyn_inflow.hpp>

Public Member Functions

 AeroDynInflowLibrary (const std::string &shared_lib_path="aerodyn_inflow_c_binding.dll", ErrorHandling eh=ErrorHandling{}, FluidProperties fp=FluidProperties{}, EnvironmentalConditions ec=EnvironmentalConditions{}, SimulationControls sc=SimulationControls{}, VTKSettings vtk=VTKSettings{})
 Construct a new AeroDynInflowLibrary object.
 
const ErrorHandlingGetErrorHandling () const
 Getter methods for the private member variables.
 
const EnvironmentalConditionsGetEnvironmentalConditions () const
 
const FluidPropertiesGetFluidProperties () const
 
const SimulationControlsGetSimulationControls () const
 
const VTKSettingsGetVTKSettings () const
 
void Initialize (std::span< const TurbineConfig > turbine_configs)
 Initialize the AeroDyn Inflow library.
 
void PreInitialize (size_t n_turbines)
 Performs pre-initialization setup.
 
void SetupRotors (std::span< const TurbineConfig > turbine_configs)
 Sets up rotor configurations for all turbines.
 
void FinalizeInitialization ()
 Finalizes the initialization process.
 
void SetRotorMotion ()
 Set up the rotor motion for the current simulation step.
 
void CalculateOutput (double time)
 Calculates the output channels at a given time.
 
void UpdateStates (double current_time, double next_time)
 Updates the states of the AeroDyn Inflow library.
 
void Finalize ()
 Ends the simulation and frees memory.
 

Public Attributes

std::vector< TurbineDataturbines
 
std::vector< std::string > channel_names
 
std::vector< std::string > channel_units
 
std::vector< float > channel_values
 

Detailed Description

Wrapper class for the AeroDynInflow (ADI) shared library.

This class provides a C++ interface for interacting with the AeroDynInflow (ADI) shared library, which offers C bindings for the AeroDyn x InflowWind modules of OpenFAST. It encapsulates key functions for AeroDyn/InflowWind simulation, including initialization, rotor setup, state updates, and load calculations.

Key functions:

  • Initialize: Set up the simulation environment
  • SetupRotorMotion: Update rotor motion for each timestep
  • UpdateStates: Advance internal states
  • CalculateOutputChannels: Compute output values
  • GetRotorAerodynamicLoads: Retrieve aerodynamic forces and moments
  • Finalize: Clean up and release resources
Note
This class manages the lifecycle of the ADI library, ensuring proper initialization and cleanup.

Constructor & Destructor Documentation

◆ AeroDynInflowLibrary()

kynema::util::AeroDynInflowLibrary::AeroDynInflowLibrary ( const std::string &  shared_lib_path = "aerodyn_inflow_c_binding.dll",
ErrorHandling  eh = ErrorHandling{},
FluidProperties  fp = FluidProperties{},
EnvironmentalConditions  ec = EnvironmentalConditions{},
SimulationControls  sc = SimulationControls{},
VTKSettings  vtk = VTKSettings{} 
)
inline

Construct a new AeroDynInflowLibrary object.

Parameters
shared_lib_pathPath to the ADI shared library
ehError handling settings
fpFluid properties
ecEnvironmental conditions
scSimulation control settings
vtkVTK output settings

Member Function Documentation

◆ CalculateOutput()

void kynema::util::AeroDynInflowLibrary::CalculateOutput ( double  time)
inline

Calculates the output channels at a given time.

This function calculates the output channels at a given time by passing the time and the output channel values to the Fortran routine. It also populates the turbine loads.

Parameters
timeTime at which to calculate the output channels

◆ Finalize()

void kynema::util::AeroDynInflowLibrary::Finalize ( )
inline

Ends the simulation and frees memory.

This function ends the simulation and frees memory by passing the error status and error message buffer to the Fortran routine.

◆ FinalizeInitialization()

void kynema::util::AeroDynInflowLibrary::FinalizeInitialization ( )
inline

Finalizes the initialization process.

◆ GetEnvironmentalConditions()

const EnvironmentalConditions & kynema::util::AeroDynInflowLibrary::GetEnvironmentalConditions ( ) const
inline

◆ GetErrorHandling()

const ErrorHandling & kynema::util::AeroDynInflowLibrary::GetErrorHandling ( ) const
inline

Getter methods for the private member variables.

◆ GetFluidProperties()

const FluidProperties & kynema::util::AeroDynInflowLibrary::GetFluidProperties ( ) const
inline

◆ GetSimulationControls()

const SimulationControls & kynema::util::AeroDynInflowLibrary::GetSimulationControls ( ) const
inline

◆ GetVTKSettings()

const VTKSettings & kynema::util::AeroDynInflowLibrary::GetVTKSettings ( ) const
inline

◆ Initialize()

void kynema::util::AeroDynInflowLibrary::Initialize ( std::span< const TurbineConfig turbine_configs)
inline

Initialize the AeroDyn Inflow library.

Performs a complete initialization of the AeroDyn Inflow library through a three-step process:

  1. Pre-initialization (ADI_C_PreInit)
  2. Rotor setup (ADI_C_SetupRotor)
  3. Final initialization (ADI_C_Init)
Parameters
turbine_configsVector of TurbineConfig objects, each representing a single turbine

◆ PreInitialize()

void kynema::util::AeroDynInflowLibrary::PreInitialize ( size_t  n_turbines)
inline

Performs pre-initialization setup.

Parameters
n_turbinesNumber of turbines in the simulation

◆ SetRotorMotion()

void kynema::util::AeroDynInflowLibrary::SetRotorMotion ( )
inline

Set up the rotor motion for the current simulation step.

Sets up the motion data (position, orientation, velocity, acceleration) for the hub, nacelle, blade roots, and blade nodes of each turbine.

◆ SetupRotors()

void kynema::util::AeroDynInflowLibrary::SetupRotors ( std::span< const TurbineConfig turbine_configs)
inline

Sets up rotor configurations for all turbines.

Parameters
turbine_configsVector of turbine configurations

◆ UpdateStates()

void kynema::util::AeroDynInflowLibrary::UpdateStates ( double  current_time,
double  next_time 
)
inline

Updates the states of the AeroDyn Inflow library.

This function updates the states of the AeroDyn Inflow library by passing the current time and the next time to the Fortran routine.

Parameters
current_timeCurrent time
next_timeNext time

Member Data Documentation

◆ channel_names

std::vector<std::string> kynema::util::AeroDynInflowLibrary::channel_names

◆ channel_units

std::vector<std::string> kynema::util::AeroDynInflowLibrary::channel_units

◆ channel_values

std::vector<float> kynema::util::AeroDynInflowLibrary::channel_values

◆ turbines

std::vector<TurbineData> kynema::util::AeroDynInflowLibrary::turbines

The documentation for this class was generated from the following file: