Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
The Gitlab server is succesfully updated to version 15.1.0
Open sidebar
Mads M. Pedersen
PyWake
Commits
31d64f9d
Commit
31d64f9d
authored
Apr 14, 2020
by
Mads M. Pedersen
Browse files
obtain zeta from casedata.bin, set z=zhub if level=9999, support name "inputfile.par"
parent
95cbb05c
Changes
1
Hide whitespace changes
Inline
Side-by-side
py_wake/wake_models/fuga.py
View file @
31d64f9d
...
...
@@ -29,8 +29,10 @@ class Fuga(LinearSum, WakeModel):
if
os
.
path
.
getsize
(
path
+
'CaseData.bin'
)
==
187
:
zeta0
=
struct
.
unpack
(
'd'
,
fid
.
read
(
8
))[
0
]
else
:
path
=
os
.
path
.
abspath
(
path
).
replace
(
"
\\
"
,
"/"
)
zeta0
=
float
(
path
[
path
.
index
(
'Zeta0'
):].
replace
(
"Zeta0="
,
""
).
replace
(
"/"
,
""
))
with
open
(
path
+
'CaseData.bin'
)
as
fid2
:
info
=
fid2
.
read
(
127
)
zeta0
=
float
(
info
[
info
.
index
(
'Zeta0'
):].
replace
(
"Zeta0="
,
""
))
# zeta0 = float(path[path.index('Zeta0'):].replace("Zeta0=", "").replace("/", ""))
def
psim
(
zeta
):
return
self
.
ams
*
zeta
...
...
@@ -39,7 +41,7 @@ class Fuga(LinearSum, WakeModel):
raise
NotImplementedError
# See Colonel.u2b.psim
factor
=
1
/
(
1
-
(
psim
(
zhub
*
self
.
invL
)
-
psim
(
zeta0
))
/
np
.
log
(
zhub
/
z0
))
f
=
[
f
for
f
in
os
.
listdir
(
path
)
if
f
.
endswith
(
"input.par"
)][
0
]
f
=
[
f
for
f
in
os
.
listdir
(
path
)
if
f
.
endswith
(
"input.par"
)
or
f
.
endswith
(
'inputfile.par'
)
][
0
]
# z0_zi_zeta0 = os.path.split(os.path.dirname(path))[1]
# z0, zi, zeta0 = re.match('Z0=(\d+.\d+)Zi=(\d+)Zeta0=(\d+.\d+E\+\d+)', z0_zi_zeta0).groups()
...
...
@@ -62,7 +64,10 @@ class Fuga(LinearSum, WakeModel):
self
.
x
=
np
.
arange
(
-
self
.
x0
,
nxW
*
3
/
4
)
*
dx
self
.
y
=
np
.
arange
(
nyW
//
2
)
*
dy
self
.
dy
=
dy
self
.
z
=
z0
*
np
.
exp
(
zlevels
*
self
.
dsAll
)
if
self
.
lo_level
==
self
.
hi_level
==
9999
:
self
.
z
=
[
zhub
]
else
:
self
.
z
=
z0
*
np
.
exp
(
zlevels
*
self
.
dsAll
)
self
.
lut_interpolator
=
LUTInterpolator
(
self
.
x
,
self
.
y
,
self
.
z
,
self
.
du
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment