fluidsim.util.scripts.turb_trandom_anisotropic

Simulations with the solver ns3d.strat and the forcing tcrandom_anisotropic.

fluidsim.util.scripts.turb_trandom_anisotropic.create_parser()[source]

Create the argument parser with default arguments

fluidsim.util.scripts.turb_trandom_anisotropic.main(args=None, **defaults)[source]

Main function for the scripts based on turb_trandom_anisotropic

Example of help message

usage: run_simul.py [-h] [-oppac] [-opp] [-opf] [-nz NZ]
                    [--ratio-nh-nz RATIO_NH_NZ] [--t_end T_END] [-N N]
                    [-nu NU] [--nu4 NU4] [-Rb RB] [--Rb4 RB4]
                    [--coef-nu4 COEF_NU4] [--forced-field FORCED_FIELD]
                    [--init-velo-max INIT_VELO_MAX] [--nh-forcing NH_FORCING]
                    [--ratio-kfmin-kf RATIO_KFMIN_KF]
                    [--ratio-kfmax-kf RATIO_KFMAX_KF] [-F F]
                    [--delta-F DELTA_F] [--spatiotemporal-spectra]
                    [--projection PROJECTION] [--disable-no-vz-kz0]
                    [--disable-NO-SHEAR-MODES] [--max-elapsed MAX_ELAPSED]
                    [--coef-dealiasing COEF_DEALIASING]
                    [--periods_save-phys_fields PERIODS_SAVE_PHYS_FIELDS]
                    [--sub-directory SUB_DIRECTORY]
                    [--modify-params MODIFY_PARAMS]

Launcher for simulations with the solver ns3d.strat and
the forcing tcrandom_anisotropic.

Examples
--------

```
./run_simul.py --only-print-params
./run_simul.py --only-print-params-as-code

./run_simul.py -F 0.3 --delta-F 0.1 --ratio-kfmin-kf 0.8 --ratio-kfmax-kf 1.5 -opf
./run_simul.py -F 1.0 --delta-F 0.1 --ratio-kfmin-kf 0.8 --ratio-kfmax-kf 1.5 -opf

mpirun -np 2 ./run_simul.py
```

Notes
-----

This script is designed to study stratified turbulence forced with an
anisotropic forcing in toroidal or poloidal modes.

The regime depends on the value of the horizontal Froude number Fh and buoyancy
Reynolds numbers R and R4:

- Fh = epsK / (Uh^2 N)
- R = epsK / (N^2 nu)
- R4 = epsK Uh^2 / (nu4 N^4)

Fh has to be very small to be in a strongly stratified regime. R and R4 has to
be "large" to be in a turbulent regime.

For this forcing, we fix the injection rate P (very close to epsK). We will
work at P = 1.0, such that N, nu and nu4 determine the non dimensional numbers.

Note that Uh is not directly fixed by the forcing but should be a function of
the other input parameters. Dimensionally, we can write Uh = (P Lfh)**(1/3).

For simplicity, we'd like to have Lfh=1.0. We want to force at "large
horizontal scale" (compared to the size of the numerical domain). This length
(params.oper.Lx = params.oper.Ly) is computed with this condition.

options:
  -h, --help            show this help message and exit
  -oppac, --only-print-params-as-code
                        Only run initialization phase and print params as code
  -opp, --only-print-params
                        Only run initialization phase and print params
  -opf, --only-plot-forcing
                        Only run initialization phase and plot forcing
  -nz NZ, --nz NZ       Number of numerical points over one vertical axis
  --ratio-nh-nz RATIO_NH_NZ
                        Ratio nh / nz (has to be a positive integer, fixes the
                        aspect ratio of the numerical domain)
  --t_end T_END         End time
  -N N                  Brunt-Väisälä frequency
  -nu NU                Viscosity
  --nu4 NU4             Order-4 hyper viscosity
  -Rb RB                Input buoyancy Reynolds number (injection_rate / (nu *
                        N^2))
  --Rb4 RB4             Input order-4 buoyancy Reynolds number (injection_rate
                        / (nu_4 * N^4))
  --coef-nu4 COEF_NU4   Coefficient used to compute the order-4 hyper
                        viscosity
  --forced-field FORCED_FIELD
                        Forced field (can be "polo", "toro", ...)
  --init-velo-max INIT_VELO_MAX
                        params.init_fields.noise.max
  --nh-forcing NH_FORCING
                        Dimensionless horizontal wavenumber forced
  --ratio-kfmin-kf RATIO_KFMIN_KF
  --ratio-kfmax-kf RATIO_KFMAX_KF
  -F F                  Ratio omega_f / N, fixing the mean angle between the
                        vertical and the forced wavenumber
  --delta-F DELTA_F     delta F, fixing angle_max - angle_min
  --spatiotemporal-spectra
                        Activate the output spatiotemporal_spectra
  --projection PROJECTION
                        Type of projection (changes the equations solved)
  --disable-no-vz-kz0   Disable params.no_vz_kz0
  --disable-NO-SHEAR-MODES
                        Disable params.oper.NO_SHEAR_MODES
  --max-elapsed MAX_ELAPSED
                        Max elapsed time
  --coef-dealiasing COEF_DEALIASING
                        params.oper.coef_dealiasing
  --periods_save-phys_fields PERIODS_SAVE_PHYS_FIELDS
                        params.output.periods_save.phys_fields
  --sub-directory SUB_DIRECTORY
                        Sub directory where the simulation will be saved
  --modify-params MODIFY_PARAMS
                        Code modifying the `params` object.

Functions

create_params(args)

Create the params object from the script arguments

create_parser()

Create the argument parser with default arguments

main([args])

Main function for the scripts based on turb_trandom_anisotropic