WEBVTT

00:00.290 --> 00:01.280
Hello everyone.

00:01.280 --> 00:05.030
Welcome back to the CFD using Openfoam beginner to Intermediate course.

00:05.030 --> 00:11.330
This is our class four and we will see overview on incompressible solvers, compressible solvers and

00:11.330 --> 00:14.570
some of the multiphase solvers which are available in Openfoam.

00:14.570 --> 00:21.200
Then we will do a hands on tutorial on case study on lid driven cavity, same as what we did in the

00:21.200 --> 00:28.760
class previous class, but it will be much refined and we will actually see how the simulation goes.

00:28.760 --> 00:31.040
Instead of a bad mesh, we will have a very good mesh.

00:31.940 --> 00:33.560
So incompressible solvers.

00:33.620 --> 00:39.020
Incompressible solvers in Openfoam are used to simulate fluid flows where the fluid density remains

00:39.020 --> 00:39.710
constant.

00:39.710 --> 00:45.920
So not just in Openfoam whenever you are trying to do any analytical calculations, or in most of the

00:45.920 --> 00:49.370
commercial solvers, the incompressibility is assumed.

00:49.370 --> 00:55.060
In most of the cases, unless you are working with very high speed sonic, uh, or external aerodynamics

00:55.060 --> 00:55.450
thing.

00:56.200 --> 00:58.060
Otherwise, mostly it is incompressible.

00:58.060 --> 01:03.910
The solvers are ideal for simulating flows at very low Mach number, where compressible effects can

01:03.910 --> 01:04.930
be neglected.

01:04.990 --> 01:08.980
So mostly less than, uh, Mach one, mostly subsonic.

01:10.360 --> 01:15.280
The incompressible solver is available in Openfoam or Ecco form.

01:15.280 --> 01:20.550
So as we already saw, Ecco form is a transient solver for incompressible laminar flow of Newtonian

01:20.550 --> 01:20.970
fluids.

01:21.000 --> 01:26.430
The application can be used for time dependent simulation, that is, transient simulation involving

01:26.430 --> 01:27.870
very simple fluid flow.

01:28.200 --> 01:33.120
Laminar case and it is useful in simulating transient flow in a pipe or a channel.

01:33.120 --> 01:36.750
So it can be very easily set up and we can get good results.

01:36.930 --> 01:40.950
The next most widely used solver is simple form.

01:41.130 --> 01:46.080
It is known among almost everyone using Openfoam, so it is the most common one.

01:46.620 --> 01:49.020
It is a steady state solver for incompressible.

01:49.020 --> 01:50.970
It can also work for turbulent flows.

01:50.970 --> 01:56.400
Both laminar and turbulence can be simulated here and it has a variety of turbulence models.

01:56.400 --> 02:02.670
The application will be suitable for steady state problems in various engineering applications, mostly

02:02.670 --> 02:05.940
in cases of airflow over an airfoil or water flow.

02:06.210 --> 02:12.480
Flow in a hydraulic structure where the same flow will get to steady state after some time.

02:12.480 --> 02:15.150
So that is where we can generally use, uh.

02:15.150 --> 02:16.560
It is always steady.

02:16.560 --> 02:18.810
That's why we are using simple algorithm inside.

02:19.320 --> 02:21.120
And we have a simple form.

02:21.120 --> 02:25.980
So this is combination of piezo algorithm and uh simple algorithm.

02:26.520 --> 02:28.440
So that is how the name pimple came.

02:28.440 --> 02:31.300
It is not available in any other commercial solvers.

02:31.300 --> 02:35.620
So the description is this is a transient solver for incompressible.

02:35.620 --> 02:37.690
It can handle both laminar and turbulent.

02:37.690 --> 02:39.700
It is very similar to simple form.

02:39.700 --> 02:45.220
But this can also uh work on time dependent simulation that is transient simulations.

02:45.220 --> 02:48.220
So unlike simple form this can work on transient simulation.

02:48.220 --> 02:53.290
So it is like flow around a cylinder or moving airfoil where the mesh moves.

02:53.530 --> 02:57.340
Uh, dynamic Dynamic meshing is also possible, and where there is vortex shedding.

02:57.340 --> 02:58.990
In those cases we can use simple form.

02:58.990 --> 03:02.200
This is also widely used as equally as simple form.

03:03.160 --> 03:07.270
So the implement implementation steps are going to remain the same.

03:07.270 --> 03:10.840
Either you use block mesh alone or along with snappy mesh.

03:10.840 --> 03:12.130
We are generating the mesh.

03:12.130 --> 03:16.150
Then we will be setting up the zero directory for boundary conditions.

