Differentially Heated Cavity
Contents
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:
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
Grashof number \(Gr\) describing the ratio between buoyancy and viscous forces
Richardson number \(Ri\) measures the importance of gravitational effects on the fluid dynamics
In this work, the parameter space has been sampled in the following domain
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
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
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.