NREL Plugin

Defines the NREL Wind Plugin for spawn

class spawnwind.nrel.AerodynInput(lines, root_folder, wind_gen_spawner)[source]

Handles contents of Aerodyn (FAST aerodynamics) input file, which defines wind input for versions < 8.12

get_wind_gen_tasks(prereq_dir, metadata)[source]

Create wind generation tasks to create new wind find if necessary :param prereq_dir: Output directory for prerequisite simulations :param metadata: Metadata for wind generation task :return: list of wind generation tasks (size 0 or 1)

property wind_type
Returns

Type of wind as a lowercase string (.e.g. ‘bladed’, ‘turbsim’, ‘steady’)

spawnwind.nrel.ETM(Iref, Vmean, wind_speed)[source]

Additional evaluator - evaluates turbulence intensity according to IEC edition 3 extreme turbulence model

Parameters
  • Iref – Reference turbulence intensity in percent according to turbine class

  • Vmean – Annual mean wind speed according to turbine class

  • wind_speed – 10-minute mean wind speed in m/s

Returns

Turbulence intensity in percent

class spawnwind.nrel.Fast7Input(input_lines, root_folder)[source]

Manager for main FAST input file v7

get_aero_input(wind_input)[source]
Parameters

wind_inputWindInput instance, which will be used also for aerodynamic input if they are in the same file such as in FAST 7

Returns

AeroInput instance for managing the aerodynamic setting inputs

get_elastodyn_input()[source]
Returns

An instance responsible for handling structural inputs

get_servodyn_input(blade_range)[source]
Parameters

blade_range – iterable containing the numbers of the blades (e.g. [1, 2, 3])

Returns

A FastServoInput instance for managing control and manoeuvre inputs

get_wind_input(wind_gen_spawner)[source]
Parameters

wind_gen_spawner – Spawner of wind generation tasks

Returns

WindInput instance for managing the contents of the input file for wind inflow

class spawnwind.nrel.Fast8Input(input_lines, root_folder)[source]

Manager for main FAST input file v8

get_aero_input(_wind_input)[source]
Parameters

wind_inputWindInput instance, which will be used also for aerodynamic input if they are in the same file such as in FAST 7

Returns

AeroInput instance for managing the aerodynamic setting inputs

get_elastodyn_input()[source]
Returns

An instance responsible for handling structural inputs

get_servodyn_input(blade_range)[source]
Parameters

blade_range – iterable containing the numbers of the blades (e.g. [1, 2, 3])

Returns

A FastServoInput instance for managing control and manoeuvre inputs

get_wind_input(wind_gen_spawner)[source]
Parameters

wind_gen_spawner – Spawner of wind generation tasks

Returns

WindInput instance for managing the contents of the input file for wind inflow

class spawnwind.nrel.FastSimulationSpawner(fast_input, wind_spawner, prereq_outdir)[source]

Spawns FAST simulation tasks with wind generation dependency if necessary

branch()[source]

Create a copy of this spawner

Returns

A copy of this spawner with all values equal

Return type

FastSimulationSpawner

spawn(path_, metadata)[source]

Spawn a simulation task

Parameters
  • path (str) – The output path for the task

  • metadata (dict) – Metadata to add to the task

Returns

The simulation task

Return type

SimulationTask

class spawnwind.nrel.FastSimulationTask(*args, **kwargs)[source]

Implementation of SimulationTask for FAST

output()[source]

The output of this task

Returns

Target to the .outb path

Return type

luigi.LocalTarget

class spawnwind.nrel.NRELSimulationInput(input_lines, root_folder)[source]

Handles contents of input files for NREL’s aeroelastic modules such as FAST, AeroDyn and TurbSim. These tend to be of a whitespace separated {value|key} format with newlines separating key:value pairs

classmethod from_file(file_path, **kwargs)[source]

Creates a NRELSimulationInput by loading a file

Parameters

file_path (path-like) – The file path to load

Returns

The simulation input object

Return type

An instance of NRELSimulationInput

get_on_blade(base_key, blade_number)[source]

Get property for a particular blade :param base_key: Key excluding the blade number identifier :param blade_number: Blade number as an integer :return: Value of property

