2. Motivations
• Working with simulations is a great way to see, or at least try to see, how
the invisible world works.
• Simulations give us a great weapon to understand how thinks work before
building or putting in the real world.
• This way we can think and create mechanisms that help us on avoiding
wasting energy and that will probably work better.
• Working with this specific problem is a great way to understand what
happens inside a room, for example, and knowing this another cooling and
heating systems could be used to let the room good for people.
3. Geometry
• 2-D geometry which has 100 centimeters on horizontal direction and 20 centimeters
on vertical direction.
• The output file contains just half of the field (the right hand side), the code do this
because the geometry is essentially symmetric and also because getting the entire
field, the output file would be too big for post-processing it.
• As it is a channel, the sides are the same, so we apply BC’s just in UPPER and
LOWER surfaces.
• Even this geometry being a channel, we are working in cartesian coordinates,
instead of working in cylindrical coordinates.
These sides are the same
4. Some Considerations
• This code computes incompressible flow in a box.
• To compute the spatial derivatives the code uses finite differences in Y
direction and a spectral decomposition (Fast Fourier Transform) in X direction.
• For the time advancement the code uses basically the Third Order Runge-Kutta
Method.
• Low density = 1.00 g/cm².
• High density = 1.02 g/cm².
• Code uses TH = 1 for high density and TH = 0 for low density, this is a non-
dimensional number used to describe the field.
• This is the color scheme used in these simulations.
• “Richardson number ”= g * (
ρ − ρ0
ρ0
) = -980*((1.02-1.00)/1.00) = -19.6 cm/s².
• It is an important number when considering flows in which density differences
are small.
5. Considerations About Cases
• LOWER_BC will always apply 0 density to the field.
• The focus here is the UPPER_BC.
• Initial field will be set up always equals to 0.
• Changes are just made on the structure of the code, no physical variables were
changed so far.
• Parameters usually modified:
– Number of time steps. A few number when checking with the BC’s are correct, and a big number
when running a complete case.
– Delta_T. When getting a quick answer can be set up to 0.005, but usually is 0.001.
– How often to save the output files. This is very important, again, to avoid having extremely huge files.
• All graphs showed on the following slides are from the UPPER_BC
7. Case 03
• First case studied
• Started my research with this case.
• Initial field had been set up with a stepped function in the UPPER_BC- This is
right!
8. Case 03
• Initial field applied by the code in the UPPER_BC (before BC be applied).
• Gibbs Phenomenon happening ( Fourier series of a piecewise continuously
differentiable periodic function behaves at a jump discontinuity).
Gibbs Phenomenon
9. Case 22
• After some cases, the initial field was set up to 0, meaning that the minimum
density was being applied as an initial condition.
• This is a boring case where the BC’s, UPPER and LOWER, are applying 0 density,
so it has nothing happening.
• This is just to make sure the code is doing what it was supposed to do, when certain
known BC’s are applied to the system.
10. Case 22
• Initial field applied to the system (1).
• UPPER_BC being applied from the 2 iteration on (2).
(1) (2)
11. Case 23
• Density = 1 being applied to the initial field, which is equal to 0.
• This is another boring case where can be seen that the high density mass has a
diffusive behavior.
• Again, to make sure the code is doing what is supposed to do.
12. Case 23
• Initial field equal to 0 being applied (1).
• UPPER_BC equal to 1 being applied (2).
(1) (2)
13. Case 25
• Started changing the way UPPER_BC is applied to the system
• For this case there is a stepped function applying density equals 1 to the system.
14. Case 25
• Gibbs Phenomenon might be given the initial kick to the system, so this has to be
avoided.
• The goal here is that the system initialize the perturbation just by the density
difference.
Gibbs Phenomenon
15. Case 26
• Now a density linear function is being applied to the system, this way, the
oscillations given by Gibbs Phenomenon can be practically eliminated.
16. Case 26
• Even almost eliminating all oscillations, if zoomed in, still can be seen small
irregularities to the curve, and this happens to both two transitions, from 1 to the
line, and from the line to 0.
• With this consideration, we can say that the first perturbation is given just by the
densities difference, because this perturbation occurs just in the left transition.
17. Case 27
• Started controlling when the BC would be applied
• The controller for this case is the number of time steps.
• This is not a very realistic controller, but it is the easiest one to see if the code gives
us a good output.
• From 0 to some number of time steps we have the linear function being applied and
from this number of time steps on we have 0 being applied to the system.
• As can be seen, a decay is happening to the system, the higher density is being
dissipated by both two BC’s, after the first BC be turned off.
18. Case 27
• First BC being applied (1).
• Second BC being applied (2).
(1) (2)
19. Case 28
• Controlling again by the number of time steps.
• In this case, there is the same liner function being applied during the first half of
time steps and after this, an opposite linear function starts being applied till the end.
20. Case 28
• The linear BC being applied (1) in the first half of time steps.
• The opposite BC being applied (2) in the last half of time steps.
(1) (2)
21. Case 29
• Three different BC being applied with the same kind of controller, the time steps
• In the first third of time steps, the regular linear equation is being applied.
• In the second third, the 1 density is being applied.
• The last third receives the opposite linear equation.
23. Case 31
• Starting controlling when the BC would be applied by a new variable called
AVERAGE.
• The average computes the density average in the entire field.
• The goal for this case is to reach certain value of average, and after this value is
reached the linear BC is turned off to a density equals to 0.
• So again, we can see a decay behavior, the high density goes gradually
disappearing.
• For this case the average limit was set up to be equals to 0.05.
24. Case 31
• This picture shows the average density graph for this case.
• There are two important regions on this chart.
• The first one is when the first perturbation in the system happens.
• The second one is when all that upper layer of high density starts mixing with the
low density part.
1
2
25. Case 31
• Two regions can be better seen on this picture.
26. Case 31
• Also, the exactly time when the UPPER_BC is turned off can be seen.
• There is an abrupt drop because the code is actually measuring the average in the
field and in the BC’s.
27. Case 32
• This is practically the same case as the previous one, the only different thing is that
now the code is not adding up the BC’s to compute the average.
• Doing this we avoid having that abrupt drop on the graph.
• This is way more realistic, because if we are measuring the temperature in a room,
we are not measuring it on the walls, but inside the room.
28. Case 32
• Also for this case the independence delta_t was studied.
• Simulations with different delta_t’s were ran, and the values used were: 0.001,
0.002, 0.003, 0.004 and 0.005. Delta_t’s greater than 0.01 just diverged.
• The same frame was chosen in each simulation, this can be a tough task when
dealing with a non integer number of time steps, but the results were quiet good.
29. Case 32
• This figure shows a specific line on each frame. In other words, this is the TH value
for all x values and a specific y value.
30. Case 32
• Results match very well up to 0.004, but from 0.005 on the results start diverging.
• The curve with delta_t equal to 0.003 don’t match very well because this value
don’t give an integer number for time steps, and the time step number has to be
integer.
31. Case 33
• In this case the AVERAGE walks between two limits, 0.035 and 0.05.
• The first BC applied is the regular linear. When the AVERAGE reaches the value of
0.05 the system turn this BC off and turn on the BC equals 0 and when the average
reaches 0.035 the system turn on the BC again and so on.
• So what can be seen is a combination of moments where the AVERAGE is
increasing and decreasing.
32. Case 33
• This figure shows better all what is happening on the last video.
• Even the difference between the lower peaks are not the same, a pattern can be seen
on this graph, and this is good because the code is not giving random results.
• This difference can probably be explained in terms of the vortices, in this moment
they are not being tracked, but they are visibly different at each time the code turn
on and turn off the BC.
• Also the filed is significantly more homogeneous because of all this vortices and
this helps this difference be smaller.
33. Case 33
• The change on the slope also can be seen every time the code turn on the BC, this is
good, because it shows that the system is following a pattern and not just working
randomly.
34. Future Cases
• Elaborate new ways to control the system, probably using different physical
variables like kinematic energy and others.
• Try to use a function which could define better the transition between 1 and 0
density, this way we could completely avoid oscillations near the corners.
• Maybe start using Neumann BC instead of just Dirichlet, this could be more
challenging but also could be done.