TARANG.lib.fields.vect_field

Contents

TARANG.lib.fields.vect_field#

Classes#

VectorField

Class representing a vector field for the TARANG solver.

Module Contents#

class TARANG.lib.fields.vect_field.VectorField(para)#

Class representing a vector field for the TARANG solver.

Vkx#

Arrays for the Fourier components of the vector field in the x direction.

Type:

array-like

Vky#

Arrays for the Fourier components of the vector field in the y direction.

Type:

array-like

Vkz#

Arrays for the Fourier components of the vector field in the z direction.

Type:

array-like

Vx#

Arrays for the real-space components of the vector field in the x direction.

Type:

array-like

Vy#

Arrays for the real-space components of the vector field in the y direction.

Type:

array-like

Vz#

Arrays for the real-space components of the vector field in the z direction.

Type:

array-like

force_Vx#

Arrays for the forcing components of the vector field in the x direction.

Type:

array-like

force_Vy#

Arrays for the forcing components of the vector field in the y direction.

Type:

array-like

force_Vz#

Arrays for the forcing components of the vector field in the z direction.

Type:

array-like

nlinx#

Arrays for the nonlinear components of the vector field in the x direction.

Type:

array-like

nliny#

Arrays for the nonlinear components of the vector field in the y direction.

Type:

array-like

nlinz#

Arrays for the nonlinear components of the vector field in the z direction.

Type:

array-like

ek#

Arrays for the energy spectra.

Type:

array-like

Tk#

Arrays for the transfer spectra.

Type:

array-like

ek_table#

Tables for the energy spectra.

Type:

array-like

Tk_table#

Tables for the transfer spectra.

Type:

array-like

total_energy#

Arrays for total energy.

Type:

array-like

total_dissipation#

Arrays for total dissipation.

Type:

array-like

standard_dissipation#

Arrays for standard dissipation.

Type:

array-like

hypo_dissipation#

Arrays for hypo dissipation (if enabled).

Type:

array-like

hyper_dissipation#

Arrays for hyper dissipation (if enabled).

Type:

array-like

divergence#

Array for the divergence of the vector field.

Type:

array-like

total_injection#

Array for the total energy injection.

Type:

array-like

ur#

Array for the velocity components.

Type:

array-like

Vkx_modes_t#

Arrays for the time evolution of the Fourier modes in the x direction.

Type:

array-like

Vky_modes_t#

Arrays for the time evolution of the Fourier modes in the y direction.

Type:

array-like

Vkz_modes_t#

Arrays for the time evolution of the Fourier modes in the z direction.

Type:

array-like

Vkx_mode#

Arrays for the Fourier modes in the x direction.

Type:

array-like

Vky_mode#

Arrays for the Fourier modes in the y direction.

Type:

array-like

Vkz_mode#

Arrays for the Fourier modes in the z direction.

Type:

array-like

para#
Vkx = []#
Vky = []#
Vkz = []#
Vx = []#
Vy = []#
Vz = []#
force_Vx = []#
force_Vy = []#
force_Vz = []#
nlinx = []#
nliny = []#
nlinz = []#
ek = []#
Tk = []#
ek_table = []#
Tk_table = []#
total_energy = []#
total_dissipation = []#
standard_dissipation = []#
divergence = []#
total_injection = []#
ur = []#
Vkx_modes_t = []#
Vky_modes_t = []#
Vkz_modes_t = []#
Vkx_mode = []#
Vkz_mode = []#
Vky_mode = []#
set_arrays()#

Set the arrays for the vector field based on the simulation parameters.

init_cond(Vkx, Vky, Vkz)#

Initialize the vector field with given Fourier components.

Parameters:
  • Vkx (array-like) – Arrays for the Fourier components of the vector field in the x direction.

  • Vky (array-like) – Arrays for the Fourier components of the vector field in the y direction.

  • Vkz (array-like) – Arrays for the Fourier components of the vector field in the z direction.

init_cond_real(Vx, Vy, Vz)#

Initialize the vector field with given Real components.

Parameters:
  • Vx (array-like) – Arrays for the Real components of the vector field in the x direction.

  • Vy (array-like) – Arrays for the Real components of the vector field in the y direction.

  • Vz (array-like) – Arrays for the Real components of the vector field in the z direction.

compute_omega()#

Initialize the derived field with the vorticity components from the velocity field.

compute_vecpot()#

Initialize the derived field with the vector potential components from the magnetic field.

update2D_Vkz(kx, kz)#

Update the Vkz component for 2D simulations.

Parameters:
  • kx (int) – Wavenumber in the x direction.

  • kz (int) – Wavenumber in the z direction.

update3D_Vkz(kx, ky, kz)#

Update the Vkz component for 3D simulations.

Parameters:
  • kx (int) – Wavenumber in the x direction.

  • ky (int) – Wavenumber in the y direction.

  • kz (int) – Wavenumber in the z direction.

compute_divergence()#

Compute the divergence of the vector field.

Returns:

Maximum absolute value of the divergence.

Return type:

float

compute_total_energy()#

Compute the total energy of the vector field.

Returns:

Total energy of the vector field.

Return type:

float

compute_total_energy_w()#

Compute the total energy of the vector field.

Returns:

Total energy of the vector field.

Return type:

float

compute_total_injection()#

Compute the total energy injection of the vector field.

Returns:

Total energy injection of the vector field.

Return type:

float

compute_dissipation()#

Compute the dissipation of the vector field.

Returns:

Dissipation of the vector field.

Return type:

float

compute_dissipation_alter(power)#

Compute the alternative dissipation of the vector field.

Parameters:

power (int) – Power to which the wavenumber is raised.

Returns:

Alternative dissipation of the vector field.

Return type:

float

compute_ekTk(univ)#

Compute the energy spectrum and transfer function.

Parameters:

univ (UniversalArrays, optional) – UniversalArrays object for temporary storage.

compute_ekTk_w(univ)#

Compute the energy spectrum and transfer function.

Parameters:

univ (UniversalArrays, optional) – UniversalArrays object for temporary storage.

U_to_Ucopy(univ)#

Copy the vector field to the universal arrays.

Parameters:

univ (UniversalArrays, optional) – UniversalArrays object for temporary storage.

Ucopy_to_U(univ)#

Copy the universal arrays to the vector field.

Parameters:

univ (UniversalArrays, optional) – UniversalArrays object for temporary storage.

B_to_Bcopy(univ)#

Copy the magnetic field to the universal arrays.

Parameters:

univ (UniversalArrays, optional) – UniversalArrays object for temporary storage.

Bcopy_to_B(univ)#

Copy the universal arrays to the magnetic field.

Parameters:

univ (UniversalArrays, optional) – UniversalArrays object for temporary storage.