fluidsim.solvers.ns2d.strat.solver

NS2D solver (fluidsim.solvers.ns2d.strat.solver)

class fluidsim.solvers.ns2d.strat.solver.Simul(params)[source]

Bases: fluidsim.solvers.ns2d.solver.Simul

Pseudo-spectral solver 2D incompressible Navier-Stokes equations.

InfoSolver

alias of InfoSolverNS2DStrat

static _complete_params_with_default(params)[source]

This static method is used to complete the params container.

tendencies_nonlin(self, state_spect=None, old=None)[source]

Compute the nonlinear tendencies of the solver ns2d.strat.

Parameters
state_spectfluidsim.base.setofvariables.SetOfVariables

optional

Array containing the state, i.e. the vorticity, in Fourier space. If state_spect, the variables vorticity and the velocity are computed from it, otherwise, they are taken from the global state of the simulation, self.state.

These two possibilities are used during the Runge-Kutta time-stepping.

Returns
tendencies_fftfluidsim.base.setofvariables.SetOfVariables

An array containing the tendencies for the vorticity and the buoyancy perturbation.

Notes

The 2D Navier-Stokes equation can be written

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

and

\[\partial_t \hat b = \hat N(b) - \sigma(k) \hat b\]

This function compute the nonlinear terms (“tendencies”) \(N(\zeta) = - \mathbf{u}\cdot \mathbf{\nabla} \zeta + \mathbf{\nabla}\wedge b\mathbf{e_z} = - \mathbf{u}\cdot \mathbf{\nabla} \zeta + \partial_x b\) and \(N(b) = - \mathbf{u}\cdot \mathbf{\nabla} b + N^2u_y\).

check_energy_conservation(self, rot_fft, b_fft, f_rot_fft, f_b_fft)[source]

Check energy conservation for the inviscid case.

compute_dispersion_relation(self)[source]

Computes the dispersion relation of internal gravity waves solver ns2d.strat.

Returns
omega_dispersion_relationarr

Frequency dispersion relation in rad.

Functions

tendencies_nonlin_ns2dstrat(ux, uy, px_rot, …)

Classes

InfoSolverNS2DStrat(**kargs)

Simul(params)

Pseudo-spectral solver 2D incompressible Navier-Stokes equations.