Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fluidsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
This instance will be upgraded to Heptapod 17.11.0rc1 on 2025-04-24 between 17:00 and 18:00 UTC+2
Show more breadcrumbs
fluiddyn
fluidsim
Commits
d4028097
Commit
d4028097
authored
6 years ago
by
calpe
Browse files
Options
Downloads
Patches
Plain Diff
Computed energy shear modes in seq & mpi.
parent
aa363165
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fluidsim/solvers/ns2d/strat/output/spatial_means.py
+18
-1
18 additions, 1 deletion
fluidsim/solvers/ns2d/strat/output/spatial_means.py
with
18 additions
and
1 deletion
fluidsim/solvers/ns2d/strat/output/spatial_means.py
+
18
−
1
View file @
d4028097
...
...
@@ -36,6 +36,13 @@
enstrophy_fft
=
self
.
output
.
compute_enstrophy_fft
()
enstrophy
=
self
.
sum_wavenumbers
(
enstrophy_fft
)
# Compute energy shear modes
COND_SHEAR_MODES
=
abs
(
self
.
sim
.
oper
.
KX
)
==
0.
energy_shear_modes
=
np
.
sum
(
energy_fft
[
COND_SHEAR_MODES
])
if
mpi
.
nb_proc
>
1
:
energy_shear_modes
=
mpi
.
comm
.
reduce
(
energy_shear_modes
,
op
=
mpi
.
MPI
.
SUM
,
root
=
0
)
# Dissipation rate kinetic and potential energy (kappa = viscosity)
f_d
,
f_d_hypo
=
self
.
sim
.
compute_freq_diss
()
...
...
@@ -88,6 +95,7 @@
"
epsA = {:11.5e} ; epsA_hypo = {:11.5e} ; epsA_tot = {:11.5e}
\n
"
"
epsK = {:11.5e} ; epsK_hypo = {:11.5e} ; epsK_tot = {:11.5e}
\n
"
"
epsZ = {:11.5e} ; epsZ_hypo = {:11.5e} ; epsZ_tot = {:11.5e}
\n
"
"
E_shear = {:11.5e}
\n
"
).
format
(
enstrophy
,
energy
,
...
...
@@ -102,6 +110,7 @@
epsZ
,
epsZ_hypo
,
epsZ
+
epsZ_hypo
,
energy_shear_modes
)
self
.
file
.
write
(
to_print
)
...
...
@@ -149,6 +158,7 @@
lines_epsK
=
[]
lines_epsZ
=
[]
lines_epsA
=
[]
lines_E_shear
=
[]
for
il
,
line
in
enumerate
(
lines
):
if
line
.
startswith
(
"
time =
"
):
...
...
@@ -171,7 +181,8 @@
lines_epsZ
.
append
(
line
)
if
line
.
startswith
(
"
epsA =
"
):
lines_epsA
.
append
(
line
)
if
line
.
startswith
(
"
E_shear =
"
):
lines_E_shear
.
append
(
line
)
nt
=
len
(
lines_t
)
if
nt
>
1
:
nt
-=
1
...
...
@@ -202,6 +213,7 @@
epsA
=
np
.
empty
(
nt
)
epsA_hypo
=
np
.
empty
(
nt
)
epsA_tot
=
np
.
empty
(
nt
)
E_shear
=
np
.
empty
(
nt
)
for
il
in
range
(
nt
):
line
=
lines_t
[
il
]
...
...
@@ -255,6 +267,10 @@
epsA_hypo
[
il
]
=
float
(
words
[
6
])
epsA_tot
[
il
]
=
float
(
words
[
10
])
line
=
lines_E_shear
[
il
]
words
=
line
.
split
()
E_shear
[
il
]
=
float
(
words
[
2
])
dict_results
[
"
t
"
]
=
t
dict_results
[
"
Z
"
]
=
Z
...
...
@@ -286,6 +302,7 @@
dict_results
[
"
epsA
"
]
=
epsA
dict_results
[
"
epsA_hypo
"
]
=
epsA_hypo
dict_results
[
"
epsA_tot
"
]
=
epsA_tot
dict_results
[
"
E_shear
"
]
=
E_shear
return
dict_results
...
...
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