TARANG.lib.fields.scalar_field#

Classes#

ScalarField

Class representing a scalar field for the TARANG solver.

Module Contents#

class TARANG.lib.fields.scalar_field.ScalarField(para)#

Class representing a scalar field for the TARANG solver.

fk#

Array for the Fourier components of the scalar field.

Type:

array-like

f#

Array for the real-space components of the scalar field.

Type:

array-like

nlin#

Array for the nonlinear components of the scalar field.

Type:

array-like

force_f#

Array for the forcing components of the scalar field.

Type:

array-like

tot_energy#

Array for the total energy.

Type:

array-like

ek#

Array for the energy spectrum.

Type:

array-like

Tk#

Array for the transfer function.

Type:

array-like

ek_table#

Table for the energy spectrum.

Type:

array-like

Tk_table#

Table for the transfer function.

Type:

array-like

total_energy#

Array for total energy.

Type:

array-like

total_dissipation#

Array for total dissipation.

Type:

array-like

standard_dissipation#

Array for standard dissipation.

Type:

array-like

hypo_dissipation#

Array for hypo dissipation (if enabled).

Type:

array-like

hyper_dissipation#

Array for hyper dissipation (if enabled).

Type:

array-like

Tk_modes_t#

Array for the time evolution of the transfer function.

Type:

array-like

Tk_mode#

Array for the transfer function.

Type:

array-like

para#
fk = []#
f = []#
nlin = []#
force_f = []#
tot_energy = []#
ek = []#
Tk = []#
ek_table = []#
Tk_table = []#
total_energy = []#
total_dissipation = []#
standard_dissipation = []#
Tk_modes_t = []#
Tk_mode = []#
set_arrays()#

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

init_cond(fk)#

Initialize the scalar field with given Fourier components.

Parameters:

fk (array-like) – Array for the Fourier components of the scalar field.

init_cond_real(f)#

Initialize the scalar field with given Real components.

Parameters:

f (array-like) – Array for the Real components of the scalar field.

compute_total_energy()#

Compute the total energy of the scalar field.

Returns:

Total energy of the scalar field.

Return type:

float

compute_dissipation()#

Compute the dissipation of the scalar field.

Returns:

Dissipation of the scalar field.

Return type:

float

compute_dissipation_alter(power)#

Compute the alternative dissipation of the scalar field.

Parameters:

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

Returns:

Alternative dissipation of the scalar field.

Return type:

float

compute_ekTk(univ)#

Compute the energy spectrum and transfer function.

Parameters:

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

T_to_Tcopy(univ)#

Copy the scalar field to the universal arrays.

Parameters:

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

Tcopy_to_T(univ)#

Copy the universal arrays to the scalar field.

Parameters:

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