From 530fac77b06eac585e25b0daaae0b8ae874ad04c Mon Sep 17 00:00:00 2001 From: BTV25 <70768698+BTV25@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:52:50 -0600 Subject: [PATCH] Small docs corrections. Still need SNOW to update compatability --- docs/Project.toml | 2 -- docs/src/Tutorial.md | 64 ++------------------------------------------ docs/src/index.md | 13 --------- 3 files changed, 2 insertions(+), 77 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index a835d9b..71effc6 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,3 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" SNOW = "105f6ee8-0889-46b1-9d4b-65e03cbc8f13" -VectorizedRoutines = "0e69188a-a5d4-5622-b4e4-a72373136fc5" diff --git a/docs/src/Tutorial.md b/docs/src/Tutorial.md index d15f4b4..cbe87b2 100644 --- a/docs/src/Tutorial.md +++ b/docs/src/Tutorial.md @@ -16,7 +16,7 @@ directory. ## (1) Setting up the problem description -The problems description involves the physically description of the wind farm, the turbines, +The problems description involves the physical description of the wind farm, the turbines, and the wind resource. While this tutorial uses the same design across all the wind turbines and mostly equal properties across all wind flow states, all turbines and flow states can be unique. @@ -27,8 +27,6 @@ be loaded from .csv and/or .yaml files. ### Set up the running environment ```@example 1 using FLOWFarm; const ff = FLOWFarm -using PyPlot; const plt = PyPlot -using VectorizedRoutines.Matlab: meshgrid using SNOW ``` @@ -67,29 +65,6 @@ generatorefficiency = ones(nturbines) println("") # hide ``` -### Visualize the wind farm layout -```@example 1 -# initialize axis -fig, ax = plt.subplots(1) - -# plot layout using FLOWFarm -ff.plotlayout!(ax, turbinex, turbiney, rotordiameter) - -# Label the axes -ax.set(xlabel="Easting (m)", ylabel="Northing (m)") - -# add farm boundary -circle = matplotlib.patches.Circle((0.0, 0.0), boundaryradius, fill=false, color="k") -ax.add_patch(circle) - -# set plot limits -ax.set(xlim=[-boundaryradius, boundaryradius].*1.01, ylim=[-boundaryradius, boundaryradius].*1.01) - -plt.tight_layout() # hide -plt.savefig("initiallayout.png") # hide -``` -![](initiallayout.png) - ### Determine how to sample the flow field to determine effective inflow speeds Rotor swept area sample points are normalized by the rotor radius. These arrays define which which points on the rotor swept area should be used to estimate the effective inflow @@ -103,16 +78,7 @@ See doc strings for more information. # get the sample points nsamplepoints = 50 rotorsamplepointsy, rotorsamplepointsz = ff.rotor_sample_points(nsamplepoints, method="sunflower") - -# visualize the sample points -fig, ax = plt.subplots(1) -ff.plotrotorsamplepoints!(ax, rotorsamplepointsy, rotorsamplepointsz) -ax.set(xlabel="y/radius", ylabel="z/radius") -plt.tight_layout() # hide -plt.savefig("rotorsamplepoints.png") # hide -println("") # hide ``` -![](rotorsamplepoints.png) ### Setting up the wind resource The wind resource determines the properties of the flowfield at all wind states. A wind @@ -137,13 +103,7 @@ windshearmodel = ff.PowerLawWindShear(shearexponent) # initialize the wind resource definition windresource = ff.DiscretizedWindResource(winddirections, windspeeds, windprobabilities, measurementheight, airdensity, ambienttis, windshearmodel) - -# visualize the wind resource -ff.plotwindresource!(windresource) -plt.tight_layout() # hide -plt.savefig("windresource.png") # hide ``` -![](windresource.png) ## (2) Setting up the analysis models @@ -246,7 +206,7 @@ The output shows each turbine power in an array that is ndirections by nturbines ## (4) setting up and running an optimization FLOWFarm is specifically designed for efficient optimization using gradient-based optimization methods. Besides the steps outlined above, we need to define the following before we can run -and optimization: +an optimization: - (1) Optimization related variables - (1) A container for non-differentiated parameters @@ -478,27 +438,7 @@ println("AEP improvement (%) = ", 100*(aepfinal - aep)/aep) # extract final turbine locations turbinexopt = copy(xopt[1:nturbines]) turbineyopt = copy(xopt[nturbines+1:end]) - -# initialize figure and axes object -fig, ax = plt.subplots(1) - -# plot layout using FLOWFarm -ff.plotlayout!(ax, turbinexopt, turbineyopt, rotordiameter) - -# label the axes -ax.set(xlabel="Easting (m)", ylabel="Northing (m)") - -# and the wind farm boundary -circle = matplotlib.patches.Circle((0.0, 0.0), boundaryradius, fill=false, color="k") -ax.add_patch(circle) - -# set limits on the plot region -ax.set(xlim=[-boundaryradius, boundaryradius].*1.01, ylim=[-boundaryradius, boundaryradius].*1.01) - -plt.tight_layout() # hide -plt.savefig("optlayout.png") # hide ``` -![](optlayout.png) ## (5) Calculating a flow field diff --git a/docs/src/index.md b/docs/src/index.md index b4ddd6a..07eea5b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -20,19 +20,6 @@ julia (v1.x) pkg> dev https://github.com/byuflowlab/FLOWFarm.jl.git ``` -## Testing - -To test FLOWFarm, run the following from the top directory: - -``` -julia -] -activate . -test -``` - -## Documentation - * Begin with the [quick start tutorial](Tutorial.md). * More advanced topics are covered in the [how-to guide](How_to.md). * Theory details, and links, can be found in the [theory](Explanation.md) page.