Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fluiddyn
fluidsim
Commits
c03fbd5ca743
Commit
d15b63db
authored
Apr 15, 2021
by
Jason Reneuve
Browse files
fix dispersion relation plot
parent
1bcc255877d4
Changes
2
Show whitespace changes
Inline
Side-by-side
fluidsim/solvers/ns2d/strat/output/spect_energy_budget.py
View file @
c03fbd5c
...
...
@@ -417,7 +417,7 @@ class SpectralEnergyBudgetNS2DStrat(SpectralEnergyBudgetBase):
imax_plot_spatial_times
=
np
.
argmin
(
abs
(
t
-
tmax
))
eps_tot_time_average
=
eps_tot
[
imin_plot_spatial_times
:
imax_plot_spatial_times
+
1
imin_plot_spatial_times
:
imax_plot_spatial_times
+
1
].
mean
(
0
)
# calculate forcing wave-number k_f to normalize k_x and k_z
...
...
fluidsim/solvers/ns3d/output/spatiotemporal_spectra.py
View file @
c03fbd5c
...
...
@@ -369,14 +369,18 @@ class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra):
N
=
self
.
sim
.
params
.
N
except
AttributeError
:
return
dkz_dkh
=
(
spectra_kzkhomega
[
"kz_spectra"
][
1
]
/
spectra_kzkhomega
[
"kh_spectra"
][
1
]
)
if
equation
.
startswith
(
r
"$\omega"
):
kz_disp
=
np
.
sqrt
(
N
**
2
/
omega
**
2
-
1
)
*
xaxis
ax
.
plot
(
xaxis
,
kz_disp
,
"k+"
,
linewidth
=
2
)
i
kz_disp
=
np
.
sqrt
(
N
**
2
/
omega
**
2
-
1
)
/
dkz_dkh
*
xaxis
ax
.
plot
(
xaxis
,
i
kz_disp
,
"k+"
,
linewidth
=
2
)
elif
equation
.
startswith
(
r
"$k_h"
):
omega_disp
=
kh
/
np
.
sqrt
(
kh
**
2
+
xaxis
**
2
)
omega_disp
=
i
kh
/
np
.
sqrt
(
i
kh
**
2
+
dkz_dkh
**
2
*
xaxis
**
2
)
ax
.
plot
(
xaxis
,
omega_disp
,
"k+"
,
linewidth
=
2
)
elif
equation
.
startswith
(
r
"$k_z"
):
omega_disp
=
xaxis
/
np
.
sqrt
(
xaxis
**
2
+
kz
**
2
)
omega_disp
=
xaxis
/
np
.
sqrt
(
xaxis
**
2
+
dkz_dkh
**
2
*
i
kz
**
2
)
ax
.
plot
(
xaxis
,
omega_disp
,
"k+"
,
linewidth
=
2
)
else
:
raise
ValueError
(
"wrong equation for dispersion relation"
)
...
...
Write
Preview
Markdown
is supported
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