I'm an unguided missile.
godotmisogi / aerofuse.jl Goto Github PK
View Code? Open in Web Editor NEWA toolbox meant for aircraft design analyses.
Home Page: https://godotmisogi.github.io/AeroFuse.jl/
License: MIT License
A toolbox meant for aircraft design analyses.
Home Page: https://godotmisogi.github.io/AeroFuse.jl/
License: MIT License
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
I was trying to calculate the lift coefficient of a NACA4412 airfoil and I encountered the following error:
foil = naca4((4,4,1,2), 70)
uniform = Uniform2D(1.0, 4.0)
system = solve_case(
foil,
uniform
)
cl = lift_coefficient(system)
ERROR: BoundsError: attempt to access 69-element extrapolate(interpolate((view(::Matrix{Float64}, :, 1),), ::Vector{Float64}, Gridded(Linear())), Throw()) with element type Float64 at index [-0.000268420185446816]
Stacktrace:
[1] throw_boundserror(A::Interpolations.Extrapolation{Float64, 1, Interpolations.GriddedInterpolation{Float64, 1, Vector{Float64}, Interpolations.Gridded{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}}}, Interpolations.Gridded{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Interpolations.Throw{Nothing}}, I::Tuple{Float64})
@ Base ./abstractarray.jl:691
[2] inbounds_index
@ ~/.julia/packages/Interpolations/Sxe87/src/extrapolation/extrapolation.jl:111 [inlined]
[3] inbounds_position
@ ~/.julia/packages/Interpolations/Sxe87/src/extrapolation/extrapolation.jl:102 [inlined]
[4] Extrapolation
@ ~/.julia/packages/Interpolations/Sxe87/src/extrapolation/extrapolation.jl:48 [inlined]
[5] _broadcast_getindex_evalf
@ ./broadcast.jl:670 [inlined]
[6] _broadcast_getindex
@ ./broadcast.jl:643 [inlined]
[7] getindex
@ ./broadcast.jl:597 [inlined]
[8] macro expansion
@ ./broadcast.jl:961 [inlined]
[9] macro expansion
@ ./simdloop.jl:77 [inlined]
[10] copyto!
@ ./broadcast.jl:960 [inlined]
[11] copyto!
@ ./broadcast.jl:913 [inlined]
[12] copy
@ ./broadcast.jl:885 [inlined]
[13] materialize
@ ./broadcast.jl:860 [inlined]
[14] interpolate(foil::Foil{Float64}, xs::Vector{Float64})
@ AeroFuse.AircraftGeometry ~/.julia/packages/AeroFuse/dwOGa/src/Geometry/AircraftGeometry/Foils/foil.jl:76
[15] cosine_interpolation
@ ~/.julia/packages/AeroFuse/dwOGa/src/Geometry/AircraftGeometry/Foils/foil.jl:125 [inlined]
[16] make_panels(foil::Foil{Float64}, n::Int64)
@ AeroFuse.AircraftGeometry ~/.julia/packages/AeroFuse/dwOGa/src/Geometry/AircraftGeometry/Foils/foil.jl:149
[17] #solve_case#7
@ ~/.julia/packages/AeroFuse/dwOGa/src/Aerodynamics/Cases/foil_cases.jl:10 [inlined]
[18] solve_case(foil::Foil{Float64}, freestream::Uniform2D{Float64})
@ AeroFuse ~/.julia/packages/AeroFuse/dwOGa/src/Aerodynamics/Cases/foil_cases.jl:10
[19] top-level scope
@ REPL[4]:1
Strangely, this error only occurs for specific values of n
:
foil = naca4((4,4,1,2), n) # fails if n = 69, 70, 72, 73 but works if n = 67, 68, 71, 74
Looking through the code, I suspect that when it is calculating the cosine interpolation,
AeroFuse.jl/src/Tools/MathTools.jl
Line 141 in 5726868
AeroFuse.jl/src/Geometry/AircraftGeometry/Foils/foil.jl
Lines 123 to 125 in a242e25
interpolate
to fail due to it being out of bounds.cosine_spacing(x_start, x_end, n :: Integer = 40) = @. max(x_start + (x_end - x_start) * (cos(-π:π/(n-1):0)+1)/2, x_end)
# ...
x_circ = cosine_spacing(x_min, x_max, n)
Thanks!
When I ran the case codes, I got that:
julia> begin airfoil = naca4((2,4,1,2)); foil = Foil(airfoil); V, α = 1.0, 3.0; uniform = Uniform2D(V, α); cl, cls, cms, cps, panels = solve_case(foil, uniform; num_panels = 80); end;cl -0.06478979281472284
as the result of NACA2412 is around 0.608250
# result from XFoil when alpha = 3.0 deg and re = 1e5 and mach = 0.0 is 0.608250 ? where is the error?
Describe the bug
The read_foil() function fail to assign new header name to the airfoil
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected airfoil.name to give the newly assigned value.
Desktop (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.