Skip to content

Commit 675e02e

Browse files
ufechner71-Bart-1
andauthored
Bump AtmosphericModels (#244)
* Bump AtmosphericModels * Fix KPS3 and KPS4 * Move to sam * Cleanup * Update default manifest * Remove FAST_EXP * Less tests * More tests pass * More tests pass * All tests pass * re-enable all tests * Remove unused function --------- Co-authored-by: 1-Bart-1 <[email protected]> Co-authored-by: Uwe Fechner <[email protected]>
1 parent 9e01d6d commit 675e02e

File tree

10 files changed

+80
-24
lines changed

10 files changed

+80
-24
lines changed

Manifest-v1.11.toml.default

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.11.6"
44
manifest_format = "2.0"
5-
project_hash = "b7e6608cb08f613acdc2af9d43e0374bac40ce7c"
5+
project_hash = "bcabd53e173057b92cf9d8a824da30ac71ed9341"
66

77
[[deps.ADTypes]]
88
git-tree-sha1 = "be7ae030256b8ef14a441726c4c37766b90b93a3"
@@ -15,6 +15,17 @@ weakdeps = ["ChainRulesCore", "ConstructionBase", "EnzymeCore"]
1515
ADTypesConstructionBaseExt = "ConstructionBase"
1616
ADTypesEnzymeCoreExt = "EnzymeCore"
1717

18+
[[deps.AbstractFFTs]]
19+
deps = ["LinearAlgebra"]
20+
git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef"
21+
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
22+
version = "1.5.0"
23+
weakdeps = ["ChainRulesCore", "Test"]
24+
25+
[deps.AbstractFFTs.extensions]
26+
AbstractFFTsChainRulesCoreExt = "ChainRulesCore"
27+
AbstractFFTsTestExt = "Test"
28+
1829
[[deps.AbstractTrees]]
1930
git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177"
2031
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
@@ -130,10 +141,10 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
130141
version = "1.11.0"
131142

132143
[[deps.AtmosphericModels]]
133-
deps = ["HypergeometricFunctions", "KiteUtils"]
134-
git-tree-sha1 = "f19e2f01bd53ae2b3bc007f2d0d075c760f3801d"
144+
deps = ["FFTW", "HypergeometricFunctions", "KiteUtils", "LinearAlgebra", "MeshGrid", "NPZ", "Printf", "Random", "Statistics"]
145+
git-tree-sha1 = "f3986a298be27278be4a904cbd7f668c9b7b76b3"
135146
uuid = "c59cac55-771d-4f45-b14d-1c681463a295"
136-
version = "0.2.5"
147+
version = "0.3.0"
137148

138149
[[deps.AxisAlgorithms]]
139150
deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"]
@@ -633,6 +644,18 @@ git-tree-sha1 = "c13f0b150373771b0fdc1713c97860f8df12e6c2"
633644
uuid = "55351af7-c7e9-48d6-89ff-24e801d99491"
634645
version = "0.10.14"
635646

647+
[[deps.FFTW]]
648+
deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"]
649+
git-tree-sha1 = "797762812ed063b9b94f6cc7742bc8883bb5e69e"
650+
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
651+
version = "1.9.0"
652+
653+
[[deps.FFTW_jll]]
654+
deps = ["Artifacts", "JLLWrappers", "Libdl"]
655+
git-tree-sha1 = "6d6219a004b8cf1e0b4dbe27a2860b8e04eba0be"
656+
uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a"
657+
version = "3.3.11+0"
658+
636659
[[deps.FastBroadcast]]
637660
deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"]
638661
git-tree-sha1 = "ab1b34570bcdf272899062e1a56285a53ecaae08"
@@ -667,6 +690,18 @@ version = "1.1.3"
667690
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
668691
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
669692

693+
[[deps.FileIO]]
694+
deps = ["Pkg", "Requires", "UUIDs"]
695+
git-tree-sha1 = "b66970a70db13f45b7e57fbda1736e1cf72174ea"
696+
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
697+
version = "1.17.0"
698+
699+
[deps.FileIO.extensions]
700+
HTTPExt = "HTTP"
701+
702+
[deps.FileIO.weakdeps]
703+
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
704+
670705
[[deps.FilePathsBase]]
671706
deps = ["Compat", "Dates"]
672707
git-tree-sha1 = "3bab2c5aa25e7840a4b065805c0cdfc01f3068d2"
@@ -1132,6 +1167,11 @@ git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102"
11321167
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
11331168
version = "0.3.2"
11341169

1170+
[[deps.MeshGrid]]
1171+
git-tree-sha1 = "e5b4281c773148163188fb311476f4f1c9c81443"
1172+
uuid = "ebf956a0-ef5e-43be-9fb1-27952996e635"
1173+
version = "1.0.3"
1174+
11351175
[[deps.Missings]]
11361176
deps = ["DataAPI"]
11371177
git-tree-sha1 = "ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d"
@@ -1209,6 +1249,12 @@ git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1"
12091249
uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
12101250
version = "4.5.1"
12111251

1252+
[[deps.NPZ]]
1253+
deps = ["FileIO", "ZipFile"]
1254+
git-tree-sha1 = "60a8e272fe0c5079363b28b0953831e2dd7b7e6f"
1255+
uuid = "15e1cf62-19b3-5cfa-8e77-841668bca605"
1256+
version = "0.4.3"
1257+
12121258
[[deps.NaNMath]]
12131259
deps = ["OpenLibm_jll"]
12141260
git-tree-sha1 = "9b8215b1ee9e78a293f99797cd31375471b2bcae"
@@ -1409,10 +1455,10 @@ weakdeps = ["REPL"]
14091455
REPLExt = "REPL"
14101456

14111457
[[deps.PoissonRandom]]
1412-
deps = ["Random"]
1413-
git-tree-sha1 = "a0f1159c33f846aa77c3f30ebbc69795e5327152"
1458+
deps = ["LogExpFunctions", "Random"]
1459+
git-tree-sha1 = "bb178012780b34046c6d1600a315d8dbee89d83d"
14141460
uuid = "e409e4f3-bfea-5376-8464-e040bb5c01ab"
1415-
version = "0.4.4"
1461+
version = "0.4.5"
14161462

14171463
[[deps.Polyester]]
14181464
deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"]
@@ -1440,9 +1486,9 @@ version = "0.2.4"
14401486

14411487
[[deps.PreallocationTools]]
14421488
deps = ["Adapt", "ArrayInterface", "ForwardDiff"]
1443-
git-tree-sha1 = "6d98eace73d82e47f5b16c393de198836d9f790a"
1489+
git-tree-sha1 = "7a5e02659e293b25a4bfaeeb6cd268acd0742eba"
14441490
uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
1445-
version = "0.4.27"
1491+
version = "0.4.28"
14461492

14471493
[deps.PreallocationTools.extensions]
14481494
PreallocationToolsReverseDiffExt = "ReverseDiff"
@@ -2187,6 +2233,12 @@ git-tree-sha1 = "2f58ac39f64b41fb812340347525be3b590cce3b"
21872233
uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
21882234
version = "0.4.14"
21892235

2236+
[[deps.ZipFile]]
2237+
deps = ["Libdl", "Printf", "Zlib_jll"]
2238+
git-tree-sha1 = "f492b7fe1698e623024e873244f10d89c95c340a"
2239+
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
2240+
version = "0.10.1"
2241+
21902242
[[deps.Zlib_jll]]
21912243
deps = ["Libdl"]
21922244
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ KiteModelsControlPlotsExt = "ControlPlots"
5252
[compat]
5353
ADTypes = "1.14.0"
5454
Aqua = "0.8.11"
55-
AtmosphericModels = "=0.2.5"
55+
AtmosphericModels = "0.3"
5656
BenchmarkTools = "1.6"
5757
CodecXz = "0.7.4"
5858
Colors = "0"

data/settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ environment:
134134
rho_0: 1.225 # air density at zero height and 15 °C [kg/m³]
135135
alpha: 0.08163 # exponent of the wind profile law
136136
z0: 0.0002 # surface roughness [m]
137-
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG
137+
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG
138138
# the following parameters are for calculating the turbulent wind field using the Mann model
139139
use_turbulence: 0.0 # turbulence intensity relative to Cabauw, NL
140140
v_wind_gnds: [3.483, 5.324, 8.163] # wind speeds at ref height for calculating the turbulent wind field [m/s]

data/settings_ram.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ environment:
6969
rho_0: 1.225 # air density at zero height and 15 °C [kg/m³]
7070
alpha: 0.08163 # exponent of the wind profile law
7171
z0: 0.0002 # surface roughness [m]
72-
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG
72+
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=F
7373
# the following parameters are for calculating the turbulent wind field using the Mann model
7474
use_turbulence: 0.0 # turbulence intensity relative to Cabau, NL
7575
v_wind_gnds: [3.483, 5.324, 8.163] # wind speeds at ref height for calculating the turbulent wind field [m/s]

docs/src/parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ environment:
134134
rho_0: 1.225 # air density at zero height and 15 °C [kg/m³]
135135
alpha: 0.08163 # exponent of the wind profile law
136136
z0: 0.0002 # surface roughness [m]
137-
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG
137+
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG
138138
# the following parameters are for calculating the turbulent wind field using the Mann model
139139
use_turbulence: 0.0 # turbulence intensity relative to Cabauw, NL
140140
v_wind_gnds: [3.483, 5.324, 8.163] # wind speeds at ref height for calculating the turbulent wind field [m/s]

src/KPS3.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $(TYPEDFIELDS)
3232
"Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels"
3333
kcu::KCU
3434
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
35-
am::AtmosphericModel = AtmosphericModel()
35+
am::AtmosphericModel = AtmosphericModel(set)
3636
"Reference to winch model as implemented in the package WinchModels"
3737
wm::Union{AbstractWinchModel, Nothing} = nothing
3838
"Integrator, storing the current state"

src/KPS4.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $(TYPEDFIELDS)
6565
"Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels"
6666
kcu::KCU
6767
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
68-
am::AtmosphericModel = AtmosphericModel()
68+
am::AtmosphericModel = AtmosphericModel(set)
6969
"Reference to winch model as implemented in the package WinchModels"
7070
wm::AbstractWinchModel
7171
"Integrator, storing the current state"

src/symbolic_awe_model.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"Reference to the VSM aerodynamics solver"
1111
vsm_solvers::Vector{VortexStepMethod.Solver}
1212
sys_struct_hash::Vector{UInt8}
13-
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
14-
am::AtmosphericModel = AtmosphericModel()
1513
"Simplified system of the mtk model"
1614
sys::Union{ModelingToolkit.ODESystem, Nothing} = nothing
1715
"Unsimplified system of the mtk model"
@@ -71,6 +69,8 @@ $(TYPEDFIELDS)
7169
"Reference to the point mass system with points, segments, pulleys and tethers"
7270
sys_struct::SystemStructure
7371
serialized_model::SerializedModel
72+
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
73+
am::AtmosphericModel = AtmosphericModel(set)
7474
integrator::Union{OrdinaryDiffEqCore.ODEIntegrator, Nothing} = nothing
7575
"relative start time of the current time interval"
7676
t_0::SimFloat = 0.0

test/bench4.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ msg = String[]
5959
kps4.set.alpha = 1.0/7.0
6060
init_150()
6161
kps4.set.elevation = 60.0
62-
kps4.set.profile_law = Int(FAST_EXP)
62+
kps4.set.profile_law = Int(EXP)
6363
pos, vel = KiteModels.init_inner(kps4)
6464
posd = copy(vel)
6565
veld = zero(vel)
@@ -85,7 +85,7 @@ msg = String[]
8585

8686
# benchmark inner_loop!
8787
pos, vel = KiteModels.init_inner(kps4)
88-
t = @benchmark KiteModels.inner_loop!(kps4, pos, vel, v_wind_gnd, segments, d_tether) setup=(kps4.set.elevation = 60.0; kps4.set.profile_law = Int(FAST_EXP);
88+
t = @benchmark KiteModels.inner_loop!(kps4, pos, vel, v_wind_gnd, segments, d_tether) setup=(kps4.set.elevation = 60.0; kps4.set.profile_law = Int(EXP);
8989
kps4.set.alpha = 1.0/7.0; pos = $pos; vel=$vel;
9090
v_wind_gnd = KVec3(7.0, 0.1, 0.0); kps4.stiffness_factor = 0.5; segments = kps4.set.segments; d_tether = kps4.set.d_tether/1000.0)
9191
push!(msg, ("Mean time inner_loop!: $(round(mean(t.times), digits=1)) ns"))
@@ -95,7 +95,7 @@ msg = String[]
9595
kps4.set.alpha = 1.0/7.0
9696
init_150()
9797
kps4.set.elevation = 60.0
98-
kps4.set.profile_law = Int(FAST_EXP)
98+
kps4.set.profile_law = Int(EXP)
9999
for i in 1:se().segments + KiteModels.KITE_PARTICLES + 1
100100
kps4.forces[i] .= zeros(3)
101101
end

test/test_kps4.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ end
234234
kps4.set.alpha = 1.0/7.0
235235
init_150()
236236
kps4.set.elevation = 60.0
237-
kps4.set.profile_law = Int(EXP)
237+
kps4.set.profile_law = Int(EXPLOG)
238+
kps4.set.alpha = 0.08163
239+
# kps4.set.profile_low = se().profile_law
238240
for i in 1:set.segments + KiteModels.KITE_PARTICLES + 1
239241
kps4.forces[i] .= zeros(3)
240242
end
@@ -319,6 +321,8 @@ end
319321
@testset "test_loop " begin
320322
init2()
321323
pos, vel, posd, veld = init2()
324+
kps4.set.profile_law = Int(EXPLOG)
325+
kps4.set.alpha = 0.08163
322326
KiteModels.loop!(kps4, pos, vel, posd, veld)
323327
res1=[[-0. 0.000001 -0. ]
324328
[ 0. 0. 0. ]
@@ -451,7 +455,6 @@ end
451455
@test all(res2_[i, :] .≈ res2[i])
452456
end
453457
end
454-
455458
end
456459

457460
@testset "test_getters" begin
@@ -513,11 +516,13 @@ function simulate(integrator, steps)
513516
iter / steps
514517
end
515518

516-
println("--> test_simulate")
517519
@testset "test_simulate " begin
518520
STEPS = 500
519521
kps4.set.depower = 23.6
520522
kps4.set.solver = "IDA"
523+
kps4.set.profile_law = Int(EXPLOG)
524+
kps4.set.alpha = 0.08163
525+
# struct_diff(kps4.set, se())
521526
integrator = KiteModels.init!(kps4; stiffness_factor=0.5, prn=false)
522527
# println("\nStarting simulation...")
523528
simulate(integrator, 100)
@@ -544,7 +549,6 @@ println("--> test_simulate")
544549
update_sys_state!(sys_state, kps4)
545550
# TODO Add testcase with varying reelout speed
546551
end
547-
println("<-- finished test_simulate")
548552

549553
@testset "Raptures" begin
550554
kps4_ = KPS4(KCU(set))

0 commit comments

Comments
 (0)