fluidsim.base.solvers.pseudo_spect

Base solver (fluidsim.base.solvers.pseudo_spect)

This module provides two base classes that can be used to define pseudo-spectral solvers.

class fluidsim.base.solvers.pseudo_spect.InfoSolverPseudoSpectral(only_root=False, **kargs)[source]

Bases: InfoSolverBase

Contain the information on a base pseudo-spectral 2D solver.

_init_root()[source]

Init. self by writting the information on the solver.

The first-level classes for this base solver are:

class fluidsim.base.solvers.pseudo_spect.SimulBasePseudoSpectral(params)[source]

Bases: SimulBase

Pseudo-spectral base solver.

InfoSolver

alias of InfoSolverPseudoSpectral

static _complete_params_with_default(params)[source]

Complete the params container (static method).

compute_freq_diss()[source]

Compute the dissipation frequency.

Use the self.params.nu_… parameters to compute an array containing the dissipation frequency as a function of the wavenumber.

The governing equations for a pseudo-spectral solver can be written as

\[\partial_t S = N(S) - \sigma(k) S,\]

where \(\sigma\) is the frequency associated with the linear term.

In this function, the frequency \(\sigma\) is split in 2 parts: the dissipation at small scales and the dissipation at large scale (hypo-viscosity, params.nu_m4).

Returns:
f_dnumpy.array

The dissipation frequency as a function of the wavenumber (small sclale part).

f_d_hyponumpy.array

The dissipation frequency at large scale (hypo-viscosity)

plot_freq_diss(direction='x')[source]

Plot the dissipation frequencies as functions of k.

directionstr

Direction of the wavevector to plot with (“x”, “y” or “z”)

tendencies_nonlin(variables=None, old=None)[source]

Compute the nonlinear tendencies.

This function has to be overridden in a child class.

Returns:
tendencies_fftfluidsim.base.setofvariables.SetOfVariables

An array containing only zeros.

class fluidsim.base.solvers.pseudo_spect.InfoSolverPseudoSpectral3D(only_root=False, **kargs)[source]

Bases: InfoSolverPseudoSpectral

Contain the information on a base pseudo-spectral 3D solver.

_init_root()[source]

Init. self by writting the information on the solver.

The first-level classes for this base solver are the same as for the 2D pseudo-spectral base solver except the class:

  • fluidsim.operators.operators2d.OperatorsPseudoSpectral3D

Classes

InfoSolverPseudoSpectral([only_root])

Contain the information on a base pseudo-spectral 2D solver.

InfoSolverPseudoSpectral3D([only_root])

Contain the information on a base pseudo-spectral 3D solver.

Simul

alias of SimulBasePseudoSpectral

SimulBasePseudoSpectral(params)

Pseudo-spectral base solver.