|
| 1 | +```@meta |
| 2 | +CurrentModule = AtmosphericModels |
| 3 | +``` |
| 4 | +# AtmosphericModels |
| 5 | +This package provides functions for modelling the influence of the atmosphere on wind energy systems. It models the air density, the vertical wind profile and the wind turbulence. Further functions to import measured data are planned. |
| 6 | + |
| 7 | +## Installation |
| 8 | +Install [Julia 1.10](http://www.julialang.org) or later, if you haven't already. You can add AtmosphericModels from Julia's package manager, by typing |
| 9 | +```julia |
| 10 | +using Pkg |
| 11 | +pkg"add AtmosphericModels" |
| 12 | +``` |
| 13 | +at the Julia prompt. |
| 14 | + |
| 15 | +### Running the tests |
| 16 | +Launch Julia using this project and run the tests: |
| 17 | +```julia |
| 18 | +julia --project |
| 19 | +using Pkg |
| 20 | +Pkg.test("AtmosphericModels") |
| 21 | +``` |
| 22 | + |
| 23 | +### Running the examples |
| 24 | +If you check out the project using git, you can more easily run the examples: |
| 25 | +``` |
| 26 | +git clone https://github.com/OpenSourceAWE/AtmosphericModels.jl |
| 27 | +cd AtmosphericModels.jl |
| 28 | +``` |
| 29 | +Launch Julia using this project and run the example menu: |
| 30 | +```julia |
| 31 | +julia --project |
| 32 | +include("examples/menu.jl") |
| 33 | +``` |
| 34 | +The first time will take some time, because the graphic libraries will get installed, the second time it is fast. |
| 35 | + |
| 36 | +## Usage |
| 37 | +### Calculate the height dependant wind speed |
| 38 | +```julia |
| 39 | +using AtmosphericModels |
| 40 | +am = AtmosphericModel() |
| 41 | + |
| 42 | +const profile_law = Int(EXPLOG) |
| 43 | +height = 100.0 |
| 44 | +wf = calc_wind_factor(am, height, profile_law) |
| 45 | +``` |
| 46 | +The result is the factor with which the ground wind speed needs to be multiplied |
| 47 | +to get the wind speed at the given height. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +The `EXPLOG` profile law is the fitted linear combination of the exponential and the log law. |
| 52 | + |
| 53 | +### Using the turbulent wind field |
| 54 | +You can get a wind vector as function of x,y,z and time using the following code: |
| 55 | +```julia |
| 56 | +using AtmosphericModels, KiteUtils |
| 57 | + |
| 58 | +set_data_path("data") |
| 59 | +set = load_settings("system.yaml") |
| 60 | +am::AtmosphericModel = AtmosphericModel(set) |
| 61 | + |
| 62 | +@info "Ground wind speed: $(am.set.v_wind) m/s" |
| 63 | + |
| 64 | +wf::WindField = WindField(am, am.set.v_wind) |
| 65 | +x, y, z = 20.0, 0.0, 200.0 |
| 66 | +t = 0.0 |
| 67 | +vx, vy, vz = get_wind(wf, am, x, y, z, t) |
| 68 | +@time get_wind(am, x, y, z, t) |
| 69 | +@info "Wind at x=$(x), y=$(y), z=$(z), t=$(t): v_x=$(vx), v_y=$(vy), v_z=$(vz)" |
| 70 | +@info "Wind speed: $(sqrt(vx^2 + vy^2 + vz^2)) m/s" |
| 71 | +``` |
| 72 | +It is suggested to check out the code using git before executing this example, |
| 73 | +because it requires that a data directory with the correct files `system.yaml` |
| 74 | +and `settings.yaml` exists. See below how to do that. |
| 75 | + |
| 76 | +### Plot a wind profile |
| 77 | +```julia |
| 78 | +using AtmosphericModels, KiteUtils, ControlPlots |
| 79 | +am = AtmosphericModel(se()) |
| 80 | + |
| 81 | +heights = 6:1000 |
| 82 | +wf = [calc_wind_factor(am, height, Int(EXPLOG)) for height in heights] |
| 83 | + |
| 84 | +plot(heights, wf, xlabel="height [m]", ylabel="wind factor") |
| 85 | +``` |
| 86 | + |
| 87 | +```julia |
| 88 | +using AtmosphericModels, ControlPlots, KiteUtils |
| 89 | +am = AtmosphericModel(se()) |
| 90 | +AtmosphericModels.se().alpha = 0.234 # set the exponent of the power law |
| 91 | + |
| 92 | +heights = 6:200 |
| 93 | +wf = [calc_wind_factor(am, height, Int(EXP)) for height in heights] |
| 94 | + |
| 95 | +plot(heights, wf, xlabel="height [m]", ylabel="wind factor") |
| 96 | +``` |
| 97 | + |
| 98 | +### Air density |
| 99 | +```julia |
| 100 | +using AtmosphericModels, BenchmarkTools, KiteUtils |
| 101 | +am = AtmosphericModel(se()) |
| 102 | +@benchmark calc_rho(am, height) setup=(height=Float64((6.0+rand()*500.0))) |
| 103 | +``` |
| 104 | +This gives 4.85 ns as result. Plot the air density: |
| 105 | +```julia |
| 106 | +heights = 6:1000 |
| 107 | +rhos = [calc_rho(am, height) for height in heights] |
| 108 | +plot(heights, rhos, legend=false, xlabel="height [m]", ylabel="air density [kg/m³]") |
| 109 | +``` |
| 110 | + |
| 111 | + |
| 112 | +## Further reading |
| 113 | +These models are described in detail in [Dynamic Model of a Pumping Kite Power System](http://arxiv.org/abs/1406.6218). |
| 114 | + |
| 115 | +## Licence |
| 116 | +This project is licensed under the MIT License. Please see the below WAIVER in association with the license. |
| 117 | + |
| 118 | +## WAIVER |
| 119 | +Technische Universiteit Delft hereby disclaims all copyright interest in the package “AtmosphericModels.jl” (models for airborne wind energy systems) written by the Author(s). |
| 120 | + |
| 121 | +Prof.dr. H.G.C. (Henri) Werij, Dean of Aerospace Engineering |
| 122 | + |
| 123 | +## See also |
| 124 | +- [Research Fechner](https://research.tudelft.nl/en/publications/?search=Uwe+Fechner&pageSize=50&ordering=rating&descending=true) |
| 125 | +- The application [KiteViewer](https://github.com/ufechner7/KiteViewer) |
| 126 | +- the package [KiteUtils](https://github.com/ufechner7/KiteUtils.jl) |
| 127 | +- the packages [KiteModels](https://github.com/ufechner7/KiteModels.jl) and [WinchModels](https://github.com/aenarete/WinchModels.jl) and [KitePodModels](https://github.com/aenarete/KitePodModels.jl) |
| 128 | +- the packages [KiteControllers](https://github.com/aenarete/KiteControllers.jl) and [KiteViewers](https://github.com/aenarete/KiteViewers.jl) |
| 129 | + |
0 commit comments