Skip to content

Commit

Permalink
Add examples for 5m and RM2
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoor committed Sep 20, 2024
1 parent 22ee32c commit d633a3b
Show file tree
Hide file tree
Showing 50 changed files with 23,808 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ theta*
*.docx
*.csv
*Manual*
*.vscode
*.png
*.pdf
3 changes: 3 additions & 0 deletions examples/RM2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.ech
*.sum
/vtk*
126 changes: 126 additions & 0 deletions examples/RM2/RM2_medium.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import PyPlot
PyPlot.rc("figure", figsize=(4, 3))
PyPlot.rc("font", size=10.0)
PyPlot.rc("lines", linewidth=1.5)
PyPlot.rc("lines", markersize=3.0)
PyPlot.rc("legend", frameon=false)
PyPlot.rc("axes.spines", right=false, top=false)
PyPlot.rc("figure.subplot", left=.18, bottom=.17, top=0.9, right=.9)
PyPlot.rc("figure",max_open_warning=500)
color_cycle=["#348ABD", "#A60628", "#009E73", "#7A68A6", "#D55E00", "#CC79A7"]
PyPlot.pygui(true)
# PyPlot.close("all")
import OWENSAero
using Test
import HDF5
import FLOWMath
using Statistics:mean
import DelimitedFiles

path,_ = splitdir(@__FILE__)

radius = 0.538
height = 0.807
chordmid = 0.066667
chordtip = 0.04
B = 3

RE_d = [0.9,1.3]
# for (ire,Vinf) in enumerate([0.8,1.2])
ire = 2
Vinf = 1.2
rho=1000.0
mu=1.792E-3
eta=0.5

ntheta = 30
Nslices = 30
ifw=false
AModel = "AC"

AM_flag = true
rotAccel_flag = true

chord = FLOWMath.akima([0.0,0.5,1.0],[chordtip,chordmid,chordtip],LinRange(0,1,Nslices))

# PyPlot.figure()
# PyPlot.plot(collect(LinRange(0,1,Nslices)),chord)

shapeX = ones(Nslices).*radius
shapeZ = LinRange(0,height,Nslices)


OWENSAero.setupTurb(shapeX,shapeZ,B,chord,10.0,Vinf;rho,mu,eta,afname = "$(path)/airfoils/NACA_0021.dat",DSModel="BV",Nslices,AM_flag,rotAccel_flag)

TSRrange = LinRange(1.0,5.0,15)
CP = zeros(length(TSRrange))
RpSteady = zeros(B,Nslices,ntheta,length(TSRrange))
TpSteady = zeros(B,Nslices,ntheta,length(TSRrange))
alphaSteady = zeros(B,Nslices,ntheta,length(TSRrange))
for (iTSR,TSR) in enumerate(collect(TSRrange))
# iTSR = 1
# TSR = 2.2
#Steady State Test
omega = Vinf/radius*TSR

RPM = omega * 60 / (2*pi)

CPSteady,
RpSteady[:,:,:,iTSR],
TpSteady[:,:,:,iTSR],
ZpSteady,
alphaSteady[:,:,:,iTSR],
cl_afSteady,
cd_afSteady,
VlocSteady,
ReSteady,
thetavecSteady,
nstepSteady,
Fx_baseSteady,
Fy_baseSteady,
Fz_baseSteady,
Mx_baseSteady,
My_baseSteady,
Mz_baseSteady,
powerSteady,
power2Steady,torque,z3Dnorm,delta,Mz_base2,M_addedmass_Np,
M_addedmass_Tp,F_addedmass_Np,F_addedmass_Tp = OWENSAero.steadyTurb(;omega,Vinf)

println("RPM: $RPM")
# println(mean(ReSteady))
area = height * radius*2

CP[iTSR] = powerSteady/(0.5*rho*Vinf^3*area)
end

