preprocess_windio_for_BE Namespace Reference

Kynema API: preprocess_windio_for_BE Namespace Reference
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
preprocess_windio_for_BE Namespace Reference

Classes

class  WindIOPreprocessor
 

Functions

Tuple[np.ndarray, np.ndarray] extract_coordinate_data (Dict airfoil_info, str airfoil_name)
 
Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray] extract_polar_coefficients_data (Dict polar_set)
 
np.ndarray calculate_arc_length_parameterization (np.ndarray x, np.ndarray y)
 
np.ndarray create_non_uniform_AoA_grid (int total_points=361)
 
Any numpy_array_to_serializable_list (Any object)
 
 main ()
 

Function Documentation

◆ calculate_arc_length_parameterization()

np.ndarray preprocess_windio_for_BE.calculate_arc_length_parameterization ( np.ndarray  x,
np.ndarray  y 
)
Calculates cumulative arc length parameterization for a curve.

This parameterization is needed to create a uniform surface parameter
that accounts for the actual geometric spacing along the curve, enabling
proper interpolation to a common grid regardless of the original
coordinate point distribution.

Args:
    x: x-coordinates of the curve as numpy array
    y: y-coordinates of the curve as numpy array

Returns:
    Normalized arc length parameter s in range [0, 1] as numpy array

◆ create_non_uniform_AoA_grid()

np.ndarray preprocess_windio_for_BE.create_non_uniform_AoA_grid ( int   total_points = 361)
Creates a non-uniform angle-of-attack grid with higher resolution in the linear region.

This grid provides higher resolution in the linear lift region (approximately -π/6 to π/6)
where airfoil behavior is most predictable and important for normal operation, and lower
resolution in the stall regions where behavior is more complex but less frequently used.
The total number of points is 361 by default, which provides 1 degree of resolution
averaged over the AoA range of -π to π.

Args:
    total_points: Total number of points in the grid (default: 361)

Returns:
    Non-uniform angle-of-attack array in radians from -π to π

◆ extract_coordinate_data()

Tuple[np.ndarray, np.ndarray] preprocess_windio_for_BE.extract_coordinate_data ( Dict  airfoil_info,
str   airfoil_name 
)
Extracts x, y coordinates from airfoil info in windIO file.

Args:
    airfoil_info: Dictionary containing airfoil information
    airfoil_name: Name of airfoil (for error messages)

Returns:
    Tuple of (x_coords, y_coords) as numpy arrays

◆ extract_polar_coefficients_data()

Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray] preprocess_windio_for_BE.extract_polar_coefficients_data ( Dict   polar_set)
Extracts values of alpha, cl, cd, cm for an airfoil from polar data provided in windIO file.
alpha: angle of attack [rad]
cl: lift coefficient [-]
cd: drag coefficient [-]
cm: moment coefficient [-]

Args:
    polar_set: Dictionary containing polar data

Returns:
    Tuple of (alpha, cl, cd, cm) numpy arrays

◆ main()

preprocess_windio_for_BE.main ( )
Main function to parse arguments and preprocess windIO data.

Example usage (run from the build directory):
    python ../src/utilities/scripts/preprocess_windio_for_BE.py \
        tests/regression_tests/interfaces/interfaces_test_files/IEA-15-240-RWT.yaml \
        --output processed_windIO_data.yaml \
        --nodes 50

NOTE: Output file is overwritten if it already exists.

◆ numpy_array_to_serializable_list()

Any preprocess_windio_for_BE.numpy_array_to_serializable_list ( Any  object)
Converts numpy arrays to lists for YAML serialization.

Args:
    object: Object that may contain numpy arrays

Returns:
    Object with numpy arrays converted to lists