VERSION>=2021.09.01
Introduction
Analysis of turbulence and vortices requires knowledge of the kinetic energy, is conservation and its modes. This tool performs the Helmholtz Decomposition, in order to extract the compressive and rotational components of kinetic energy of the flow as shown in Tsubota, Fujimoto, Yui (2017) Numerical Studies of Quantum Turbulence.
We define the effective velocity field as \omega(\textbf{r},t)=\sqrt{\rho(\textbf{r},t)}v(\textbf{r},t)
. From this, we can calculate the kinetic energy as:
E_k=\frac{m}{2V}\int\omega(\textbf{r},t)^2d\textbf{r}=\frac{m}{2}\sum_{\textbf{k}}|\widetilde{\omega}(\textbf{k},t)|^2,
where \widetilde{\omega}(\textbf{k},t)=\mathfrak{F}[\omega(\textbf{r},t)]=\int\omega(\textbf{r},t)\frac{e^{-i\textbf{k}\cdot\textbf{r}}}{V}d\textbf{r}
is the Fourier Transform of the effective velocity.
From this, we can apply the Helmholtz Decomposition theorem to obtain the compressive and rotational components of the effective velocity field:
\omega(\textbf{r},t)=\omega_0(t)+\omega_c(\textbf{r},t)+\omega_i(\textbf{r},t)
\omega_c(\textbf{r},t)=\sum_{\textbf{k}\neq0}^{}\frac{\textbf{k}\cdot\widetilde{\omega}(\textbf{k},t)}{k^2}\textbf{k}e^{i\textbf{k}\cdot\textbf{r}}
\omega_i(\textbf{r},t)=\sum_{\textbf{k}\neq0}^{}\{\widetilde{\omega}(\textbf{k},t)-\frac{\textbf{k}\cdot\widetilde{\omega}(\textbf{k},t)}{k^2}\textbf{k}\}e^{i\textbf{k}\cdot\textbf{r}}
Note that in our specific case, we assume the component \omega_0(t)
to be zero across the whole lattice.
Usage
The cast line consists of few specific entries. After the executable name, call the .wtxt
file that needs to be analyzed, together with a number indicating the spin component you wish to inspect:
- 0 is for spin a (up)
- 1 is for spin b (down)
- 2 is for spin a+b
Here is an example of how it should look like:
[gabrielw@node2066 tmp]$ mpirun -np 5 wslda-hdc-3d test2.wtxt 0
Adding new variables [wc_a, wi_a] to w-data set.
Number of measurements = 10
Starting time = -1
Lattice size = 80 x 80 x 16
Ending time = 9.000
Component = a
Variables being produced = wi_a & wc_a
Creating file: test2_hh_a.txt
Creating file: test2_hhspec_a.txt
Reading frame [1], currently at 1%
....
Completed in 4s ( 0m 4s)!
For large lattices, the code might take longer than it shows due to MPI memory cleaning routines.
The code outputs four files:
- Two of them are
.wdat
, and they contain data about\omega_c(\textbf{r},t)
and\omega_i(\textbf{r},t)
in binary form. These can be read via VisIt by selecting the corresponding quantity from the VisIt HUD (wc*/wi*); - One
.txt
file, containing columns:- time,
- compressive energy,
- rotational energy,
- compressive energy calculated via spectral decomposition
- rotational energy calculated via spectral decomposition
- One
hhspec*.txt
file, containing data blocks for every timestep and showing the compressive and rotational spectra as a function of k. In current version, only rotational spectra is reliable. [TODO: Fix compressive.]
[ADD UNITS]
Limitations
Presently the code supports only 3D data. However, you can apply it to 2D as well. In order to do that, you need to increase data dimensionality of the datasets you wish to analyze. You can do it using wdata tool wdata-datadim-up
. For example:
[gabrielw@node2066 tmp]$ wdata-datadim-up test1.wtxt test2 3
# WDATA TOOL: DATADIM MODIFIER
# READING INPUT DATA: `test1.wtxt`
# ************************ LATTICE ***************************
# LATTICE: 80 x 80 x 16
# SPACING: 1.000000 x 1.000000 x 1.000000
# VOLUME : 80.000000 x 80.000000 x 16.000000
# DIM-IN : 2
# DIM-OUT: 3
# RESIZING `rho_a`...
# RESIZING `rho_b`...
# RESIZING `delta`...
# RESIZING `j_a`...
# RESIZING `j_b`...
# RESIZING `nu`...
# RESIZING `tau_a`...
# RESIZING `tau_b`...
# RESIZING `V_a`...
# RESIZING `V_b`...
# RESIZING `V_ext_a`...
# RESIZING `V_ext_b`...
# RESIZING `delta_ext`...
# RESIZING `velocity_ext_a`...
# RESIZING `velocity_ext_b`...
# RESIZING `alpha_a`...
# RESIZING `alpha_b`...
# RESIZING `A_a`...
# RESIZING `A_b`...
# WRITING `test2.wtxt`
# DONE.
The resizing tool operates on all the variables listed in the .wtxt
file, but the Helmholtz decomposition tool only needs density, current and delta. If your dataset is spin-symmetric, using only the a component will be enough. The new .wtxt
file will link to the resized files for each quantity.
The result of the resizing will be a dataset with cylindrical symmetry: some effects of a fully-3D simulation will not show up (as, in the case of vortices, Kelvin waves or vortex rings).
Developers
- Andrea Barresi, Warsaw University of Technology