03:16.150 --> 03:20.340
Then we will be setting up the transport properties turbulence properties.

03:20.340 --> 03:24.960
Then we will configure whatever we want to do in the system directory under control dict.

03:25.410 --> 03:29.610
And we will initiate the uh simulation.

03:29.610 --> 03:32.670
If it is ICO form, just type ICO form and it will get initiated.

03:32.670 --> 03:34.440
If it is simple form then simple form.

03:34.440 --> 03:35.790
So you get the point.

03:36.090 --> 03:38.820
We have to use the name of the solver to initiate it.

03:39.930 --> 03:43.500
So introduction to compressible solvers in Openfoam.

03:43.860 --> 03:47.760
Uh handle fluid flows where density changes are very significant.

03:47.760 --> 03:52.890
These solvers are essential for high speed flows, shock waves, and other compressible phenomena.

03:53.130 --> 03:56.580
So the most important solver is rho central foam.

03:56.640 --> 03:59.310
So it is a density based compressible flow solver.

03:59.460 --> 04:05.790
So whatever we saw in incompressible or pressure based solvers now uh rho central foam is a density

04:05.790 --> 04:06.720
based solver.

04:07.370 --> 04:11.300
so it is suitable for high speed aerodynamic and shock wave kind of simulation.

04:11.720 --> 04:16.820
And one of the examples is if you want to simulate a supersonic flow over a ridge or through a nozzle,

04:16.820 --> 04:18.770
then you can use row central foam.

04:19.550 --> 04:23.900
And there is one very popular, uh, compressible solver called sonic foam.

04:23.990 --> 04:32.560
So as the name says, it works for sonic flows, uh, a transient solver and uh, for transonic, supersonic,

04:32.560 --> 04:34.480
subsonic, anything you can use.

04:34.480 --> 04:38.380
But it assumes that the gas or the fluid is compressible.

04:38.380 --> 04:39.610
That is the only thing.

04:39.610 --> 04:41.980
So if it is compressible, mostly it is gas.

04:41.980 --> 04:43.750
It can't be a liquid.

04:43.840 --> 04:50.290
And applications is useful for simulating time dependent compressible flows, which is transient and

04:50.290 --> 04:54.400
simulating a shock tube or expansion of a gas in a nozzle.

04:54.400 --> 04:57.520
These are the kind of things sonic foam is good at doing.

04:57.550 --> 04:59.080
Then we have rho pimple foam.

04:59.080 --> 05:03.580
As it says, Rho is for density based and the pimple is for transient.

05:04.300 --> 05:08.650
So it is a transient solver for turbulent flows of compressible fluids.

05:08.650 --> 05:12.880
Unlike, uh, pure simple foam, this can also handle compressible fluids.

05:13.000 --> 05:18.400
It is applicable to a wide range of, uh, compressible fluid problems, including high speed train

05:18.400 --> 05:19.770
or an aircraft wing.

05:20.220 --> 05:20.640
Okay.

05:20.640 --> 05:23.940
And implementation step is going to remained the same.

05:23.940 --> 05:27.810
But we also have to define the pressure and velocity differently.

05:27.810 --> 05:30.060
Since it is density based.

05:30.060 --> 05:36.840
We will be defining thermophysical properties because it has to account for the compressible nature.

05:36.840 --> 05:43.650
So we will be defining thermophysical properties uh, which will handle the compressibility.

05:43.680 --> 05:47.010
Otherwise, it is going to remain the same on most of the levels.

05:47.010 --> 05:53.460
Like, uh, do the mesh set up the boundary condition, initial condition, then run the simulation.

05:53.850 --> 05:59.820
Okay, so for multiphase, the multiphase solvers in Openfoam are used to simulate, uh, fluid flows

05:59.820 --> 06:01.800
involving more than one fluid.

06:01.800 --> 06:07.670
So whatever we have done till now is like one phase or, uh, one fluid.

06:07.670 --> 06:08.030
Right.

06:08.030 --> 06:14.330
So if we are working with two fluids, let's say water mixing with oil, and we want to see how fast

06:14.330 --> 06:17.510
the oil will, uh, rise over the water.

06:17.510 --> 06:25.520
So if you want to do such kind of multiphase things, then, uh, you can use openfoam multiphase solvers.

06:25.520 --> 06:30.500
These always are crucial for application in mostly chemical engineering, environmental engineering,

06:30.500 --> 06:36.760
and also fluid structure interactions, where we will be having like a flap of an airfoil and we want

06:36.760 --> 06:38.710
to see what it happens.

06:38.710 --> 06:43.180
If you want to work on fluid structure interaction, then you can use multiphase solvers.

