Differentially Heated Cavity#

The side-driven differentially heated encloures are characterised by one (or two) vertical wall moving at costant velocity with different temperature imposed. This kind of problem shows simple domain with complex fluid dynamics strongly coupled with the buouyancy effects [23].

Some modelling assumptions are made:

  • the flow is considered laminar, two-dimensional and steady-state;

  • the properties of the fluid are assumed constant except in the body force term, where the density varies linearly with temperature according to the Boussinesq approximation;

  • the fluid inside the cavity is assumed Newtonian, while viscous dissipation effects are negligible;

  • the Prandtl number is \(Pr=0.71\) (air-filled cavity).

The viscous incompressible flow and the temperature distribution inside the cavity are governed by the Navier–Stokes and the energy equations, respectively. In light of the assumptions mentioned above, the parametrized PDEs expressed in properly non-dimensional form read, denoting with \(\Omega=[0,1]^2\subset\mathbb{R}^2\) the domain:

\[\begin{equation*} \left\{ \begin{aligned} \nabla \cdot \mathbf{u}&=0 \quad &\text{ in } \; \Omega\\ (\mathbf{u} \cdot \nabla)\mathbf{u} - \nu \Delta \mathbf{u}+ \nabla p - \mathbf{g}\,\beta(T-T_\infty) &=0 & \text{ in }\; \Omega \\ \mathbf{u} \cdot \nabla T - \alpha \Delta T&= 0\quad& \text{ in } \; \Omega \\ \mathbf{u}(0,y)=\mathbf{u}(1,y)&= (0,1) \\ \mathbf{u}(x,0)=\mathbf{u}(x,1)&= (0,0) \\ T(0,y)=T_H, \; T(1,y)&=T_C \\ \left.\frac{\partial T}{\partial y} \right|_{y=0}= \left.\frac{\partial T}{\partial y} \right|_{y=1}&=0 \end{aligned} \right. \end{equation*}\]

This kind of problems are governed by some dimensionless groups, in addiction to the Prandtl number (specific for a fluid):

  • Reynolds number \(Re\) describing the ratio between inertia and viscous forces

\[\begin{equation*} Re = \frac{U\,L}{\nu} \end{equation*}\]
  • Grashof number \(Gr\) describing the ratio between buoyancy and viscous forces

\[\begin{equation*} Gr = \frac{g\beta(T_H-T_C)L^3}{\nu^2} \end{equation*}\]
  • Richardson number \(Ri\) measures the importance of gravitational effects on the fluid dynamics

\[\begin{equation*} Ri = \frac{g\beta(T_H-T_C)L}{U^2} = \frac{Gr}{Re^2} \end{equation*}\]

In this work, the parameter space has been sampled in the following domain

\[\begin{equation*} Re\in[15,\,150]\qquad \qquad Ri\in[0.2, \,5] \end{equation*}\]

The geometrical domain has been discretized using a uniform \(128\times 128\) grid and the steady-state solver for buoyant, laminar flow of incompressible fluids buoyantBoussinesqSimpleFoam has been used.

Generation of the snapshots#

In the Tutorials/BuoyantCavity folder, there are a subfolder BaseCase and a script allrun.py which can be used to solve this problem for various values of \(Re\) and \(Ri\); in particular, it’s possible to specify which solutions are desired.

The number of processor to be used can be set as well as the desired values of \(Re \) and \(Ri\), let us see how this works to generate the Train and Test set.

Train Set#

The Train Set of snapshots is given by

\[\begin{equation*} Re\in[15:5:150]\qquad \text{ and } \qquad Ri\in[0.2:0.4:5] \end{equation*}\]

correspondent in Python to

dRe = 5.
dRi = 0.4

print('Creating Train Snapshots')
Re = np.arange(15,  150+dRe/2, dRe) # [15, 150]
Ri = np.arange(0.2,   5+dRi/2, dRi) # [0.2, 1., 5.]
if not os.path.exists(w_dir+'/TrainSet'):
        os.system("mkdir "+w_dir+'/TrainSet')

By executing this python code (requires numpy, pandas, matplotlib and os) with

python allrun.py

The snapshots are generated into TrainSet folder (created by the script itself, if required). Moreover, the code generates a train_folders.txt file containing a list of the names of the folders with the snapshots.

Test Set#

The Test Set of snapshots is given by

\[\begin{equation*} Re\in[17.5:5:147.5]\qquad \text{ and } \qquad Ri\in[0.4:0.4:4.8] \end{equation*}\]

correspondent in Python to

dRe = 5.
dRi = 0.4

print('Creating Test Snapshots')
Re = np.arange(15+dRe/2,  150+dRe/2, dRe) 
Ri = np.arange(0.2+dRi/2,   5+dRi/2, dRi)
if not os.path.exists(w_dir+'/TestSet'):
        os.system("mkdir "+w_dir+'/TestSet')

By executing this python code (requires numpy, pandas, matplotlib and os) with

python allrun.py

The snapshots are generated into TestSet folder (created by the script itself, if required). Moreover, the code generates a test_folders.txt file containing a list of the names of the folders with the snapshots.