util Namespace Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
|
Classes | |
class | AeroDynInflowLibrary |
Wrapper class for the AeroDynInflow (ADI) shared library. More... | |
struct | ControllerIO |
class | dylib |
struct | EnvironmentalConditions |
Struct to hold the environmental conditions. More... | |
struct | ErrorHandling |
Struct for error handling settings. More... | |
struct | FluidProperties |
Struct to hold the properties of the working fluid (air) More... | |
struct | InternalState |
struct | MeshData |
Struct to hold the motion + loads data of any structural mesh component in AeroDyn/InflowWind compatible format. More... | |
class | NetCDFFile |
Class for managing NetCDF files for writing outputs. More... | |
class | NodeStateWriter |
Class for writing Kynema nodal state data to NetCDF-based output files. More... | |
struct | SimulationControls |
Struct to hold the settings for simulation controls. More... | |
class | TimeSeriesWriter |
Class for writing time-series data to NetCDF file. More... | |
struct | TurbineConfig |
Configuration for the initial state of a turbine. More... | |
class | TurbineController |
struct | TurbineData |
Struct to hold and manage turbine-specific data. More... | |
struct | VTKSettings |
Struct to hold the settings for VTK output. More... | |
Functions | |
void | SetPositionAndOrientation (std::span< const double, 7 > data, std::span< float, 3 > position, std::array< std::array< double, 3 >, 3 > &orientation) |
Converts a 7-element array of position and quaternion to separate position and orientation arrays. | |
int | SetupFirstCall (const ControllerIO &swap, InternalState &state, char *const avcMSG) |
void | FilterGeneratorSpeed (const ControllerIO &swap, InternalState &state) |
void | VariableSpeedTorqueControl (ControllerIO &swap, InternalState &state) |
void | PitchControl (ControllerIO &swap, InternalState &state) |
int | ComputeControl (ControllerIO &swap, InternalState &state, char *const avcMSG) |
void | PackInternalStateToFile (const InternalState &state, const char *const accINFILE) |
void | UnpackInternalStateFromFile (const char *const accINFILE, InternalState &state) |
void | DISCON (float avrSWAP[], int *aviFAIL, const char *accINFILE, char *avcOUTNAME, char *avcMSG) |
This Bladed-style DLL controller is used to implement a variable-speed generator-torque controller and PI collective blade pitch controller for the NREL Offshore 5MW baseline wind turbine. This routine was originally written in Fortran by J. Jonkman of NREL/NWTC for use in the IEA Annex XXIII OC3 studies. | |
void | PITCH_CONTROLLER (float avrSWAP[], int *aviFAIL, const char *const, char *const, char *const avcMSG) |
template<> | |
int | NetCDFFile::AddVariable< std::string > (const std::string &name, std::span< const int > dim_ids) const |
Variables | |
static constexpr int | kSwapArraySize = 128 |
static constexpr double | kVS_CtInSp {70.16224} |
Transitional generator speed (HSS side) between regions 1 and 1 1/2, rad/s. | |
static constexpr double | kVS_DT {0.000125} |
Communication interval for torque controller, sec. | |
static constexpr double | kVS_MaxRat {15000.} |
Maximum torque rate (in absolute value) in torque controller, N-m/s. | |
static constexpr double | kVS_MaxTq {47402.91} |
Maximum generator torque in Region 3 (HSS side), N-m. | |
static constexpr double | kVS_Rgn2K {2.332287} |
Generator torque constant in Region 2 (HSS side), N-m/(rad/s)^2. | |
static constexpr double | kVS_Rgn2Sp {91.21091} |
Transitional generator speed (HSS side) between regions 1 1/2 and 2, rad/s. | |
static constexpr double | kVS_Rgn3MP {0.01745329} |
static constexpr double | kVS_RtGnSp {121.6805} |
Rated generator speed (HSS side), rad/s. | |
static constexpr double | kVS_RtPwr {5296610.0} |
Rated generator generator power in Region 3, Watts. | |
static constexpr double | kCornerFreq {1.570796} |
static constexpr double | kOnePlusEps {1.0 + 1.19e-07} |
A value slightly greater than unity in single precision. | |
static constexpr double | kPC_DT {0.000125} |
Communication interval for the pitch controller, sec. | |
static constexpr double | kPC_KI {0.008068634} |
Integral gain for pitch controller at rated pitch (zero), (-) | |
static constexpr double | kPC_KK {0.1099965} |
static constexpr double | kPC_KP {0.01882681} |
Proportional gain for pitch controller at rated pitch (zero), sec. | |
static constexpr double | kPC_MaxPit {1.570796} |
Maximum pitch setting in pitch controller, rad. | |
static constexpr double | kPC_MaxRat {0.1396263} |
Maximum pitch rate (in absolute value) in pitch controller, rad/s. | |
static constexpr double | kPC_MinPit {0.0} |
Minimum pitch setting in pitch controller, rad. | |
static constexpr double | kPC_RefSpd {122.9096} |
Desired (reference) HSS speed for pitch controller, rad/s. | |
static constexpr double | kVS_SlPc {10.0} |
Factor to convert radians to degrees. | |
Function Documentation
◆ ComputeControl()
|
inline |
◆ DISCON()
void kynema::util::DISCON | ( | float | avrSWAP[], |
int * | aviFAIL, | ||
const char * | accINFILE, | ||
char * | avcOUTNAME, | ||
char * | avcMSG | ||
) |
This Bladed-style DLL controller is used to implement a variable-speed generator-torque controller and PI collective blade pitch controller for the NREL Offshore 5MW baseline wind turbine. This routine was originally written in Fortran by J. Jonkman of NREL/NWTC for use in the IEA Annex XXIII OC3 studies.
- Parameters
-
avrSWAP The swap array, used to pass data to, and receive data from, the DLL controller. aviFAIL Flag used to indicate the success of this DLL call set as follows: 0 if the DLL call was successful, > 0 if the DLL call was successful but cMessage should be issued as a warning messsage, < 0 if the DLL call was unsuccessful or for any other reason the simulation is to be stopped at this point with cMessage as the error message accINFILE The name of the parameter input file, 'DISCON.IN' avcOUTNAME OUTNAME (Simulation RootName) avcMSG MESSAGE (Message from DLL to simulation code [ErrMsg]) The message which will be displayed by the calling program if aviFAIL <> 0
◆ FilterGeneratorSpeed()
|
inline |
◆ NetCDFFile::AddVariable< std::string >()
int kynema::util::NetCDFFile::AddVariable< std::string > | ( | const std::string & | name, |
std::span< const int > | dim_ids | ||
) | const |
◆ PackInternalStateToFile()
|
inline |
◆ PITCH_CONTROLLER()
void kynema::util::PITCH_CONTROLLER | ( | float | avrSWAP[], |
int * | aviFAIL, | ||
const char * | accINFILE, | ||
char * | avcOUTNAME, | ||
char * | avcMSG | ||
) |
Implement a test controller that returns pitch angle in radians (ranges from -90 to 90 starting at zero) - used for testing purposes
◆ PitchControl()
|
inline |
◆ SetPositionAndOrientation()
|
inline |
Converts a 7-element array of position and quaternion to separate position and orientation arrays.
- Parameters
-
data Input array: [x, y, z, qw, qx, qy, qz] position Output array for position [x, y, z] orientation Output array for flattened 3x3 rotation matrix
◆ SetupFirstCall()
|
inline |
◆ UnpackInternalStateFromFile()
|
inline |
◆ VariableSpeedTorqueControl()
|
inline |
Variable Documentation
◆ kCornerFreq
|
staticconstexpr |
Corner frequency (-3dB point) in the recursive, single-pole, low-pass filter, rad/s – chosen to be 1/4 the blade edgewise natural frequency ( 1/4 of approx. 1 Hz = 0.25 Hz = 1.570796 rad/s)
◆ kOnePlusEps
|
staticconstexpr |
A value slightly greater than unity in single precision.
◆ kPC_DT
|
staticconstexpr |
Communication interval for the pitch controller, sec.
◆ kPC_KI
|
staticconstexpr |
Integral gain for pitch controller at rated pitch (zero), (-)
◆ kPC_KK
|
staticconstexpr |
Pitch angle where the the derivative of the aerodynamic power w.r.t. pitch has increased by a factor of two relative to the derivative at rated pitch (zero), rad
◆ kPC_KP
|
staticconstexpr |
Proportional gain for pitch controller at rated pitch (zero), sec.
◆ kPC_MaxPit
|
staticconstexpr |
Maximum pitch setting in pitch controller, rad.
◆ kPC_MaxRat
|
staticconstexpr |
Maximum pitch rate (in absolute value) in pitch controller, rad/s.
◆ kPC_MinPit
|
staticconstexpr |
Minimum pitch setting in pitch controller, rad.
◆ kPC_RefSpd
|
staticconstexpr |
Desired (reference) HSS speed for pitch controller, rad/s.
◆ kSwapArraySize
|
staticconstexpr |
◆ kVS_CtInSp
|
staticconstexpr |
Transitional generator speed (HSS side) between regions 1 and 1 1/2, rad/s.
◆ kVS_DT
|
staticconstexpr |
Communication interval for torque controller, sec.
◆ kVS_MaxRat
|
staticconstexpr |
Maximum torque rate (in absolute value) in torque controller, N-m/s.
◆ kVS_MaxTq
|
staticconstexpr |
Maximum generator torque in Region 3 (HSS side), N-m.
◆ kVS_Rgn2K
|
staticconstexpr |
Generator torque constant in Region 2 (HSS side), N-m/(rad/s)^2.
◆ kVS_Rgn2Sp
|
staticconstexpr |
Transitional generator speed (HSS side) between regions 1 1/2 and 2, rad/s.
◆ kVS_Rgn3MP
|
staticconstexpr |
Minimum pitch angle at which the torque is computed as if we are in region 3 regardless of the generator speed, rad
◆ kVS_RtGnSp
|
staticconstexpr |
Rated generator speed (HSS side), rad/s.
◆ kVS_RtPwr
|
staticconstexpr |
Rated generator generator power in Region 3, Watts.
◆ kVS_SlPc
|
staticconstexpr |
Factor to convert radians to degrees.
Factor to convert radians per second to revolutions per minute Rated generator slip percentage in Region 2 1/2, %
Generated by