06:44.380 --> 06:49.960
Uh, then the key multiphase solvers or inter form, this is the most widely used one.

06:49.960 --> 06:52.120
So it uses volume of fluid method.

06:52.330 --> 06:59.090
Uh you can recall it from your CFD theoretical course if you took multiphase, uh, subjects.

06:59.090 --> 07:04.850
So it will use volume of fluid, which is highly complicated, but you can set it up easily using Openfoam.

07:04.850 --> 07:11.780
It is ideal for simulating interface between two fluids and simulating the break of waves or dam breaks.

07:11.780 --> 07:14.780
It is popularly known as the flow in a mixing tank.

07:14.780 --> 07:20.910
If you have a very big tank with oil, and if you are pouring water into it and how it will react,

07:20.910 --> 07:22.830
if you want to see how the bubbles are formed.

07:22.830 --> 07:25.980
So those things can be done in the multiphase solver using interphone.

07:26.310 --> 07:28.080
We have multiphase interphone.

07:28.800 --> 07:31.950
So this is also the same as interphone.

07:32.070 --> 07:40.440
But again it has some uh, tweaks to the solver and how it is getting solved.

07:40.440 --> 07:42.540
So there is slight difference.

07:42.540 --> 07:44.970
If you want to know more you can check the documentations.

07:44.970 --> 07:48.600
Okay, because it is beyond the mathematics of the course.

07:48.600 --> 07:49.050
Okay.

07:49.830 --> 07:55.560
Uh, implementation steps will be mesh generation and we will be setting up the boundary condition initial

07:55.560 --> 07:56.910
condition phase fraction.

07:56.910 --> 08:02.550
Here it is an additional setting we have to set uh which area has what fluid initially.

08:02.550 --> 08:03.810
So we have to set that.

08:03.810 --> 08:08.900
And we will also be defining the thermophysical properties for each of the fluid, each of the phase.

08:09.860 --> 08:14.570
And we will do the control dict setup as usual and we will run the simulation.

08:14.810 --> 08:18.830
So now we are going to do a lid driven cavity case.

08:18.830 --> 08:23.210
So lid driven cavity flow is a classic benchmark problem in fluid mechanics.

08:23.210 --> 08:25.430
It involves a square cavity filled with fluid.

08:25.430 --> 08:28.700
Like how I explained already there is a big cavity.

08:28.700 --> 08:29.570
All our walls.

08:29.570 --> 08:31.040
There is a lid on top.

08:31.190 --> 08:34.960
We are trying to move the lid towards the right side at a constant speed.

08:34.990 --> 08:39.010
Now it is going to create a recirculation region.

08:39.010 --> 08:46.450
So this is used as a benchmark problem to see whether all the algorithm works in your, uh, solver

08:46.780 --> 08:52.780
is because it is having, uh, complex flow phenomena like boundary layer separation, vortex shedding.

08:53.020 --> 08:58.420
And there is also recirculation zones, mostly vortex shedding is not happening here because if you

08:58.420 --> 09:04.720
are working with alias then you might get small small vortex, but in most cases you are not going to

09:04.720 --> 09:05.440
get vortex shedding.

09:05.440 --> 09:10.000
In this it is mostly recirculation zones and we are going to check that.

09:10.690 --> 09:14.920
So it is a valuable test case for validating computational fluid dynamics codes.

09:15.280 --> 09:21.510
So the objective of this case study is that to understand the fundamentals of incompressible flow simulation

09:21.510 --> 09:27.030
using Openfoam, they are going to implement appropriate boundary condition for the lid driven cavity

09:27.030 --> 09:27.510
case.

09:27.510 --> 09:32.040
And we are going to analyze the flow characteristics such as velocity profile, pressure distribution

09:32.040 --> 09:33.480
and vorticity patterns.

09:34.350 --> 09:39.090
We are going to validate the simulation against established benchmarks or experimental data.

09:39.090 --> 09:40.890
But this is a homework for you.

09:40.890 --> 09:42.300
Like validating the case.

09:42.300 --> 09:48.480
I will tell you how to do the setup in Openfoam, and it's up to you to validate it and see how accurate

09:48.480 --> 09:49.020
it is.

09:50.190 --> 09:53.010
So the case setup is going to consider these steps.

09:53.010 --> 09:54.780
First we will prepare a geometry.

09:54.780 --> 09:56.220
It will be a square cavity.

09:56.220 --> 10:00.510
We have already seen how to generate this block mesh for this case.

10:00.990 --> 10:06.180
And in the flow regime we are going to do an incompressible flow with low to moderate Reynolds number.

10:06.450 --> 10:11.870
How we are going to set the Reynolds number is based on how fast we are moving the lid.

10:11.870 --> 10:12.320
Okay.

10:13.250 --> 10:18.020
And the boundary condition lid will have constant velocity boundary condition, which is no slip.

10:18.260 --> 10:20.900
And waltz is also going to contain no slip.

10:20.900 --> 10:28.910
So when I say lid is having no slip, I mean at the surface of the lid just next to the lid, it is

10:28.910 --> 10:34.760
going to have zero velocity, but as there is a shear, it is going to move with a constant velocity

10:34.760 --> 10:39.050
with respect to the rest of the fluid particles in with respect to the lead.

10:39.080 --> 10:46.520
The fluid particle just next to the lead is at zero position zero velocity, but with respect to rest

10:46.520 --> 10:49.160
of the fluids it is moving at a constant velocity.

10:49.220 --> 10:53.990
So that is the basic understanding here on setting up the boundary condition.

10:54.830 --> 10:59.770
So the simulation parameters are we are going to use block mesh to develop the structured mesh.

10:59.770 --> 11:02.290
Then this is a transient simulation.

11:02.290 --> 11:03.790
We are going to use Icofom.

11:03.790 --> 11:08.740
And the turbulence model is obviously laminar because it is icofom okay.

11:08.740 --> 11:13.030
If you want to look at what is the boundary condition, I have displayed it here.

11:13.030 --> 11:14.350
You can look at it.

11:14.350 --> 11:17.440
As you can see, the first is uh, velocity.

11:17.440 --> 11:19.960
You can recognize it by the dimensions.

11:19.960 --> 11:24.660
So the velocity of the moving wall is one meters per second towards x axis.

11:24.660 --> 11:28.890
For the pressure it is uh zero gradient and zero gradient.

11:29.490 --> 11:38.370
And for uh kinematic viscosity it is 0.01 and the S.I. unit only.

11:38.370 --> 11:41.940
And the application is I go from the start from a start time.

11:42.150 --> 11:43.530
So which is zero.

11:43.530 --> 11:45.840
And we are going to end at 0.05.

11:45.840 --> 11:48.360
And the delta t here is 0.005.

11:48.360 --> 11:54.720
Unless unlike what we did in the previous thing like 0.005 here it is much smaller.

11:54.720 --> 12:01.110
So after we set the boundary conditions then we are just going to analyze the velocity profile, pressure

12:01.110 --> 12:04.800
distribution, vorticity patterns and validation.

12:04.800 --> 12:06.480
So this validation is on you.

12:06.480 --> 12:07.740
This is like a homework.

12:07.740 --> 12:09.000
You have to do it.

12:09.420 --> 12:14.610
Uh we will be seeing how to post-process for velocity profile, pressure distribution and vorticity

12:14.610 --> 12:16.050
patterns using Paraview.

12:16.590 --> 12:17.970
Validation is up to you.

12:19.110 --> 12:22.620
So we will now run the simulation actually.

12:22.710 --> 12:23.160
Okay.

12:23.790 --> 12:27.420
This is the case of cavity case.

12:28.440 --> 12:28.980
Okay.

12:31.800 --> 12:35.630
And we have zero constant para performance system.

12:36.440 --> 12:38.000
So I will open it.

12:41.090 --> 12:41.720
Okay.

12:43.670 --> 12:47.360
So under zero we have velocity and pressure.

12:47.360 --> 12:52.850
So these are exactly same as what you saw in the presentation like these things.

12:52.850 --> 12:55.760
So I am not going to go over every one of them.

12:56.270 --> 12:58.840
Uh I'll show you transport properties.

12:58.840 --> 13:01.450
The new is 0.01.

13:02.020 --> 13:04.900
And in the system the block mesh is same.

13:05.020 --> 13:10.840
And the control dict, it is slightly going to be different, like it is starting from zero ending a

13:10.840 --> 13:11.680
0.05.

13:11.680 --> 13:12.160
That is same.

13:12.160 --> 13:15.100
But the delta t is 0.0005.

13:15.340 --> 13:18.610
And right interval is two for every two time steps.

13:18.640 --> 13:20.560
Or uh yeah, time steps.

13:20.560 --> 13:26.400
It is going to write one case file, which means 0.001.

13:26.400 --> 13:30.720
For every 0.001, there is going to be one case one.

13:30.930 --> 13:32.910
So now we can run it.

13:32.910 --> 13:39.330
To run it, all we have to do is do block, mesh and icofom.

13:40.200 --> 13:43.200
It is going to take only that much time.

13:43.200 --> 13:47.400
Now we can run it or no visualize it using Paraview.

13:47.430 --> 13:49.140
We got all the time steps.

13:49.410 --> 13:51.330
I'll go to paraview.

13:53.130 --> 13:54.150
Click on apply.

13:54.180 --> 13:57.420
Now you can see we have the pressure profile.

13:57.420 --> 13:59.280
I'll choose Velocity Profile.

13:59.340 --> 14:02.550
Now we are in the 0.001 time step to play.

14:02.550 --> 14:05.370
I can click on this and you can see how it is growing.

14:05.910 --> 14:10.980
So you get how it has converged right.

14:11.660 --> 14:12.320
Okay.

14:12.320 --> 14:13.010
To.

14:13.040 --> 14:14.690
This is the velocity profile.

14:14.960 --> 14:17.390
We got the pressure profile also.

14:17.390 --> 14:22.430
But how to plot streamlines to understand what is it we have to plot streamlines.

14:22.430 --> 14:22.760
Right.

14:22.760 --> 14:25.850
So to do that first we will do a slice.

14:25.910 --> 14:34.190
So to click on the slice and choose Z normal we will have this plane I usually remove show plane and

14:34.190 --> 14:35.060
click on apply.

14:35.390 --> 14:38.840
So on this slice you can choose velocity.

14:38.960 --> 14:40.580
We have the velocity profile.

14:40.580 --> 14:42.740
And you see this right.

14:42.740 --> 14:44.270
So it is a stream tracer.

14:44.510 --> 14:47.690
If you click on that it will plot from the minimum to maximum.

14:47.690 --> 14:48.890
Click on apply.

14:49.100 --> 14:50.840
And usually it is in pressure.

14:50.840 --> 14:52.400
So you can choose velocity.

14:53.360 --> 14:56.030
You can uh reduce the number of points.

14:56.060 --> 14:56.870
Now it is thousand.

14:56.870 --> 15:00.970
You can keep it around 500 or even less.

15:00.970 --> 15:02.800
I'll keep like 100.

15:03.280 --> 15:06.940
Now you can see how the velocity is in circulation region.

15:07.390 --> 15:15.730
That is one thing, but if you want to do the uh vectors also you can work with the glyphs.

15:15.730 --> 15:18.790
But that's not going to be very useful in this case.

15:18.790 --> 15:21.400
So I will keep it with streamlines.

15:21.520 --> 15:22.450
You want to hide this line.

15:22.450 --> 15:24.480
Just click on this and it will be done.

15:24.510 --> 15:26.430
You want to save this as animation?

15:26.430 --> 15:31.170
Click on File Save Animation and give some name.

15:31.170 --> 15:37.950
Let's say lid driven cavity such as mp4.

15:38.250 --> 15:41.040
Click on okay and you can choose the frame rate.

15:41.040 --> 15:45.390
Let's say I want to do ten frames which will be 0.1 second will be the one frame.

15:45.930 --> 15:46.590
Click on okay.

15:46.590 --> 15:48.180
Don't worry about this error.

15:48.180 --> 15:51.420
It always appears we have the file.

15:53.820 --> 15:56.010
So we have for the stream lines.

15:56.010 --> 16:02.340
Now if you do want to do just for the paraview, hide this, hide this.

16:02.340 --> 16:06.480
And again can't save animation.

16:06.480 --> 16:11.640
Now I'll do lid driven cavity velocity okay.

16:11.750 --> 16:14.780
Let's click on okay and click okay.

16:16.520 --> 16:18.410
Now we got the velocity.

16:18.440 --> 16:23.210
Now this will be much slower because I chose one frame per second.

16:24.590 --> 16:24.890
Yeah.

16:24.890 --> 16:27.320
So so you can actually play with this.

16:27.320 --> 16:29.660
And that is all about this tutorial.

16:31.010 --> 16:31.400
Okay.

16:33.560 --> 16:36.950
And the next week's homework task is go to this link.

16:36.950 --> 16:38.570
It will be available in resources.

16:38.570 --> 16:44.360
This is a tutorial I made for a mesh preparation using block mesh for backward facing step.

16:44.360 --> 16:46.610
So this will be used in our next class.

16:46.610 --> 16:50.360
So make sure you understand everything from this tutorial.

16:50.660 --> 16:52.040
Pause the video whenever you need.

16:52.040 --> 16:55.370
Do it hands on, do it parallelly and understand everything.

16:56.000 --> 16:58.520
If you have any questions, feel free to contact me.

16:58.520 --> 17:00.110
Thank you for watching this video.

17:00.110 --> 17:01.190
See you in the next class.