hash()[source]

Returns a hash of the contents of the file

Returns

The hash

Return type

str

set_on_blade(base_key, blade_number, value)[source]

Set property on a particular blade :param base_key: Key excluding the blade number identifier :param blade_number: Blade number as an integer :param value: Value to set

to_file(file_path)[source]

Writes the contents of the input file to disk

Parameters

file_path (path-like) – The path of the file to write

spawnwind.nrel.NTM(Iref, wind_speed)[source]

Additional evaluator - evaluates turbulence intensity according to IEC edition 3 normal turbulence model

Parameters
  • Iref – Reference turbulence intensity in percent according to turbine class

  • wind_speed – 10-minute mean wind speed in m/s

Returns

Turbulence intensity in percent

class spawnwind.nrel.TurbsimInput(input_lines, root_folder)[source]

Handles contents of TurbSim (FAST wind generation) input file

class spawnwind.nrel.TurbsimSpawner(turbsim_input)[source]

Spawns TurbSim wind generation tasks

branch()[source]

Deep copy task input and dependencies so that they can be edited without affecting trunk object

input_hash()[source]

Get the hash of the input

Returns

A hash of the input

Return type

str

spawn(path, metadata)[source]

Create new derivative of luigi.Task for later execution

property wind_type
Returns

Wind type generated by spawner (‘bladed’ for .wnd, ‘turbsim’ for .bts),

class spawnwind.nrel.WindGenerationTask(*args, **kwargs)[source]

Implementation of SimulationTask for TurbSim

output()[source]

The output of this task

Returns

Target to the .wnd path

Return type

luigi.LocalTarget

property wind_file_path

The path to the wind file

class spawnwind.nrel.WindInput(lines, root_folder, wind_gen_spawner)[source]
Base class for NREL input file determining the wind conditions for a FAST simulation. In FAST v7, this is an Aerodyn

input file and in v8 it is the InflowWind input file

classmethod from_file(file_path, wind_gen_spawner)[source]

Creates a NRELSimulationInput by loading a file

Parameters

file_path (path-like) – The file path to load

Returns

The simulation input object

Return type

An instance of NRELSimulationInput

get_wind_gen_tasks(prereq_dir, metadata)[source]

Create wind generation tasks to create new wind find if necessary :param prereq_dir: Output directory for prerequisite simulations :param metadata: Metadata for wind generation task :return: list of wind generation tasks (size 0 or 1)

property turbulence_intensity
Returns

Turbulence intensity as a percentage

property turbulence_seed
Returns

Integer turbulence seed for wind file generation

property upflow
Returns

Mean wind flow inclination in degrees upwards from the horizontal

property wind_file
Returns

Path of wind file if set

property wind_gen_spawner
Returns

underlying spawner for wind generation tasks

property wind_shear
Returns

Wind shear exponent

property wind_speed
Returns

Reference wind speed in m/s

property wind_type
Returns

Type of wind as a lowercase string (.e.g. ‘bladed’, ‘turbsim’, ‘steady’)

spawnwind.nrel.create_spawner(turbsim_exe, fast_exe, turbsim_base_file, fast_base_file, fast_version, runner_type, turbsim_working_dir, fast_working_dir, outdir, prereq_outdir)[source]
Parameters
  • turbsim_exe – Location of TurbSim executable

  • fast_exe – Location of FAST executable

  • turbsim_base_file – Baseline TurbSim input file (typically TurbSim.inp) from which wind file generation tasks are spawned

  • fast_base_file – FAST input file (typically .fst) to which all parameter editions are made and from which simulations are spawned

  • fast_version – Major version of FAST {‘v7’, ‘v8’}

  • runner_type – default is process

  • turbsim_working_dir – Directory in which TurbSim wind generation tasks are executed

  • fast_working_dir – Directory in which FAST simulations are executed. Note that the discon.dll must be in this directory

  • outdir – Root output directory for spawning and thus where simulation outputs are located

  • prereq_outdir – Root output directory for prerequisite tasks (i.e. wind file generation)

Returns

FastSimulationSpawner object