Base class for flow solvers.
turbigen is CFD-solver agnostic, in that all all pre- and post-processing is done by native code.
Each CFD solver accepts different configuration options. Solver options and their default values are listed below; override the defaults using the solver section of the configuration file.
Adding a new solver only requires functions to save CFD input files, execute the solver, and read back the flow solution into turbigen’s internal data structures. See the Custom solvers section for more details.
ember¶
ember is the native flow solver built into turbigen.
Name |
Type |
Default |
Description |
---|---|---|---|
|
|
|
Fourth-order smoothing factor. |
|
|
|
Second-order smoothing factor, adaptive on pressure. |
|
|
|
Second-order smoothing factor, constant throughout the flow. |
|
|
|
Largest reduction in smoothing on a non-isotropic grid. Unity disables directional scaling, lower values clip the local smoothing factor to be sf_local >= sf * smooth_ratio_min. |
|
|
|
Courant–Friedrichs–Lewy number, time step normalised by local wave speed and cell size. Reduced values are more stable but slower to converge. |
|
|
|
Number of time steps to run for. |
|
|
|
Number of time steps between mixing plane updates. |
|
|
|
Number of time steps between updates of the local time step. |
|
|
|
Number of time steps between log prints. |
|
|
|
Number of time steps to average over. |
|
|
|
Number of time steps to ramp smoothing and damping. |
|
|
|
Number of time steps between viscous force updates. |
|
|
|
Number of steps to apply damping. |
|
|
|
Negative feedback to damp down high residuals. Lower values are more stable. |
|
|
|
Turbulent Prandtl number. |
|
|
|
Maximum mixing length as a fraction of the pitch. |
|
|
|
Precision of the solver. 1: single, 2: double. |
|
|
|
Which time-stepping scheme to use. 0: scree, 1: super. |
|
|
|
Viscous loss model. 0: inviscid, 1: viscous. |
|
|
|
Relaxation factor for outlet forcing. |
|
|
|
Relaxation factor for inlet forcing. |
|
|
|
Relaxation factor for mixing plane forcing. |
|
|
|
Smoothing factor for uniform enthalpy and entropy downstream of mixing plane. |
|
|
|
Print convergence history in the log. |
|
|
|
Factor scaling the multigrid residual. |
|
|
|
Number of cells forming each multigrid level. (2, 2, 2) gives coarse cells of side length 2, 4, and 8 fine cells. |
|
|
|
Force area-averaged outlet pressure to target, otherwise use uniform outlet pressure. |
Custom solvers¶
To add a new solver, create a new class that inherits from turbigen.solvers.base.BaseSolver
. and implement the following methods:
run()
: Run the solver on the given grid and machine geometry.robust()
: Create a copy of the config with more robust settings.restart()
: Create a copy of the config with settings to restart from converged solution.
turbigen.solvers.base.BaseSolver
is a dataclass, so has an automatic constructor and
useful built-in methods. The configuration file solver section
is fed into the constructor as keyword arguments and becomes attributes of
the instance.