-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,5 @@ uuid = "03019ade-4524-4ecd-af79-46d4f04a1b56" | |
authors = ["Aaron Kaw <[email protected]> and contributors"] | ||
version = "1.0.0-DEV" | ||
|
||
[deps] | ||
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" | ||
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" | ||
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" | ||
|
||
[compat] | ||
IntervalArithmetic = "0.22.14" | ||
NaNMath = "1.0.2" | ||
Symbolics = "5.34.0" | ||
julia = "1.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
struct CelerityProfileFunctionType{MediumType <: Medium} <: ModellingFunction{3} end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export atmosphere_celerity_profile | ||
|
||
## Instantiation | ||
const atmosphere_celerity_profile = CelerityProfileFunctionType{Atmosphere}() | ||
|
||
## Models | ||
atmosphere_celerity_profile(::ModelName{:Homogeneous}, x::Real, y::Real, z::Real; c::Real = 343.0)::Real = c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export ocean_celerity_profile | ||
|
||
const ocean_celerity_profile = CelerityProfileFunctionType{Ocean}() | ||
|
||
ocean_celerity_profile(::ModelName{:Homogeneous}, x::Real, y::Real, z::Real; c::Real = 1500.0)::Real = c | ||
|
||
function ocean_celerity_profile(::ModelName{:Munk}, x::Real, y::Real, z::Real; ϵ = 7.47e-3) | ||
z̃ = 2(z/1300 - 1) | ||
return 1500( | ||
1 + ϵ * ( | ||
z̃ - 1 + exp(-z̃) | ||
) | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export seabed_celerity_profile | ||
|
||
const seabed_celerity_profile = CelerityProfileFunctionType{Seabed}() | ||
|
||
seabed_celerity_profile(::ModelName{:Homogeneous}, x::Real, y::Real, z::Real; c::Real = 2000.0)::Real = c |
15 changes: 15 additions & 0 deletions
15
src/06_postliminary/02_profiles/celerity/99_postliminary.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export CelerityProfile | ||
|
||
struct CelerityProfile{MediumType <: Medium, ProfileFunctionType <: Function} <: ModellingFunctor{3} | ||
profile::ProfileFunctionType | ||
|
||
function CelerityProfile{MediumType}(model::ModelName; pars...) where {MediumType <: Medium} | ||
celerity_profile = CelerityProfileFunctionType{MediumType}() | ||
profile(x::Real, y::Real, z::Real) = celerity_profile(model, x, y, z; pars...) | ||
new{MediumType, profile |> typeof}(profile) | ||
end | ||
end | ||
|
||
function (cel::CelerityProfile{<:Medium, <:Function})(x::Real, y::Real, z::Real) | ||
cel.profile(x, y, z) | ||
end |
File renamed without changes.