# Bacon, a Lightweight Deep Reinforcement Learning Benchmark Library for Flow Control
## 3 Environments
### Rayleigh  
#### 3.2.1 Physics  
We consider the resolution of the 2D Navier-Stokes equations coupled to the heat equation in a cavity of length \(L\) and height \(H\) with a hot bottom plate and cold top plate. Under favorable circumstances, this setup is known to lead to the Rayleigh-Benard  
Figure 3: **Evolution of the flow under control of the agent using 5 jets.** The jets strengths are represented in the bottom rectangle (red means positive amplitude, blue means negative amplitude). The horizontal and vertical axes are the same as in Figure 1.  
convection cell, illustrated in Figure 4. The resulting system is driven by the following set of equations:  
\[\
abla\cdot\mathbf{u} =0, \tag{10}\] \[\partial_{t}\mathbf{u}+\left(\mathbf{u}\cdot\
abla\right)\mathbf{u} =-\
abla p+\sqrt{\frac{\text{Pr}}{\text{Ra}}}\
abla^{2}\mathbf{u}+ \theta\hat{\mathbf{y}},\] \[\partial_{t}\theta+\left(\mathbf{u}\cdot\
abla\right)\theta =\frac{1}{\sqrt{\text{Pr}\,\text{Ra}}}\
abla^{2}\theta,\]  
where \(\mathbf{u}\), \(p\), and \(\theta\) are, respectively, the non-dimensional velocity, pressure, and temperature of the fluid. The adimensional temperature \(\theta\) is described in terms of the hot and cold reference temperatures, respectively denoted as \(T_{H}\) and \(T_{C}\), as follows:  
\[\theta=\frac{T-\hat{T}}{\Delta T},\text{with}\ \hat{T}=\frac{T_{H}+T_{C}}{2}\ \text{and}\ \Delta T=T_{H}-T_{C}.\]  
The dynamics of system (10) are controlled by two adimensional numbers. First, the Prandtl number \(\text{Pr}\), which represents the ratio of the momentum diffusivity over the thermal diffusivity as follows:  
\[\text{Pr}=\frac{\
u}{\kappa},\]  
where \(\
u\) is the kinematic viscosity and \(\kappa\) the thermal diffusivity. Second, the Rayleigh number \(\text{Ra}\), which compares the characteristic time scales for transport due to diffusion and convection as follows:  
\[\text{Ra}=\frac{g\alpha\Delta TH^{3}}{\kappa\
u},\]  
where \(g\) is the magnitude of the acceleration of the gravity, and \(\alpha\) is the thermal expansion coefficient. We also define the instantaneous Nusselt number, \(\text{Nu}\), as the adimensionalized heat flux averaged over the hot wall as follows:  
\[\text{Nu}(t)=-\int_{0}^{L}\partial_{y}\theta(x^{\prime},y=0,t)dx^{\prime}. \tag{11}\]  
System (10) is completed by the following initial and boundary conditions:  
\[\begin{split}\mathbf{u}(x,y,0)&=0\ \text{and}\ \theta(x,y,0)=0,\\ \mathbf{u}(x=0,y,t)&=0\ \text{and}\ \mathbf{u}(x=L,y,t)=0,\\ \mathbf{u}(x,y=0,t)&=0\ \text{and}\ \mathbf{u}(x,y=H,t)=0,\\ \theta(x,y=0,t)&=\theta_{H}\ \text{and}\ \theta(x,y=H,t)= \theta_{C},\\ \partial_{x}\theta(x=0,y,t)&=0\ \text{and}\ \partial_{x}\theta(x=L,y,t)=0,\end{split} \tag{12}\]  
In essence, the boundary conditions (12) correspond to (i) a no-slip boundary conditions for the fluid on all boundaries, (ii) imposed hot and cold temperatures on the bottom and top plate, respectively, and (iii) adiabatic boundary conditions on the lateral sides of the domain.  
Above critical value \(\text{Ra}_{c}\), natural convection is triggered in the cell, increasing the heat exchange between the bottom and top regions of the cell, thus leading to a \(\text{Nu}>1\). Illustrations of the temperature and velocity fields are proposed in Figure 4.