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={}, const components::OutputsConfig &outputs_config={})
 Constructs a TurbineInterface from solution and blade inputs.
 
 TurbineInterface (TurbineInterface &other)=delete
 
 TurbineInterface (TurbineInterface &&other)=delete
 
TurbineInterfaceoperator= (const TurbineInterface &)=delete
 
TurbineInterfaceoperator= (TurbineInterface &&)=delete
 
 ~TurbineInterface ()=default
 
components::TurbineTurbine ()
 Returns a reference to the turbine model.
 
components::AerodynamicsAerodynamics ()
 Returns a reference to the aerodynamics 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 structure based on a provided function.
 
std::array< double, 3 > GetHubNodePosition () const
 
void SetHubInflow (const std::array< double, 3 > &inflow)
 
void ApplyController (double t)
 Update controller inputs from current system state.
 
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.
 
void WriteOutput ()
 
void OpenOutputFile ()
 
void CloseOutputFile ()
 

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() [1/3]

kynema::interfaces::TurbineInterface::TurbineInterface ( const components::SolutionInput solution_input,
const components::TurbineInput turbine_input,
const components::AerodynamicsInput aerodynamics_input = {},
const components::ControllerInput controller_input = {},
const components::OutputsConfig outputs_config = {} 
)
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
outputs_configConfiguration parameters for the outputs

◆ TurbineInterface() [2/3]

kynema::interfaces::TurbineInterface::TurbineInterface ( TurbineInterface other)
delete

◆ TurbineInterface() [3/3]

kynema::interfaces::TurbineInterface::TurbineInterface ( TurbineInterface &&  other)
delete

◆ ~TurbineInterface()

kynema::interfaces::TurbineInterface::~TurbineInterface ( )
default

Member Function Documentation

◆ Aerodynamics()

components::Aerodynamics & kynema::interfaces::TurbineInterface::Aerodynamics ( )
inline

Returns a reference to the aerodynamics model.

◆ ApplyController()

void kynema::interfaces::TurbineInterface::ApplyController ( double  t)

Update controller inputs from current system state.

◆ 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

◆ CloseOutputFile()

void kynema::interfaces::TurbineInterface::CloseOutputFile ( )

◆ GetHostState()

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

Return a reference to this interface's host state.

◆ GetHubNodePosition()

std::array< double, 3 > kynema::interfaces::TurbineInterface::GetHubNodePosition ( ) const

◆ GetModel()

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

Return a reference of the model owned by this interface.

◆ OpenOutputFile()

void kynema::interfaces::TurbineInterface::OpenOutputFile ( )

◆ operator=() [1/2]

TurbineInterface & kynema::interfaces::TurbineInterface::operator= ( const TurbineInterface )
delete

◆ operator=() [2/2]

TurbineInterface & kynema::interfaces::TurbineInterface::operator= ( TurbineInterface &&  )
delete

◆ 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)

◆ SetHubInflow()

void kynema::interfaces::TurbineInterface::SetHubInflow ( const std::array< double, 3 > &  inflow)

◆ 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 ( )
inline

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 structure 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

◆ WriteOutput()

void kynema::interfaces::TurbineInterface::WriteOutput ( )

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