TurbineInterface Class Reference

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

Interface for blade simulation that manages state, solver, and components. More...

#include <turbine_interface.hpp>

Public Types

using DeviceType = Kokkos::Device< Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space >
 

Public Member Functions

 TurbineInterface (const components::SolutionInput &solution_input, const components::TurbineInput &turbine_input, const components::AerodynamicsInput &aerodynamics_input={}, const components::ControllerInput &controller_input={})
 Constructs a TurbineInterface from solution and blade inputs.
 
components::TurbineTurbine ()
 Returns a reference to the turbine model.
 
void UpdateAerodynamicLoads (double fluid_density, const std::function< std::array< double, 3 >(const std::array< double, 3 > &)> &inflow_function)
 Updates the aerodynamic loads to be applied to the sturcture based on a provided function.
 
bool Step ()
 Steps forward in time.
 
void SaveState ()
 Saves the current state for potential restoration (in correction step)
 
void RestoreState ()
 Restores the previously saved state (in correction step)
 
ModelGetModel ()
 Return a reference of the model owned by this interface.
 
HostState< DeviceType > & GetHostState ()
 Return a reference to this interface's host state.
 
double CalculateAzimuthAngle () const
 Calculates and normalizes azimuth angle from constraint output.
 
double CalculateRotorSpeed () const
 Calculates rotor speed from constraint output.
 

Detailed Description

Interface for blade simulation that manages state, solver, and components.

This class represents the primary interface for simulating a WT blade, connecting the blade components with the solver and state management.

Member Typedef Documentation

◆ DeviceType

using kynema::interfaces::TurbineInterface::DeviceType = Kokkos::Device<Kokkos::DefaultExecutionSpace, Kokkos::DefaultExecutionSpace::memory_space>

Constructor & Destructor Documentation

◆ TurbineInterface()

kynema::interfaces::TurbineInterface::TurbineInterface ( const components::SolutionInput solution_input,
const components::TurbineInput turbine_input,
const components::AerodynamicsInput aerodynamics_input = {},
const components::ControllerInput controller_input = {} 
)
explicit

Constructs a TurbineInterface from solution and blade inputs.

Parameters
solution_inputConfiguration parameters for solver and solution
turbine_inputConfiguration parameters for the turbine geometry
aerodynamics_inputConfiguration parameters for the aerodynamic loads
controller_inputConfiguration parameters for the controller

Member Function Documentation

◆ CalculateAzimuthAngle()

double kynema::interfaces::TurbineInterface::CalculateAzimuthAngle ( ) const

Calculates and normalizes azimuth angle from constraint output.

Returns
Azimuth angle in radians, normalized to [0, 2π)

◆ CalculateRotorSpeed()

double kynema::interfaces::TurbineInterface::CalculateRotorSpeed ( ) const

Calculates rotor speed from constraint output.

Returns
Rotor speed in rad/s

◆ GetHostState()

HostState< DeviceType > & kynema::interfaces::TurbineInterface::GetHostState ( )
inline

Return a reference to this interface's host state.

◆ GetModel()

Model & kynema::interfaces::TurbineInterface::GetModel ( )
inline

Return a reference of the model owned by this interface.

◆ RestoreState()

void kynema::interfaces::TurbineInterface::RestoreState ( )

Restores the previously saved state (in correction step)

◆ SaveState()

void kynema::interfaces::TurbineInterface::SaveState ( )

Saves the current state for potential restoration (in correction step)

◆ Step()

bool kynema::interfaces::TurbineInterface::Step ( )

Steps forward in time.

Returns
true if solver converged, false otherwise
Note
This function updates the host state with current node loads, solves the dynamic system, and updates the node motion with the new state. If the solver does not converge, the motion is not updated.

◆ Turbine()

components::Turbine & kynema::interfaces::TurbineInterface::Turbine ( )

Returns a reference to the turbine model.

◆ UpdateAerodynamicLoads()

void kynema::interfaces::TurbineInterface::UpdateAerodynamicLoads ( double  fluid_density,
const std::function< std::array< double, 3 >(const std::array< double, 3 > &)> &  inflow_function 
)

Updates the aerodynamic loads to be applied to the sturcture based on a provided function.

Parameters
fluid_densityThe density of the air (assumed constant)
inflow_functionA function that takes in a position and returns the velocity

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