Commit 96f7c283 authored by Jason Reneuve's avatar Jason Reneuve
Browse files

total kinetic and potential energy

parent 02556b4254fb
......@@ -98,6 +98,22 @@ class SpatioTemporalSpectraNS3D(SpatioTemporalSpectra):
data, kh_spectra, KH, kz_spectra, KZ
)
# total kinetic/potential energy
dict_spectra_kzkhomega["spect_K"] = 0.5 * (
dict_spectra_kzkhomega["spect_vx"]
+ dict_spectra_kzkhomega["spect_vy"]
+ dict_spectra_kzkhomega["spect_vz"]
)
# potential energy
try:
N = self.sim.params.N
dict_spectra_kzkhomega["spect_A"] = (
0.5 / N ** 2 * dict_spectra_kzkhomega["spect_b"]
)
except AttributeError:
pass
# save to file
path_file = Path(self.sim.output.path_run) / "spatiotemporal_spectra.h5"
with h5py.File(path_file, "w") as file:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment