Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
WindEnergyToolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
toolbox
WindEnergyToolbox
Commits
22668f04
Commit
22668f04
authored
2 years ago
by
Mads M. Pedersen
Browse files
Options
Downloads
Patches
Plain Diff
fix nyquist frequency in mann_parameters.var2ae and mann_parameters.ae2ti. The...
parent
7ac398d1
No related branches found
No related tags found
1 merge request
!216
fix nyquist frequency in mann_parameters.var2ae and mann_parameters.ae2ti. The...
Pipeline
#45292
failed
1 year ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wetb/wind/turbulence/mann_parameters.py
+2
-2
2 additions, 2 deletions
wetb/wind/turbulence/mann_parameters.py
wetb/wind/turbulence/tests/test_mann_parameters.py
+4
-5
4 additions, 5 deletions
wetb/wind/turbulence/tests/test_mann_parameters.py
with
6 additions
and
7 deletions
wetb/wind/turbulence/mann_parameters.py
+
2
−
2
View file @
22668f04
...
...
@@ -216,7 +216,7 @@ def var2ae(variance, L, G, U, T=600, sample_frq=10, plt=False):
frequency range [1/length, sample_frq] equal to the variance of u
"""
k_low
,
k_high
=
2
*
np
.
pi
/
(
U
*
np
.
array
([
T
,
1
/
sample_frq
]))
k_low
,
k_high
=
2
*
np
.
pi
/
(
U
*
np
.
array
([
T
,
2
/
sample_frq
]))
k1
=
10
**
(
np
.
linspace
(
np
.
log10
(
k_low
),
np
.
log10
(
k_high
),
1000
))
def
get_var
(
uu
):
...
...
@@ -237,7 +237,7 @@ def var2ae(variance, L, G, U, T=600, sample_frq=10, plt=False):
def
ae2ti
(
ae23
,
L
,
G
,
U
,
T
=
600
,
sample_frq
=
10
):
k_low
,
k_high
=
2
*
np
.
pi
/
(
U
*
np
.
array
([
T
,
1
/
sample_frq
]))
k_low
,
k_high
=
2
*
np
.
pi
/
(
U
*
np
.
array
([
T
,
2
/
sample_frq
]))
k1
=
10
**
(
np
.
linspace
(
np
.
log10
(
k_low
),
np
.
log10
(
k_high
),
1000
))
uu
=
get_mann_model_spectra
(
ae23
,
L
,
G
,
k1
)[
0
]
...
...
This diff is collapsed.
Click to expand it.
wetb/wind/turbulence/tests/test_mann_parameters.py
+
4
−
5
View file @
22668f04
...
...
@@ -121,7 +121,7 @@ class TestMannTurbulence(unittest.TestCase):
# should be independent of U
dt
=
dx
/
U
T
=
16384
/
U
self
.
assertAlmostEqual
(
var2ae
(
variance
=
u
.
var
(),
L
=
10
,
G
=
3.3
,
U
=
U
,
T
=
T
,
sample_frq
=
1
/
dt
),
.
15
,
delta
=
.
02
1
)
self
.
assertAlmostEqual
(
var2ae
(
variance
=
u
.
var
(),
L
=
10
,
G
=
3.3
,
U
=
U
,
T
=
T
,
sample_frq
=
1
/
dt
),
.
15
,
delta
=
.
02
4
)
def
test_var2ae_T
(
self
):
u
=
mann_turbulence
.
load
(
get_test_file
(
"
h2a8192_8_8_16384_32_32_0.15_10_3.3u.dat
"
),
(
8192
,
8
,
8
))
...
...
@@ -134,7 +134,7 @@ class TestMannTurbulence(unittest.TestCase):
u_
=
u
.
T
.
reshape
((
u
.
T
.
shape
*
np
.
array
([
n
,
1
/
n
])).
astype
(
int
)).
T
var
=
u_
.
var
(
0
).
mean
()
ae
=
var2ae
(
variance
=
var
,
L
=
10
,
G
=
3.3
,
U
=
U
,
T
=
dx
*
u_
.
shape
[
0
]
/
U
,
sample_frq
=
1
/
dt
)
self
.
assertAlmostEqual
(
ae
,
.
15
,
delta
=
.
02
5
)
self
.
assertAlmostEqual
(
ae
,
.
15
,
delta
=
.
02
7
)
def
test_var2ae_dt
(
self
):
u
=
mann_turbulence
.
load
(
get_test_file
(
"
h2a16384_8_8_65536_32_32_0.15_40_4.0u.dat
"
),
(
16384
,
8
,
8
))
...
...
@@ -149,9 +149,8 @@ class TestMannTurbulence(unittest.TestCase):
u_
=
u
.
reshape
(
u
.
shape
[
0
]
//
n
,
n
,
u
.
shape
[
1
]).
mean
(
1
)
var
=
u_
.
var
(
0
).
mean
()
ae
=
var2ae
(
variance
=
var
,
L
=
40
,
G
=
4
,
U
=
U
,
T
=
T
,
sample_frq
=
1
/
(
n
*
dx
/
U
),
plt
=
False
)
#print(u_.shape, var, ae)
self
.
assertAlmostEqual
(
ae
,
.
15
,
delta
=
.
04
)
ae
=
var2ae
(
variance
=
var
,
L
=
40
,
G
=
4
,
U
=
U
,
T
=
T
,
sample_frq
=
1
/
(
n
*
dx
/
U
))
self
.
assertAlmostEqual
(
ae
,
.
15
,
delta
=
.
041
+
i
/
100
)
def
test_fit_ae2var
(
self
):
u
=
mann_turbulence
.
load
(
get_test_file
(
"
h2a8192_8_8_16384_32_32_0.15_10_3.3u.dat
"
),
(
8192
,
8
,
8
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment