Exported Types
The Wind Farm Simulation struct
FLORIDyn.WindFarm
— TypeWindFarm
A mutable struct representing a wind farm. Fields can be specified using keyword arguments.
This struct supports convenient DataFrame access through property syntax:
wf.turbines
: Returns a DataFrame with turbine state data (columns: turbine state names)wf.windfield
: Returns a DataFrame with wind field data (columns: wind field variables)wf.ops
: Returns a DataFrame with operating point data (columns: operating point variables)
Fields
nT::Int64
: Number of turbinesnOP::Int64
: Number of operating pointsStates_WF::Matrix{Float64}
: States of the wind farm (states × wind field variables)States_OP::Matrix{Float64}
: States of the operating points (states × operating point variables)States_T::Matrix{Float64}
: States of the turbines (states × turbines variables)posBase::Matrix{Float64}
: Base positions of the turbines (2 × nT matrix: [x-coords; y-coords])posNac::Matrix{Float64}
: Positions of the nacellesD::Vector{Float64}
: Diameters of the turbinesStartI::Matrix{Int}
: Start indices for each turbineintOPs::Vector{Matrix{Float64}}
: Interpolated operating pointsWeight::Vector{Vector{Float64}}
: Weights for the operating pointsdep::Vector{Vector{Int}}
: Dependencies between turbinesred_arr::Matrix{Float64}
: Reduced array for each turbineNames_T::Vector{String}
: Names of the turbine state variablesNames_WF::Vector{String}
: Names of the wind field variablesNames_OP::Vector{String}
: Names of the operating point variables
Examples
# Create a wind farm
wf = WindFarm(nT=3, nOP=100, ...)
# Access data as DataFrames
turbine_data = wf.turbines # DataFrame with turbine states
windfield_data = wf.windfield # DataFrame with wind field states
ops_data = wf.ops # DataFrame with operating point states
Abstract types
FLORIDyn.VelModel
— TypeVelModel
Abstract type representing a velocity model in the wind field module. Subtypes of VelModel
implement specific velocity field representations or models.
See also:
- Defining the wind velocity model for more details.
FLORIDyn.DirModel
— TypeDirModel
An abstract type representing a directional wind field model. Subtypes of DirModel
should implement specific models for wind directionality.
See: Defining the wind direction model for more details.
FLORIDyn.ShearModel
— TypeShearModel
An abstract type representing a wind shear model for vertical wind profiles. Subtypes of ShearModel
should implement specific models for wind shear calculations.
See: Defining the wind shear model for more details.
FLORIDyn.TurbulenceModel
— TypeTurbulenceModel
An abstract type representing a turbulence model for wind field calculations. Subtypes of TurbulenceModel
should implement specific models for wind turbulence intensity.
See: Defining the wind turbulence model for more details.
FLORIDyn.VelCorrection
— TypeVelCorrection
An abstract type representing a velocity correction model for wind field adjustments. Subtypes of VelCorrection
should implement specific correction methods for wind velocity.
See: Defining the velocity correction for more details.
FLORIDyn.DirCorrection
— TypeDirCorrection
An abstract type representing a direction correction model for wind field adjustments. Subtypes of DirCorrection
should implement specific correction methods for wind direction.
See: Defining the direction correction for more details.
FLORIDyn.TurbulenceCorrection
— TypeTurbulenceCorrection
An abstract type representing a turbulence correction model for wind field adjustments. Subtypes of TurbulenceCorrection
should implement specific correction methods for turbulence intensity.
See: Defining the turbulence correction for more details.
FLORIDyn.IterateOPs_model
— TypeIterateOPs_model
Abstract supertype for all observation point iteration algorithms in FLORIDyn.
This abstract type defines the interface for different strategies used to advance observation points through the wind field during time-stepping simulations. All concrete iteration models must be subtypes of this abstract type.
Purpose
The iteration models determine how observation points (OPs) move through space and time, affecting:
- Wake propagation dynamics
- Spatial discretization accuracy
- Computational efficiency
- Physical representation of wind farm interactions
Implementation
Concrete subtypes implement specific iteration strategies through method dispatch on functions like iterateOPs!
. Each model represents a different approach to handling the temporal and spatial evolution of observation points.
Available Models
IterateOPs_basic
: Basic time-stepping with simple advectionIterateOPs_average
: Averaged dynamics for stabilityIterateOPs_buffer
: Buffered approach for memory efficiencyIterateOPs_maximum
: Maximum value-based iterationIterateOPs_weighted
: Weighted interpolation method
WARNING
Currently, only IterateOPs_basic
is fully implemented and tested.
FLORIDyn.ControllerModel
— TypeControllerModel
An abstract type representing a controller model for wind turbines. Subtypes of ControllerModel
should implement specific control strategies for turbine operation.
See: Defining the controller for more details.
Defining the wind velocity model
An instance of these structs needs to be passed to the functions that calculate the wind velocity. They are all subtypes of VelModel
FLORIDyn.Velocity_Constant
— TypeVelocity_Constant <: VelModel
A velocity model representing a constant wind velocity field. This struct is used as a type marker to indicate that the wind velocity does not vary in space or time.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_Constant_wErrorCov
— TypeVelocity_Constant_wErrorCov <: VelModel
A velocity model representing a constant wind field with associated error covariance. This struct is a subtype of VelModel
and is used to model wind velocity with an constant value and an error covariance for uncertainty quantification.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_EnKF_InterpTurbine
— TypeVelocity_EnKF_InterpTurbine <: VelModel
A velocity model type representing an interpolated turbine velocity field using the Ensemble Kalman Filter (EnKF) approach.
Description
This struct is used within the wind field modeling framework to represent the velocity at a turbine location, where the velocity is estimated or interpolated using EnKF-based techniques.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_I_and_I
— TypeVelocity_I_and_I <: VelModel
A velocity model implementing an interpolation and integration approach for wind velocity estimation.
Description
This struct represents a velocity model that combines interpolation techniques with integration methods to estimate wind velocity fields, typically used for advanced wind field reconstruction scenarios.
See also:
VelModel
: Abstract supertype for velocity models.
WARNING
This model is not yet implemented!
FLORIDyn.Velocity_Interpolation
— TypeVelocity_Interpolation <: VelModel
A velocity model that uses spatial interpolation techniques to estimate wind velocity fields.
Description
This struct represents a velocity model that employs interpolation methods to determine wind velocities at arbitrary spatial locations based on available measurement data or model predictions.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_Interpolation_wErrorCov
— TypeVelocity_Interpolation_wErrorCov <: VelModel
A velocity model that uses spatial interpolation with associated error covariance information.
Description
This struct represents a velocity model that employs interpolation methods to determine wind velocities and includes error covariance matrices for uncertainty quantification and probabilistic analysis.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_InterpTurbine
— TypeVelocity_InterpTurbine <: VelModel
A velocity model for interpolating wind velocities specifically at turbine locations.
Description
This struct represents a velocity model that focuses on estimating wind velocities at turbine hub heights and rotor positions using interpolation techniques from surrounding measurement points or model data.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_InterpTurbine_wErrorCov
— TypeVelocity_InterpTurbine_wErrorCov <: VelModel
A velocity model for interpolating wind velocities at turbine locations with error covariance information.
Description
This struct represents a velocity model that estimates wind velocities at turbine positions using interpolation techniques and includes associated error covariance matrices for uncertainty analysis and robust wind farm control applications.
See also:
VelModel
: Abstract supertype for velocity models.
FLORIDyn.Velocity_RW_with_Mean
— TypeVelocity_RW_with_Mean <: VelModel
A velocity model implementing a random walk process with a mean trend component.
Description
This struct represents a velocity model that combines a random walk stochastic process with a deterministic mean component, typically used for modeling wind velocity evolution over time with both predictable trends and random fluctuations.
See also:
VelModel
: Abstract supertype for velocity models.
WARNING
This model is not yet implemented!
FLORIDyn.Velocity_ZOH_wErrorCov
— TypeVelocity_ZOH_wErrorCov <: VelModel
A velocity model using Zero-Order Hold (ZOH) interpolation with error covariance information.
Description
This struct represents a velocity model that employs zero-order hold interpolation (piecewise constant) for wind velocity estimation between measurement points, and includes error covariance matrices for uncertainty quantification and statistical analysis.
See also:
VelModel
: Abstract supertype for velocity models.
Defining the wind direction model
An instance of these structs needs to be passed to the functions that calculate the wind direction. They are all subtypes of DirModel
FLORIDyn.Direction_Constant
— TypeDirection_Constant <: DirModel
A marker struct used to represent a constant wind direction.
Example:
dir_mode = Direction_constant()
phi = getWindDirT(dir_mode, 270, [1,2,3], nothing)
FLORIDyn.Direction_Constant_wErrorCov
— TypeDirection_Constant_wErrorCov <: DirModel
A marker struct used to indicate a wind direction that is constant with associated error covariance.
FLORIDyn.Direction_EnKF_InterpTurbine
— TypeDirection_EnKF_InterpTurbine <: DirModel
A marker struct used to indicate the use of direction-aware Ensemble Kalman Filter (EnKF) interpolation for turbine modeling.
FLORIDyn.Direction_Interpolation
— TypeDirection_Interpolation <: DirModel
A marker struct used to represent direction interpolation functionality within the FLORIDyn framework.
FLORIDyn.Direction_Interpolation_wErrorCov
— TypeDirection_Interpolation_wErrorCov <: DirModel
A marker struct representing a direction interpolation method with associated error covariance.
FLORIDyn.Direction_InterpTurbine
— TypeDirection_InterpTurbine <: DirModel
A marker struct used to indicate direction interpolation for turbines.
FLORIDyn.Direction_InterpTurbine_wErrorCov
— TypeDirection_InterpTurbine_wErrorCov <: DirModel
A marker struct used to indicate the use of direction interpolation for turbines with associated error covariance.
FLORIDyn.Direction_RW_with_Mean
— TypeDirection_RW_with_Mean <: DirModel
A marker struct used to indicate the use of a random walk direction model with a mean component.
Defining the wind shear model
An instance of these structs needs to be passed to the functions that calculate the wind shear.
FLORIDyn.Shear_Interpolation
— TypeShear_Interpolation <: ShearModel
A marker struct used to represent the linear interpolation for wind shear profiles.
See also
FLORIDyn.Shear_PowerLaw
— TypeShear_PowerLaw <: ShearModel
A marker struct representing the logarithmic law for modeling wind shear profiles.
See also
Defining the wind turbulence model
An instance of these structs needs to be passed to the functions that calculate the wind turbulence.
FLORIDyn.TI_Constant
— TypeTI_Constant <: TurbulenceModel
A marker struct representing a constant turbulence intensity.
FLORIDyn.TI_EnKF_InterpTurbine
— TypeTI_EnKF_InterpTurbine <: TurbulenceModel
A marker struct representing the Turbulence Intensity (TI) Ensemble Kalman Filter (EnKF) interpolation model.
WARNING
This model is not yet implemented!
FLORIDyn.TI_Interpolation
— TypeTI_Interpolation <: TurbulenceModel
A marker struct representing the interpolation method for modeling the turbulence.
FLORIDyn.TI_InterpTurbine
— TypeTI_InterpTurbine <: TurbulenceModel
A marker struct representing an interpolated turbine model for turbulence intensity calculations.
Defining the velocity correction
An instance of these structs needs to be passed to the functions that correct wind velocity. They are all subtypes of VelCorrection
FLORIDyn.Velocity_Influence
— TypeVelocity_Influence <: VelCorrection
A marker struct used to represent velocity correction based on influence modeling.
WARNING
This correction type is not yet implemented!
FLORIDyn.Velocity_None
— TypeVelocity_None <: VelCorrection
A marker struct used to indicate that no velocity corrections should be applied.
Defining the direction correction
An instance of these structs needs to be passed to the functions that correct wind direction. They are all subtypes of DirCorrection
FLORIDyn.Direction_All
— TypeDirection_All <: DirCorrection
A marker struct used to indicate that all direction corrections should be applied.
FLORIDyn.Direction_Influence
— TypeDirection_Influence <: DirCorrection
A marker struct used to represent direction correction based on influence modeling.
WARNING
This correction type is not yet implemented!
FLORIDyn.Direction_None
— TypeDirection_None <: DirCorrection
A marker struct used to indicate that no direction corrections should be applied.
WARNING
This correction type is not yet implemented!
Defining the turbulence correction
An instance of these structs needs to be passed to the functions that correct turbulence intensity. They are all subtypes of TurbulenceCorrection
FLORIDyn.TI_Influence
— TypeTI_Influence <: TurbulenceCorrection
A marker struct used to represent turbulence intensity correction based on influence modeling.
WARNING
This correction type is not yet implemented!
FLORIDyn.TI_None
— TypeTI_None <: TurbulenceCorrection
A marker struct used to indicate that no turbulence intensity corrections should be applied.
Defining the controller
An instance of these structs needs to be passed to the functions that control turbine behavior. They are all subtypes of ControllerModel
FLORIDyn.Yaw_Constant
— TypeYaw_Constant <: ControllerModel
A marker struct used to represent a constant yaw control strategy. In this mode, turbines maintain a fixed yaw angle throughout the simulation.
FLORIDyn.Yaw_InterpTurbine
— TypeYaw_InterpTurbine <: ControllerModel
A marker struct used to indicate yaw control with turbine interpolation. This mode allows for interpolated yaw angles across different turbine positions.
FLORIDyn.Yaw_SOWFA
— TypeYaw_SOWFA <: ControllerModel
A marker struct used to represent yaw control compatible with SOWFA (Simulator fOr Wind Farm Applications). This mode is specifically designed for integration with SOWFA simulation data.
Defining the OP iteration model
An instance of these structs needs to be passed to the functions that iterate observation points (OPs) through the wind field. They are all subtypes of IterateOPs_model
FLORIDyn.IterateOPs_average
— TypeIterateOPs_average <: IterateOPs_model
Observation point iteration model using averaged dynamics.
This iteration strategy employs averaging techniques to advance observation points through the wind field, providing enhanced numerical stability and smoother wake evolution compared to basic methods.
Algorithm Characteristics
- Stability: Improved numerical stability through temporal averaging
- Smoothness: Reduces oscillations in wake dynamics
- Computational Cost: Moderate overhead due to averaging operations
- Accuracy: Good balance between stability and physical representation
Use Cases
Recommended for:
- Simulations requiring smooth wake evolution
- Cases with high turbulence or complex wind conditions
- Long-duration simulations where stability is critical
- Research applications focusing on ensemble statistics
Mathematical Approach
The averaging process involves temporal or spatial averaging of relevant quantities (velocities, deflections, turbulence) before applying the advancement step, resulting in more stable observation point trajectories.
Notes
This model may require additional computational resources compared to basic methods but provides better stability characteristics for challenging simulation scenarios.
WARNING
Not yet implemented
FLORIDyn.IterateOPs_basic
— TypeIterateOPs_basic <: IterateOPs_model
Basic observation point iteration model with simple time-stepping.
This is the fundamental iteration strategy that advances observation points using direct time-stepping based on local wind velocities and wake deflection effects. It provides the core functionality for FLORIDyn simulations.
Algorithm Characteristics
- Simplicity: Straightforward implementation with minimal overhead
- Performance: Fastest execution among available iteration models
- Accuracy: Direct physical representation of wake advection
- Memory: Minimal memory requirements
Implementation
The basic algorithm performs:
- Downwind advection based on local wind speed
- Crosswind deflection using wake centerline calculations
- Coordinate transformation to world coordinates
- Temporal advancement through circular shifting
- Spatial reordering to maintain downstream position order
Use Cases
Recommended for:
- Standard wind farm simulations
- Performance-critical applications
- Validation studies against reference data
- Initial model development and testing
Mathematical Foundation
Uses explicit time-stepping with:
Δx = U × Δt × advection_factor
where observation points move downstream based on local wind conditions.
Notes
This model serves as the reference implementation and baseline for comparison with other iteration strategies. See iterateOPs!
for detailed implementation.
FLORIDyn.IterateOPs_buffer
— TypeIterateOPs_buffer <: IterateOPs_model
Observation point iteration model with buffered memory management.
This iteration strategy implements buffering techniques to optimize memory usage and computational efficiency during observation point advancement, particularly beneficial for large-scale wind farm simulations.
Algorithm Characteristics
- Memory Efficiency: Optimized memory access patterns
- Scalability: Better performance for large numbers of observation points
- Caching: Intelligent buffering of frequently accessed data
- Computational Cost: Reduced overhead for memory-intensive operations
Use Cases
Recommended for:
- Large wind farms with many turbines
- Memory-constrained computing environments
- High-resolution simulations with dense observation point grids
- Production simulations requiring optimal resource utilization
Implementation Strategy
The buffering approach manages observation point data through:
- Efficient memory allocation patterns
- Reduced data copying operations
- Optimized access to state matrices
- Strategic caching of intermediate results
Performance Benefits
- Improved cache locality for better CPU performance
- Reduced memory bandwidth requirements
- Better scaling with problem size
- Lower memory fragmentation
Notes
This model is particularly effective when computational resources are limited or when dealing with very large simulation domains.
FLORIDyn.IterateOPs_maximum
— TypeIterateOPs_maximum <: IterateOPs_model
Observation point iteration model using maximum value selection.
This iteration strategy employs maximum value-based decision making during observation point advancement, potentially useful for conservative estimates or worst-case scenario analysis in wind farm simulations.
Algorithm Characteristics
- Conservative Approach: Tends toward maximum/conservative values
- Robustness: Provides bounds on simulation behavior
- Special Cases: Handles extreme conditions effectively
- Analysis: Useful for sensitivity and worst-case studies
Use Cases
Recommended for:
- Conservative design analysis
- Worst-case scenario evaluation
- Risk assessment studies
- Validation of simulation bounds
- Research on extreme wind conditions
Mathematical Approach
The maximum selection process applies maximum operators to relevant quantities during the iteration step, which may include:
- Maximum wind speeds in the vicinity
- Maximum deflection values
- Maximum turbulence intensities
- Conservative time step selection
Applications
Particularly useful in:
- Safety factor determination
- Conservative power estimation
- Extreme load analysis
- Uncertainty quantification studies
Notes
This model may produce more conservative results compared to other iteration strategies and should be used when understanding bounds on simulation behavior is important.
WARNING
Not yet implemented
FLORIDyn.IterateOPs_weighted
— TypeIterateOPs_weighted <: IterateOPs_model
Observation point iteration model using weighted interpolation.
This iteration strategy employs sophisticated weighted interpolation techniques to advance observation points, providing enhanced accuracy through spatial and temporal weighting of relevant physical quantities.
Algorithm Characteristics
- High Accuracy: Superior interpolation accuracy
- Smoothness: Smooth transitions between observation points
- Computational Cost: Higher due to interpolation calculations
- Flexibility: Adaptable weighting schemes
Use Cases
Recommended for:
- High-accuracy research simulations
- Detailed wake interaction studies
- Validation against experimental data
- Applications requiring smooth field representations
- Advanced control algorithm development
Interpolation Strategy
The weighted approach typically involves:
- Distance-based spatial weighting
- Temporal interpolation of quantities
- Multi-point interpolation schemes
- Adaptive weight calculation based on local conditions
Mathematical Foundation
Uses interpolation weights w_i such that:
quantity_interpolated = Σ w_i × quantity_i
where weights satisfy Σ w_i = 1 and are computed based on distance, time, or other relevant metrics.
Accuracy Benefits
- Reduced numerical diffusion
- Better preservation of wake structures
- Improved representation of turbulence effects
- Enhanced spatial resolution
Notes
This model provides the highest accuracy among available iteration strategies but requires additional computational resources. Best suited for applications where accuracy is prioritized over computational speed.
WARNING
Not yet implemented
Types for storing wind field params
FLORIDyn.WindDirType
— Type WindDirType
Fields
- Data::Float64: wind direction value
- CholSig::Matrix{Float64}: Cholesky factor of covariance matrix (nT x nT)
FLORIDyn.WindDirMatrix
— Typestruct WindDirMatrix
Fields
Data
::Matrix{Float64}: Columns [time, phi] or [time,phi_T0
,phi_T1
, ...phi_Tn
]CholSig
::Matrix{Float64}: Cholesky factor of covariance matrix (nT x nT)
FLORIDyn.WindDirTriple
— TypeWindDirTriple
A structure representing a wind direction triple.
Fields
- Init::Vector{Float64}: Mean direction (vector or scalar)
- CholSig::Matrix{Float64}: Cholesky factor of covariance matrix (nT x nT)
- MeanPull::Float64: Scalar mean reversion factor
FLORIDyn.WindVelType
— Type WindVelType
Fields
- Data::Float64: wind speed
- CholSig::Matrix{Float64}: Cholesky factor of covariance matrix (nT x nT)
FLORIDyn.WindVelMatrix
— Typestruct WindVelMatrix
Fields
- Data::Matrix{Float64}: Nx2 matrix: column 1 = time, column 2 = wind speed
- CholSig::Matrix{Float64}: Cholesky factor of covariance matrix (nT x nT)
FLORIDyn.WindShear
— TypeWindShear
A struct representing the wind shear profile. This type is used to model the variation of wind speed with height, which is important in atmospheric and wind energy simulations.
Fields
- z0::Float64: Reference height (not used in the
getWindShearT
) - alpha::Float64: WindShear coefficient
FLORIDyn.WindPerturbation
— TypeWindPerturbation
A mutable struct for configuring stochastic wind perturbations in wind farm simulations.
This struct controls whether perturbations are applied to different wind parameters and defines the magnitude of these perturbations using standard deviations. Wind perturbations are used to model uncertainty in wind measurements or to perform sensitivity analysis.
Fields
vel::Bool
: Enable/disable velocity perturbations. Whentrue
, random perturbations are applied to wind velocity.vel_sigma::Float64
: Standard deviation for velocity perturbations [m/s]. Determines the magnitude of random variations added to the wind velocity.dir::Bool
: Enable/disable direction perturbations. Whentrue
, random perturbations are applied to wind direction.dir_sigma::Float64
: Standard deviation for direction perturbations [degrees]. Determines the magnitude of random variations added to the wind direction.ti::Bool
: Enable/disable turbulence intensity perturbations. Whentrue
, random perturbations are applied to turbulence intensity.ti_sigma::Float64
: Standard deviation for turbulence intensity perturbations [-]. Determines the magnitude of random variations added to the turbulence intensity.
Notes
- Perturbations are typically applied as additive Gaussian noise with zero mean and the specified standard deviation
- The perturbation flags (
vel
,dir
,ti
) act as switches to enable or disable specific types of perturbations - Setting a flag to
false
will disable perturbations for that parameter regardless of the sigma value - Standard deviations should be positive values.
Other types
FLORIDyn.MSR
— TypeMSR `VelReduction` `AddedTurbulence` `EffWind`
Enumeration that selects which (scalar) quantity is visualised / stored when plotting or saving flow field measurements. The acronym stands for Measurement System Representation. Passed via the msr
keyword to run_floridyn
and the plotting helpers plot_flow_field
, plot_measurements
.
Elements
VelReduction
(1): Velocity reduction (1 - u / u_ref) downstream of turbines.AddedTurbulence
(2): Added turbulence intensity contributed by wakes (ΔTI component).EffWind
(3): Effective wind speed at turbine locations (including wake effects).
Usage
# Use default (VelReduction)
run_floridyn(plt, set, wf, wind, sim, con, vis, floridyn, floris)
# Explicitly request added turbulence visualisation
run_floridyn(plt, set, wf, wind, sim, con, vis, floridyn, floris; msr=AddedTurbulence)
# Convert from a user string (e.g. parsed CLI / YAML value)
msr = toMSR("EffWind")
run_floridyn(plt, set, wf, wind, sim, con, vis, floridyn, floris; msr)
See also: toMSR
FLORIDyn.States
— TypeStates
Lightweight container for state variable names and counts used in wind farm simulations.
This mutable struct organizes the state variables into three categories: turbine states, observation point (OP) states, and wind field (WF) states. It provides both the variable names and their counts for efficient memory allocation and state management.
Fields
T_names::Vector{String}
: Names of turbine state variables ["a", "yaw", "TI"]Turbine::Int
: Number of turbine state variables (3)OP_names::Vector{String}
: Names of observation point variables ["x0", "y0", "z0", "x1", "y1", "z1"]OP::Int
: Number of observation point variables (6)WF_names::Vector{String}
: Names of wind field variables ["windvel", "winddir", "TI0"]WF::Int
: Number of wind field variables (3)
Constructor
Use the default constructor States()
to create an instance with predefined variable names and counts currently used by FLORIDyn.jl.
Example
states = States()
println("Turbine states: ", states.T_names)
println("Number of turbine states: ", states.Turbine)
State Variable Definitions
Turbine States (T_names)
"a"
: Axial induction factor [-]"yaw"
: Yaw angle [degrees]"TI"
: Local turbulence intensity [-]
Observation Point States (OP_names)
"x0", "y0", "z0"
: Initial position coordinates [m]"x1", "y1", "z1"
: Final position coordinates [m]
Wind Field States (WF_names)
"wind_vel"
: Wind velocity [m/s]"wind_dir"
: Wind direction [degrees]"TI0"
: Ambient turbulence intensity [-]
See also: States()
FLORIDyn.UnifiedBuffers
— TypeUnifiedBuffers
Unified buffer struct containing all arrays needed by interpolateOPs! and setUpTmpWFAndRun!.
Fields
dist_buffer::Vector{Float64}
: Distance calculations for interpolateOPs!sorted_indices_buffer::Vector{Int}
: Sorted indices for interpolateOPs!M_buffer::Matrix{Float64}
: Main result buffer for setUpTmpWFAndRun!iTWFState_buffer::Vector{Float64}
: Turbine wind field state buffertmp_Tpos_buffer::Matrix{Float64}
: Temporary turbine position buffertmp_WF_buffer::Matrix{Float64}
: Temporary wind field buffertmp_Tst_buffer::Matrix{Float64}
: Temporary turbine state bufferdists_buffer::Vector{Float64}
: Distance buffer for setUpTmpWFAndRun!plot_WF_buffer::Matrix{Float64}
: Wind field plotting bufferplot_OP_buffer::Matrix{Float64}
: Observation point plotting bufferfloris_buffers
: Pre-allocated FLORIS computation buffers for wind wake calculations
FLORIDyn.IterateOPsBuffers
— TypeIterateOPsBuffers
A struct containing pre-allocated buffers for allocation-free execution of iterateOPs!.
This struct eliminates all allocations during the observation point iteration by pre-allocating all necessary temporary arrays. It should be created once and reused across multiple calls to iterateOPs! for maximum performance.
Fields
tmpOPStates::Matrix{Float64}
: Buffer for saving turbine observation point statestmpTStates::Matrix{Float64}
: Buffer for saving turbine statestmpWFStates::Matrix{Float64}
: Buffer for saving wind farm statesstep_dw::Vector{Float64}
: Buffer for downwind step calculationsdeflection::Matrix{Float64}
: Buffer for centerline deflection calculationsstep_cw::Matrix{Float64}
: Buffer for crosswind step calculationstemp_states_op::Matrix{Float64}
: Temporary buffer for States_OP circular shiftingtemp_states_t::Matrix{Float64}
: Temporary buffer for States_T circular shiftingtemp_states_wf::Matrix{Float64}
: Temporary buffer for States_WF circular shiftingsort_buffer::Vector{Int}
: Buffer for sorting observation points
Constructor
IterateOPsBuffers(wf::WindFarm)
Creates buffers appropriately sized for the given WindFarm object.
FLORIDyn.FLORISBuffers
— TypeFLORISBuffers
Pre-allocated buffers for the runFLORIS! computation to minimize allocations.
This struct also persists result arrays so callers can read outputs without allocations. After calling runFLORIS!
, the following fields contain results:
Output Fields
T_red_arr::Vector{Float64}
: Per-turbine velocity reduction factors. For a single-turbine run, length is 1 andT_red_arr[1]
is the scalar reduction.T_aTI_arr::Vector{Float64}
: Added turbulence intensity from upstream wakes. For N turbines, length ismax(N-1, 0)
. Empty for single-turbine runs.T_Ueff::Vector{Float64}
: Effective wind speed at the last turbine as a length-1 vector (multi-turbine case). Empty for single-turbine runs.T_weight::Vector{Float64}
: Gaussian weight factors used for wake overlap. For N turbines, length ismax(N-1, 0)
. Empty for single-turbine runs.