diff --git a/src/xfoilbasic.jl b/src/xfoilbasic.jl index 3e81c7f..e95abd3 100644 --- a/src/xfoilbasic.jl +++ b/src/xfoilbasic.jl @@ -3,7 +3,7 @@ Input x and y airfoil coordinates into XFOIL Coordinates must start at the trailing edge and loop counterclockwise. """ -function setCoordinates(x::Array{Float64,1},y::Array{Float64,1}) +function setCoordinates(x::AbstractArray{<:Real,1},y::AbstractArray{<:Real,1}) if length(x) != length(y) error("x and y arrays must match in length") end @@ -31,9 +31,9 @@ Run XFOIL's PANE Command (repanel airfoil) - `xpref1::Float64=1.0`: Bottom side refined area x/c limits - `xpref2::Float64=1.0`: """ -function pane(;npan::Integer=140,cvpar::Float64=1.0,cterat::Float64=0.15, - ctrrat::Float64=0.2,xsref1::Float64=1.0,xsref2::Float64=1.0,xpref1::Float64=1.0, - xpref2::Float64=1.0) +function pane(;npan::Integer=140,cvpar::Real=1.0,cterat::Real=0.15, + ctrrat::Real=0.2,xsref1::Real=1.0,xsref2::Real=1.0,xpref1::Real=1.0, + xpref2::Real=1.0) xfoilglobals.npan[1] = npan xfoilglobals.cvpar[1] = cvpar xfoilglobals.cterat[1] = cterat @@ -51,7 +51,7 @@ end Compute the flow solution at specified angle of attack (in degrees). Returns cl,cd,cdp,cm,converged """ -function solveAlpha(angle::Float64,re::Float64;mach::Float64=0.0,iter::Integer=50) +function solveAlpha(angle::Real,re::Real;mach::Real=0.0,iter::Integer=50) cl = zeros(Float64,1) cd = zeros(Float64,1) cdp = zeros(Float64,1) diff --git a/src/xfoilsweep.jl b/src/xfoilsweep.jl index 1db4cf3..73cd574 100644 --- a/src/xfoilsweep.jl +++ b/src/xfoilsweep.jl @@ -3,11 +3,11 @@ Performs angle of attack sweep using Xfoil. A number of options are available to improve convergence and customize the run. Returns cl,cd,cdp,cm,converged # Arguments -- `x::Array{Float64,1}`: Airfoil coordinates start from trailing edge looping counterclockwise -- `y::Array{Float64,1}`: -- `aoa::Array{Float64,1}`: Array of angle of attacks in degrees -- `re::Float64`: Reynolds number -- `ma::Float64`: Mach number +- `x::AbstractArray{<:Real,1}`: Airfoil coordinates start from trailing edge looping counterclockwise +- `y::AbstractArray{<:Real,1}`: +- `aoa::AbstractArray{<:Real,1}`: Array of angle of attacks in degrees +- `re::Real`: Reynolds number +- `ma::Real`: Mach number - `iter::Integer=50`: Maximum number of iterations - `npan::Integer=140`: Number of panels - `percussive_maintenance::Bool=true`: Try harder to achieve convergence @@ -16,8 +16,9 @@ to improve convergence and customize the run. Returns cl,cd,cdp,cm,converged - `clmaxstop::Bool=false`: Stop if lift coefficient decreases twice consecutively going up - `clminstop::Bool=false`: Stop if lift coefficient increases twice consecutively going down """ -function xfoilsweep(x::Array{Float64,1},y::Array{Float64,1},aoa::Array{Float64,1}, - re::Float64;mach::Float64=0.0,iter::Integer=50, +function xfoilsweep(x::AbstractArray{<:Real,1},y::AbstractArray{<:Real,1}, + aoa::AbstractArray{<:Real,1}, + re::Real;mach::Real=0.0,iter::Integer=50, npan::Integer=140,percussive_maintenance::Bool=true,printdata::Bool=false, zeroinit::Bool=true,clmaxstop::Bool=false,clminstop::Bool=false) @@ -47,8 +48,8 @@ function xfoilsweep(x::Array{Float64,1},y::Array{Float64,1},aoa::Array{Float64,1 return cl,cd,cdp,cm,conv end -function xfoilsweep(x::Array{Float64,1},y::Array{Float64,1},aoa::Array{Float64,1}, - re::Float64,mach::Float64,iter::Integer, +function xfoilsweep(x::AbstractArray{<:Real,1},y::AbstractArray{<:Real,1},aoa::AbstractArray{<:Real,1}, + re::Real,mach::Real,iter::Integer, npan::Integer,percussive_maintenance::Bool,printdata::Bool, clmaxstop::Bool,clminstop::Bool) @@ -110,8 +111,8 @@ end Attempts to converge previously unconverged XFOIL solutions through modifying the solution initial conditions. Returns cl,cd,cdp,cm,converged """ -function dopercussivemaintainance(x::Array{Float64,1},y::Array{Float64,1}, - aoa::Float64,re::Float64,mach::Float64,iter::Integer,npan::Integer) +function dopercussivemaintainance(x::AbstractArray{<:Real,1},y::AbstractArray{<:Real,1}, + aoa::Real,re::Real,mach::Real,iter::Integer,npan::Integer) remod = re aoamod = aoa for j = 1:25