Skip to content

Multilevel Wind Model

Christoph Fröhlich edited this page Jan 7, 2022 · 3 revisions

Multilevel Wind Model

Wind data can be provided to calculate the wind speed and direction at the current altitude of the rocket. This feature can be enabled by adding the DataFile to the section WindModel in the configuration ini-file.

If no wind data is provided, the standard settings in the ork file are used.

Wind Data

Wind data can be given in an additional text file, containing the following data in four columns separated by whitespace:

  • Altitude (in m)
  • Direction (in degree; where is the wind coming from, i.e., 0degree means northerly wind)
  • Wind speed (in m/s)
  • Direction standard deviation (in degree)

See examples/wind_model.txt.

Add the path to this file to the WindModel section to the key DataFile

Turbulences

The turbulence model used by OpenRocket won't be changed: The turbulence intensity set in the ork file will be applied to calculate the standard deviation of the pink noise model, using the average windspeed interpolated at the current height by the data given in DataFile.

Implementation details

By default, the current wind speed + direction is calculated at the current altitude by using a linear interpolation separatly in North/East direction.

With the command line option w or wind you can let diana visualize the wind data from the specified file, e.g.,

diana -w

creates the following figure Example Wind Model Figure

Where to get these data?

Use aviation aloft data, or wind predictions from, e.g., windy.com

Another elegant way is using rocketpy. The following code snipped generates a compatible file from GFS forcast for the given time and location

from rocketpy import Environment
import datetime
import csv

tomorrow = datetime.date.today() + datetime.timedelta(days=1)
date_info = (tomorrow.year, tomorrow.month, tomorrow.day, 9) # Hour given in UTC time

print("Tomorrow's date:", date_info)
EnvGFS = Environment(railLength=6.1,
                  date=date_info,
                  latitude=-35.34692,
                  longitude=-117.80815 )
EnvGFS.setAtmosphericModel(type='Forecast', file='GFS')
EnvGFS.allInfo()

wind_alt = EnvGFS.height
wind_speed = EnvGFS.windSpeed(wind_alt)
print(wind_speed)
wind_direction = EnvGFS.windDirection(wind_alt)
print(wind_direction)
with open("wind_GFS.txt", 'w', newline='') as csvfile:
    resultwriter = csv.writer(csvfile, delimiter=' ')
    resultwriter.writerow(["# altitude (m)",
                        "wind direction (°)",
                        "wind speed (m/s)",
                        "direction std deviation (°)"])

    for alt, direction, speed in zip(
            wind_alt, wind_direction, wind_speed):

        resultwriter.writerow([
            "%.2f" % alt,
            "%.2f" % direction,
            "%.2f" % speed,
            "%.2f" % 5.])
Clone this wiki locally