PyPlot.figure("CP")
PyPlot.plot(TSRrange,CP,"-",color=color_cycle[2],label="OWENS Aero, $(RE_d[ire]) RE_d (No Added Mass)") #,color=color_cycle[2]
# end
RM2_0_538D_RE_D_0_9E6 = DelimitedFiles.readdlm("$(path)/RM2_0.538D_RE_D_0.9E6.csv", ',',Float64)
RM2_0_538D_RE_D_1_3E6 = DelimitedFiles.readdlm("$(path)/RM2_0.538D_RE_D_1.3E6.csv", ',',Float64)
# PyPlot.plot(RM2_0_538D_RE_D_0_9E6[:,1],RM2_0_538D_RE_D_0_9E6[:,2],"k--",label="Exp. 0.9e6 RE_d")
PyPlot.plot(RM2_0_538D_RE_D_1_3E6[:,1],RM2_0_538D_RE_D_1_3E6[:,2],"k-",label="Exp. 1.2e6 RE_d")
# PyPlot.plot(right_TSR,right_CP,"ko",label="Right Only Exp.")
PyPlot.legend()
PyPlot.xlabel("TSR")
PyPlot.ylabel("Cp")

PyPlot.figure("Rp")
PyPlot.plot((1:length(RpSteady[1,15,:,7]))./length(RpSteady[1,15,:,7]).*360,RpSteady[1,15,:,7],".-",label="No Added Mass")
PyPlot.legend()
PyPlot.ylabel("Rp")
PyPlot.xlabel("Azimuth")

PyPlot.figure("Tp")
PyPlot.plot((1:length(TpSteady[1,15,:,7]))./length(TpSteady[1,15,:,7]).*360,TpSteady[1,15,:,7],".-",label="No Added Mass")
PyPlot.legend()
PyPlot.ylabel("Tp")
PyPlot.xlabel("Azimuth")

PyPlot.figure("Alpha")
PyPlot.plot((1:length(alphaSteady[1,15,:,7]))./length(alphaSteady[1,15,:,7]).*360,alphaSteady[1,15,:,7]./2.0./pi.*360,".-",label="Added Mass")
PyPlot.legend()
PyPlot.ylabel("Alpha")
PyPlot.xlabel("Azimuth")


39 changes: 39 additions & 0 deletions examples/RM2/airfoils/Airfoils copy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
04/10/97

Coordinates for the SNL airfoils:

