Python code collection to solve the linear stabilty problem arising in convection problems. rbc-1d.py and rbc-2d.py contain the special case of Rayleigh-Benard convection.
The basis is the dimensionless Navier--Stokes equation:
Using the modal ansatz for velocity, pressure and temperature fluctuations
the two dimensional linearized Navier-Stokes equation with thermal forcing can be written in Matrix form
where overlines denote mean flow quantities and D_x is a suitable differentiation matrix (DM), for example a chebyshev DM. This is a generalized Eigenvalue problem (EVP) of the form
of size and can be solved directly or iteratively.
In case of an infinite horizontal domain, we can apply the modal ansatz also in the x-direction. Practically, this is simply done by replacing , thus the dimensionality of the system is reduced and the EVP is of size
.
A steady state becomes unstable when the eigenvalue of the rhs is zero, then the Rayleigh number corresponds to the critical Rayleigh number Ra_c. One can solve directly for Ra_c by rewriting the above matrix:
where the eigenvalue is now representative for the critical Rayleigh number.
numpy matplotlib scipy
P. Reiter and X. Zhang and R. Stepanov and O. Shishkina, Generation of zonal flows in convective systems by travelling thermal waves, J. Fluid Mech., 913 (2021), A13
G. Ahlers, E. Bodenschatz, R. Hartmann, X. He, D. Lohse, P. Reiter, R. Stevens, R. Verzicco, M. Wedi, S. Weiss, X. Zhang, L. Zwirner and O. Shishkina, Aspect ratio dependence of heat transfer in a cylindrical Rayleigh–Benard cell, in preparation (2021)