Skip to content

Commit

Permalink
Added OpenFAST data stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dingraha committed Aug 29, 2024
1 parent 2f660ab commit 2eda9e7
Show file tree
Hide file tree
Showing 19 changed files with 1,198 additions and 460 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ KinematicCoordinateTransformations = "730d3219-0a85-48f9-b699-9f31f8913d09"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"

[compat]
AcousticMetrics = "0.7.0"
CCBlade = "0.2.4"
FLOWMath = "0.3.3"
FLOWMath = "0.4.1"
FillArrays = "1.11.0"
FlexiMaps = "0.1.18"
Format = "1.3.7"
JuliennedArrays = "0.4.0"
KinematicCoordinateTransformations = "0.4.1"
Meshes = "0.46.0"
StaticArrays = "1.5.19"
Statistics = "1.9.0"
WriteVTK = "1.17.1"
julia = "1.9.1"
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
FLOWMath = "6cb5d3fb-0fe8-4cc2-bd89-9fe0b19a99d3"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function doit()
IN_CI = get(ENV, "CI", nothing)=="true"

makedocs(sitename="AcousticAnalogies.jl", modules=[AcousticAnalogies], doctest=false,
root=@__DIR__,
format=Documenter.HTML(prettyurls=IN_CI),
pages=["Introduction"=>"index.md",
"Guided Example"=>"guided_example.md",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
596 changes: 270 additions & 326 deletions docs/src/openfast_example.md

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/AcousticAnalogies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ using CCBlade: CCBlade
using CSV: CSV
using DataFrames: DataFrames
using FillArrays: Fill
using FLOWMath: akima, linear, ksmax, norm_cs_safe, dot_cs_safe, atan_cs_safe, abs_cs_safe
using FLOWMath: FLOWMath, akima, linear, ksmax, norm_cs_safe, dot_cs_safe, atan_cs_safe, abs_cs_safe
using FlexiMaps: mapview
using Format: format, FormatExpr
using JuliennedArrays: JuliennedArrays
using KinematicCoordinateTransformations: KinematicTransformation, SteadyRotXTransformation, ConstantVelocityTransformation, compose
using LinearAlgebra: cross, norm, mul!
using Meshes: Meshes
using StaticArrays: @SVector
using StaticArrays: @SVector, SVector
using Statistics: mean
using WriteVTK: WriteVTK

include("utils.jl")
Expand Down Expand Up @@ -63,9 +64,12 @@ export f1a_source_elements_ccblade, tblte_source_elements_ccblade, lblvs_source_
include("bpm_test_utils.jl")

include("openfast_helpers.jl")
export read_openfast_file, OpenFASTData
export AbstractTimeDerivMethod, NoTimeDerivMethod, SecondOrderFiniteDiff, calculate_loading_dot!
export AbstractRadialInterpMethod, FLOWLinearInterp, FLOWAkimaInterp, interpolate_to_cell_centers!
export OpenFASTData, read_openfast_file, f1a_source_elements_openfast

include("writevtk.jl")
export to_paraview_collection

include("deprecated.jl")

Expand Down
45 changes: 45 additions & 0 deletions src/f1a.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,51 @@ function CompactF1ASourceElement(ρ0, c0, r, θ, Δr, Λ, fn, fr, fc, τ)
return CompactF1ASourceElement(ρ0, c0, Δr, Λ, y0dot, y1dot, y2dot, y3dot, f0dot, f1dot, τ, span_uvec)
end

"""
CompactF1ASourceElement(ρ0, c0, r, θ, Δr, Λ, fn, fndot, fr, frdot, fc, fcdot, τ)
Construct a source element to be used with the compact form of Farassat's formulation 1A, using position and loading data expressed in a cylindrical coordinate system.
The `r` and `θ` arguments are used to define the radial and circumferential position of the source element in a cylindrical coordinate system.
Likewise, the `fn`, `fr`, and `fc` arguments are used to define the normal, radial, and circumferential loading per unit span *on the fluid* (in a reference frame moving with the element) in the same cylindrical coordinate system.
The `fndot`, `frdot`, and `fcdot` arguments are the time-derivative of the normal, radial, and circumferential loading per unit span, again *on the fluid* and in a reference frame moving with the element, in the cylindrical coordinate system.
The cylindrical coordinate system is defined as follows:
* The normal axial direction is in the positive x axis
* The circumferential/azimuth angle `θ` is defined such that `θ = 0` means the radial direction is aligned with the positive y axis, and a positive `θ` indicates a right-handed rotation around the positive x axis.
Note that, for a proper noise prediction, the source element needs to be transformed into the "global" frame, aka, the reference frame of the fluid.
This can be done easily with the transformations provided by the `KinematicCoordinateTransformations` package, or manually by modifying the components of the source element struct.
# Arguments
- ρ0: Ambient air density (kg/m^3)
- c0: Ambient speed of sound (m/s)
- r: radial coordinate of the element in the blade-fixed coordinate system (m)
- θ: angular offest of the element in the blade-fixed coordinate system (rad)
- Δr: length of the element (m)
- Λ: cross-sectional area of the element (m^2)
- fn: normal load per unit span *on the fluid* (N/m)
- fndot: time derivative of the normal load per unit span *on the fluid* (N/(m*s))
- fr: radial load *on the fluid* (N/m)
- frdot: time derivative of the radial load *on the fluid* (N/(m*s))
- fc: circumferential load *on the fluid* (N/m)
- fcdot: time derivative of the circumferential load *on the fluid* (N/(m*s))
- τ: source time (s)
"""
function CompactF1ASourceElement(ρ0, c0, r, θ, Δr, Λ, fn, fndot, fr, frdot, fc, fcdot, τ)
s, c = sincos(θ)
y0dot = @SVector [0, r*c, r*s]
T = eltype(y0dot)
y1dot = @SVector zeros(T, 3)
y2dot = @SVector zeros(T, 3)
y3dot = @SVector zeros(T, 3)
f0dot = @SVector [fn, c*fr - s*fc, s*fr + c*fc]
f1dot = @SVector [fndot, c*frdot - s*fcdot, s*frdot + c*fcdot]
span_uvec = @SVector [0, c, s]

return CompactF1ASourceElement(ρ0, c0, Δr, Λ, y0dot, y1dot, y2dot, y3dot, f0dot, f1dot, τ, span_uvec)
end

"""
(trans::KinematicTransformation)(se::CompactF1ASourceElement)
Expand Down
Loading

0 comments on commit 2eda9e7

Please sign in to comment.