SNL 0015/47 SNL 0018/50 SNL 0021/50
X (Y X (Y X (Y
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00020 0.00166 0.00337 0.00646 0.00343 0.00790
0.00508 0.01091 0.01274 0.01431 0.01291 0.01728
0.01507 0.02060 0.02713 0.02282 0.02740 0.02735
0.02872 0.02867 0.04621 0.03160 0.04653 0.03771
0.04729 0.03615 0.06970 0.04042 0.07001 0.04806
0.07062 0.04329 0.09730 0.04903 0.09753 0.05814
0.09832 0.05006 0.12870 0.05726 0.12878 0.06772
0.13002 0.05630 0.16353 0.06491 0.16339 0.07660
0.16533 0.06192 0.20142 0.07183 0.20098 0.08460
0.20386 0.06678 0.24193 0.07786 0.24113 0.09152
0.24517 0.07080 0.28464 0.08283 0.28339 0.09721
0.28880 0.07383 0.32907 0.08663 0.32730 0.10149
0.33426 0.07575 0.37471 0.08908 0.37235 0.10417
0.38104 0.07643 0.42107 0.09000 0.41805 0.10507
0.42860 0.07556 0.46759 0.08902 0.46384 0.10379
0.47688 0.07272 0.51422 0.08561 0.50965 0.09968
0.52610 0.06808 0.56140 0.07982 0.55603 0.09272
0.57603 0.06216 0.60914 0.07234 0.60311 0.08368
0.62618 0.05535 0.65698 0.06379 0.65048 0.07323
0.67600 0.04801 0.70440 0.05462 0.69767 0.06193
0.72489 0.04046 0.75083 0.04535 0.74412 0.05037
0.77244 0.03306 0.79560 0.03642 0.78921 0.03911
0.81734 0.02608 0.83798 0.02827 0.83220 0.02869
0.85951 0.01979 0.87718 0.02125 0.87224 0.01959
0.89801 0.01441 0.91233 0.01562 0.90843 0.01217
0.93212 0.01005 0.94258 0.01150 0.93980 0.00663
0.96114 0.00676 0.96711 0.00881 0.96541 0.00296
0.98447 0.00448 0.98519 0.00740 0.98439 0.00095
0.99685 0.00349 0.99627 0.00687 0.99606 0.00015
1.00000 0.00000 1.00000 0.00678 1.00000 0.00000

The 18/50 was thickened up near the trailing edge so we could actually build it (we can't make a razor-edged extrusion). Although we had to do a similar thing with the other two airfoils when we built models, I don't have those coordinates available.
39 changes: 39 additions & 0 deletions examples/RM2/airfoils/Airfoils.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
04/10/97

Coordinates for the SNL airfoils:

SNL 0015/47 SNL 0018/50 SNL 0021/50
X (Y X (Y X (Y
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00020 0.00166 0.00337 0.00646 0.00343 0.00790
0.00508 0.01091 0.01274 0.01431 0.01291 0.01728
0.01507 0.02060 0.02713 0.02282 0.02740 0.02735
0.02872 0.02867 0.04621 0.03160 0.04653 0.03771
0.04729 0.03615 0.06970 0.04042 0.07001 0.04806
0.07062 0.04329 0.09730 0.04903 0.09753 0.05814
0.09832 0.05006 0.12870 0.05726 0.12878 0.06772
0.13002 0.05630 0.16353 0.06491 0.16339 0.07660
0.16533 0.06192 0.20142 0.07183 0.20098 0.08460
0.20386 0.06678 0.24193 0.07786 0.24113 0.09152
0.24517 0.07080 0.28464 0.08283 0.28339 0.09721
0.28880 0.07383 0.32907 0.08663 0.32730 0.10149
0.33426 0.07575 0.37471 0.08908 0.37235 0.10417
0.38104 0.07643 0.42107 0.09000 0.41805 0.10507
0.42860 0.07556 0.46759 0.08902 0.46384 0.10379
0.47688 0.07272 0.51422 0.08561 0.50965 0.09968
0.52610 0.06808 0.56140 0.07982 0.55603 0.09272
0.57603 0.06216 0.60914 0.07234 0.60311 0.08368
0.62618 0.05535 0.65698 0.06379 0.65048 0.07323
0.67600 0.04801 0.70440 0.05462 0.69767 0.06193
0.72489 0.04046 0.75083 0.04535 0.74412 0.05037
0.77244 0.03306 0.79560 0.03642 0.78921 0.03911
0.81734 0.02608 0.83798 0.02827 0.83220 0.02869
0.85951 0.01979 0.87718 0.02125 0.87224 0.01959
0.89801 0.01441 0.91233 0.01562 0.90843 0.01217
0.93212 0.01005 0.94258 0.01150 0.93980 0.00663
0.96114 0.00676 0.96711 0.00881 0.96541 0.00296
0.98447 0.00448 0.98519 0.00740 0.98439 0.00095
0.99685 0.00349 0.99627 0.00687 0.99606 0.00015
1.00000 0.00000 1.00000 0.00678 1.00000 0.00000

The 18/50 was thickened up near the trailing edge so we could actually build it (we can't make a razor-edged extrusion). Although we had to do a similar thing with the other two airfoils when we built models, I don't have those coordinates available.
130 changes: 130 additions & 0 deletions examples/RM2/airfoils/NACA_0012 copy.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
NACA 0012
Sheldahl, R. E. and Klimas, P. C., Aerodynamic Characteristics of Seven Airfoil Sections Through 180 Degrees Angle of Attack for Use in Aerodynamic Analysis of Vertical Axis Wind Turbines,
SAND80-2114, March 1981, Sandia National Laboratories, Albuquerque, New Mexico.
1 Number of airfoil tables in this file
3.6 Reynolds numbers in millions
0.0 Control setting
0.0 Stall angle (deg)
0.0 Zero Cn angle of attack (deg)
0.0 Cn slope for zero lift (dimensionless)
0.0 Cn extrapolated to value at positive stall angle of attack
0.0 Cn at stall value for negative angle of attack
0.0 Angle of attack for minimum CD (deg)
0.0 Minimum CD value
-180.0000 -0.0000 .0250
-175.0000 .6900 .0550
-170.0000 .8500 .1400
-165.0000 .6750 .2300
-160.0000 .6600 .3200
-155.0000 .7400 .4200
-150.0000 .8500 .5750
-145.0000 .9100 .7550
-140.0000 .9450 .9250
-135.0000 .9450 1.0850
-130.0000 .9100 1.2250
-125.0000 .8400 1.3500
-120.0000 .7350 1.4650
-115.0000 .6250 1.5550
-110.0000 .5100 1.6350
-105.000 .3700 1.7000
-100.000 .22 1.7500
-95.0000 .0700 1.7800
-90.0000 -.0700 1.8000
-85.000 -.2200 1.8000
-80.0000 -.3700 1.7800
-75.0000 -.5150 1.7350
-70.0000 -0.6500 1.6650
-65.0000 -.7650 1.5750
-60.000 -.8750 1.4700
-55.00000 -.9650 1.3450
-50.0000 -1.0400 1.2150
-45.0000 -1.0850 1.0750
-40.0000 -1.0750 .9200
-35.0000 -1.0200 .7450
-30.0000 -.9150 .5700
-27.0000 -.9846 .4730
-26.0000 -.9313 .4460
-25.0000 -.8780 .4200
-24.0000 -.8246 .3940
-23.0000 -.7715 .3690
-22.0000 -.7179 .3440
-21.0000 -.6643 .3200
-20.0000 -.6120 .2970
-19.0000 -.5591 .2740
-18.0000 -.5047 .2520
-17.0000 -.4455 .2310
-15.0000 -.3792 .2100
-15.0000 -.3306 .1900
-14.0000 -.2893 .1060
-13.0000 -.2759 .0222
-12.0000 -.4832 .0217
-11.0000 -.9132 .0204
-10.0000 -.9811 .0184
-9.0000 -.9352 .0167
-8.00000 -.8542 .0153
-7.0000 -.7700 .0135
-6.0000 -.6600 .0125
-5.0000 -.5500 .0113
-4.0000 -.4400 .0098
-3.00000 -.3300 .0089
-2.0000 -.2200 .0084
-1.0000 -.1100 .0080
0.0000 0.0000 .0079
1.0000 .1100 .0080
2.0000 .2200 .0084
3.00000 .3300 .0089
4.0000 .4400 .0098
5.0000 .5500 .0113
6.0000 .6600 .0125
7.0000 .7700 .0135
8.00000 .8542 .0153
9.0000 .9352 .0167
10.0000 .9811 .0184
11.0000 .9132 .0204
12.0000 .4832 .0217
13.0000 .2759 .0222
14.0000 .2893 .1060
15.0000 .3306 .1900
15.0000 .3792 .2100
17.0000 .4455 .2310
18.0000 .5047 .2520
19.0000 .5591 .2740
20.0000 .6120 .2970
21.0000 .6643 .3200
22.0000 .7179 .3440
23.0000 .7715 .3690
24.0000 .8246 .3940
25.0000 .8780 .4200
26.0000 .9313 .4460
27.0000 .9846 .4730
30.0000 .9150 .5700
35.0000 1.0200 .7450
40.0000 1.0750 .9200
45.0000 1.0850 1.0750
50.0000 1.0400 1.2150
55.00000 .9650 1.3450
60.000 .8750 1.4700
65.0000 .7650 1.5750
70.0000 0.6500 1.6650
75.0000 .5150 1.7350
80.0000 .3700 1.7800
85.000 .2200 1.8000
90.0000 .0700 1.8000
95.0000 -.0700 1.7800
100.000 -.22 1.7500
105.000 -.3700 1.7000
110.0000 -.5100 1.6350
115.0000 -.6250 1.5550
120.0000 -.7350 1.4650
125.0000 -.8400 1.3500
130.0000 -.9100 1.2250
135.0000 -.9450 1.0850
140.0000 -.9450 .9250
145.0000 -.9100 .7550
150.0000 -.8500 .5750
155.0000 -.7400 .4200
160.0000 -.6600 .3200
165.0000 -.6750 .2300
170.0000 -.8500 .1400
175.0000 -.6900 .0550
180.0000 0.0000 .0250
Loading

0 comments on commit d633a3b

Please sign in to comment.