WEBVTT

00:00.140 --> 00:01.070
Hello everyone.

00:01.070 --> 00:04.790
Welcome back to CFD using Openfoam beginner to intermediate course.

00:04.790 --> 00:07.850
So this is our last class which is class ten.

00:07.850 --> 00:13.520
In this video we will be seeing introduction to multiphase Flow simulations modeling approaches and

00:13.520 --> 00:15.080
practical considerations.

00:15.080 --> 00:21.230
The under demonstration which will be doing uh using multiphase Euler foam which is one of the most

00:21.230 --> 00:28.130
popular uh multiphase solver in Openfoam we will be doing something called a dam break case.

00:28.370 --> 00:33.380
Uh, usually it is done in two phase, but we are going to consider four phases and we are going to

00:33.380 --> 00:34.280
do in four phases.

00:35.120 --> 00:37.310
Introduction to multiphase flow simulation.

00:37.880 --> 00:43.760
Multiphase flow simulations involve the simultaneous flow of multiple phases, which can include combinations

00:43.760 --> 00:45.800
of gases, liquid, as well as solids.

00:45.830 --> 00:51.470
Sometimes these simulations are essential in various industries such as chemical processing, oil and

00:51.470 --> 00:54.260
gas, power generation, and environmental engineering.

00:54.290 --> 00:59.990
The complexity of multiphase flow arises from the interaction between different phases, which can involve

00:59.990 --> 01:02.030
mass, momentum, and energy transfer.

01:03.020 --> 01:05.870
So modeling approaches and practical considerations.

01:05.900 --> 01:09.560
Eulerian Euler models are one of the most followed one.

01:10.130 --> 01:13.400
Description of the Euler Euler model is.

01:13.400 --> 01:20.260
Both phases are treated as interpenetration continuum, which each face represents by its own set of

01:20.260 --> 01:21.700
conservation equations.

01:22.000 --> 01:28.120
Application is suitable for flows where the phases are intermingled, such as bubbly flows or fluidized

01:28.120 --> 01:28.630
beds.

01:28.840 --> 01:33.790
Example solver is multiphase Euler form, which is what we are going to see in this uh video.

01:35.170 --> 01:37.660
Then we have Euler and Lagrangian models.

01:37.660 --> 01:42.670
The continuous phase is treated as a continuum using the Euler approach while the dispersed phase,

01:42.670 --> 01:47.500
which can be like particles, droplets, bubbles, is tracked using the Lagrangian approach.

01:47.620 --> 01:54.340
This is computationally very expensive, ideal for dilute dispersed flows such as sprays and particulate

01:54.340 --> 01:54.940
flows.

01:54.940 --> 01:59.380
We also need a very fine mesh to do these kind of simulations.

01:59.410 --> 02:03.070
Example solver is DPM foam which is discrete phase model.

02:04.870 --> 02:07.030
Then we have the volume of fluid models.

02:07.030 --> 02:12.310
The interface between phases is tracked using a volume fraction function, which is advected with the

02:12.310 --> 02:16.690
flow effective for free surface flows such as waves or dam breaks.

02:16.720 --> 02:18.400
Example solver is interval.

02:19.630 --> 02:25.600
Then we have integer interface tracking methods also, which is explicit tracking of the interface between

02:25.600 --> 02:32.260
phases using methods like level set or print tracking suitable for detailed multi phase interface dynamic

02:32.260 --> 02:36.040
studies such as droplet coalescence or breakup reacting.

02:36.040 --> 02:42.880
Multiphase Euler foam for reactive multiphase flows is one of the example solvers, but this is very

02:42.880 --> 02:46.450
highly advanced and it's not very popular in industries either.

02:47.590 --> 02:54.490
So practical considerations while modeling a multiphase flow mesh quality ensure a fine and high quality

02:54.490 --> 02:58.510
mesh, especially near phase interface to capture detailed interactions.

02:58.510 --> 03:03.400
Then, about the time step, choose an appropriate time step to balance the accuracy and computational

03:03.400 --> 03:03.850
cost.

03:03.850 --> 03:09.790
Considering the Cuda number generally, we will keep the core number as one, but it would be better

03:09.790 --> 03:13.600
to keep even less than one around 0.8 or 0.75.

03:14.110 --> 03:20.560
But it also depends on physics and what kind of accuracy you are expecting Then, for the boundary condition,

03:20.560 --> 03:25.750
we have to carefully set the boundary condition to accurately represent physical phenomena at the boundary

03:25.750 --> 03:26.380
domains.

03:26.500 --> 03:31.750
For initial condition, proper initialization of the phase distribution can significantly impact the

03:31.750 --> 03:33.790
convergence and accuracy of the solution.

03:33.790 --> 03:41.290
Because we have to set the type of phases in every area of the mesh for the initial condition, which

03:41.290 --> 03:43.320
would be solved by the solver.

03:43.320 --> 03:46.260
For further changes in the flow domain.

03:47.280 --> 03:52.140
For face interaction model, we have to implement appropriate models for interface momentum, heat and

03:52.140 --> 03:52.830
mass transfer.

03:52.860 --> 03:58.980
Multiphase flows can also do uh, heat equation solving which will account for the temperature.

03:58.980 --> 04:05.970
But for this tutorial we will be using multiphase Euler form which doesn't need to, uh, solve the

04:05.970 --> 04:07.660
temperature equations.

04:07.660 --> 04:09.880
So we will not be seeing any temperature plot.

04:09.880 --> 04:15.940
But if you want to see temperatures, you can use, uh, solvers like two phase Euler form, which would,

04:16.390 --> 04:18.460
uh, consider temperature changes also.

04:18.910 --> 04:25.570
So now we will see the demonstration on using multiphase Euler form for a dam break case for four phase.

04:26.110 --> 04:26.470
Okay.

04:26.470 --> 04:31.230
Now the picture you are seeing is the old run file.

04:31.680 --> 04:37.080
So we have restored zero directory, which will copy the zero dot original and paste it into zero folder.

04:37.140 --> 04:39.780
Then we are going to run the application block mesh.

04:39.810 --> 04:42.240
Then we are going to do something called set fields.

04:42.240 --> 04:44.490
So this is new which I will explain.

04:45.150 --> 04:47.100
Then as usual we will decompose.

04:47.130 --> 04:52.230
Then run the application which in this case is multiphase Euler form and reconstruct the case.

04:53.100 --> 04:55.950
Now this is the mesh that we are going to use.

04:56.070 --> 04:58.230
Now we are seeing the internal mesh.

04:58.980 --> 05:06.150
So as you can see we have the left wall, lower wall, right wall, default faces, atmosphere wall

05:06.150 --> 05:07.080
and empty.

05:07.440 --> 05:13.950
As you can see, there is a big fluid domain and there is a small obstacle in between uh, in the lower

05:13.950 --> 05:14.520
place.

05:14.640 --> 05:20.070
So we will be having fluid all over here and we will release the fluid.

05:20.070 --> 05:23.760
So it will tend to move around here.

05:23.760 --> 05:29.460
And this obstacle will prevent that, prevent the flow or cause the flow disturbance.

05:29.460 --> 05:32.340
And we will see how the flow is propagating.

05:33.570 --> 05:37.230
So after setting the fields this is how it will look.

05:37.230 --> 05:39.630
So we have four phases here.

05:39.630 --> 05:42.090
One is air, one is water.

05:42.090 --> 05:44.970
Then we have oil and then mercury.

05:45.000 --> 05:48.120
So these are the four phases we are going to work with.

05:48.120 --> 05:53.160
So this can be obtained at the initial condition which will be inside zero folder.

05:53.160 --> 05:56.580
And we will see how to do it using the set fields dict.

05:57.750 --> 06:03.510
So if you want to see the final simulation video you can jump in here.

06:03.510 --> 06:05.520
Uh this is my YouTube channel.

06:05.520 --> 06:06.840
You can check it out.

06:07.370 --> 06:09.650
Okay, now we will run the simulations.

06:10.130 --> 06:12.950
I am in the working directory.

06:12.950 --> 06:13.340
Okay.

06:13.340 --> 06:17.870
Now, either we can initiate the all run or do it one by one.

06:17.870 --> 06:20.150
So I will do it manually.

06:20.150 --> 06:24.710
If you want to run the case, you can do it yourself.

06:26.330 --> 06:26.840
Okay.

06:26.840 --> 06:31.610
Now we have the 00. original uh, constant and system.

06:32.000 --> 06:35.510
Okay, now, as you know, the first command is block mesh.

06:35.810 --> 06:37.280
So I'll run block mesh.

06:37.280 --> 06:39.140
Then it is set fields.

06:39.140 --> 06:45.380
So before we do set fields, I will explain what set fields actually does and what that is about.

06:46.700 --> 06:49.640
Now we will just see the mesh which we have now.

06:57.950 --> 07:02.840
As you could recognize from the PPT, this is the mesh we have and this is the obstacle.

07:03.230 --> 07:08.390
We had the, uh, other three fluids here and the rest of the area where.

07:08.390 --> 07:09.380
Yeah, right.

07:09.380 --> 07:15.200
So I will keep everything at the zeroth time step.

07:15.740 --> 07:18.140
Now, we don't have any phases at all.

07:18.530 --> 07:18.950
Okay.

07:18.950 --> 07:21.740
So it will not have any faces.

07:24.050 --> 07:26.990
Okay, so now we are going to do something called the set fields.

07:27.170 --> 07:29.270
So what set fields does.

07:32.870 --> 07:37.610
Under set fields dict which is under system directory we have many functions.

07:37.610 --> 07:41.090
So first thing is we are going to set the default field values.

07:41.090 --> 07:44.660
So in any atmosphere all we have is here.

07:44.690 --> 07:46.610
That is the default field value.

07:46.610 --> 07:49.490
So we are setting alpha dot air as one.

07:50.030 --> 07:52.430
As alpha is the face fraction.

07:53.180 --> 07:58.970
And we are setting out for water as zero, alpha dot oil as zero and alpha dot mercury as zero, and

07:58.970 --> 08:04.190
initial vector field value, which is velocity will be 000 in all three directions.

08:04.520 --> 08:06.620
This is the default field values.

08:06.620 --> 08:09.370
Now we are going to set the regions and the region.

08:09.400 --> 08:13.270
We need three phases now because everything is already here.

08:13.480 --> 08:16.270
We are going to set three more fields.

08:17.170 --> 08:19.960
So the first field would be a box two cell.

08:19.960 --> 08:21.280
So that is the function.

08:21.280 --> 08:23.020
Then we have to define the box.

08:23.020 --> 08:27.430
So that box as you can see again it has a minimum point.

08:27.430 --> 08:31.930
And the maximum point just like what we did for snapping hex mesh.

08:32.080 --> 08:41.440
So we are going to do this which is zero zero, minus one two, 0.1461 to 0.29 1 to 1.

08:41.440 --> 08:46.390
So if you want to see what that actually means, you can turn on data access grid.

08:46.390 --> 08:51.850
And you can see we have zero zero uh 20.14.

08:53.110 --> 08:56.530
It is somewhere around here, the x direction, y direction.

08:56.530 --> 08:58.300
It is 0.292.

08:58.360 --> 09:00.400
So this is this region.

09:00.400 --> 09:02.500
So here we are setting one field.

09:02.800 --> 09:10.480
Then we are setting another field from this .0.14610 minus one to some point.

09:10.480 --> 09:14.710
You can ponder over what these points actually mean from the data access grid.

09:14.830 --> 09:16.990
I'm not going to exactly show those points.

09:16.990 --> 09:21.880
We are just having these points which you can download this case and take over it.

09:21.910 --> 09:30.100
So for the first box, we are setting it to alpha dot value of water as one and everything else as zero,

09:30.100 --> 09:36.070
which is oil, mercury and air will be zero for two phases cannot exist at the same place, so everything

09:36.070 --> 09:36.850
else must be zero.

09:37.240 --> 09:39.610
Then we have oil phase.

09:40.360 --> 09:41.110
This will be one.

09:41.110 --> 09:42.430
Everything else will be zero.

09:42.430 --> 09:45.640
Then we have mercury as one and everything else as zero.

09:45.730 --> 09:51.550
So we have set the entire domain into a four different phases.

09:51.550 --> 09:57.190
If you miss any point while doing this, that would be set to here.

09:57.190 --> 10:00.100
So that is the entire thing about setting default field values.

10:00.100 --> 10:02.710
Otherwise it would have pure mesh without any values at all.

10:03.190 --> 10:05.650
So how is it going to get saved?

10:05.890 --> 10:09.940
It is because we have these files apart from you.

10:10.480 --> 10:12.040
Uh, which we generally have.

10:12.040 --> 10:14.080
We also have something called p.

10:14.500 --> 10:17.740
Uh, underscore RG actually it means p minus RJ.

10:18.190 --> 10:22.150
As you can realize RG h is the hydrostatic forces.

10:22.150 --> 10:24.940
This is pressure minus the hydrostatic effects.

10:25.180 --> 10:27.520
That is what p minus rg h means.

10:27.520 --> 10:33.840
But since we can't use hyphen in a file name, we are using underscore.

10:34.830 --> 10:35.250
Okay.

10:35.250 --> 10:38.520
So this is basically pressure minus the hydrostatic forces.

10:38.640 --> 10:41.130
And we are defining it as flux pressure.

10:41.130 --> 10:43.050
And it is all set to zero.

10:43.500 --> 10:48.720
Now we have alpha alpha dot mercury alpha dot oil and alpha dot water.

10:48.750 --> 10:52.170
Similarly we also have the velocity for each phases.

10:52.170 --> 10:59.550
As I explained in the ppt for Euler Euler model we are solving the transport equation for every different

10:59.550 --> 11:03.360
phase separately, because everything has its density different.

11:04.290 --> 11:11.550
So I'll open the alphabet here, and you can see that the uniform field is initially set to zero and

11:11.550 --> 11:13.020
everything else is also set.

11:13.020 --> 11:18.600
So this can be set based on any templates which is already available.

11:18.600 --> 11:22.380
So we are doing this called theta properties.

11:22.380 --> 11:29.970
So this theta properties is the uh volume fraction or also known as the contact angle of the volume

11:29.970 --> 11:30.420
fraction.

11:30.420 --> 11:34.740
So when two phases are meeting it will have some angle.

11:34.740 --> 11:39.030
So that angle has to be defined so that it is resolved properly.

11:39.030 --> 11:42.600
And that alpha contact angle is called theta.

11:42.600 --> 11:45.810
So we are setting it to orthogonal which is 90 degree.

11:45.810 --> 11:48.300
So it will meet at the intersection of 90 degrees.

11:48.360 --> 11:50.670
We have to set it for every face.

11:51.510 --> 11:58.620
So when you see left wall that has water air as 90 oil, air as 90, mercury air as 90 and water oil

11:58.620 --> 12:01.470
as 90, water, Mercury as 90, oil, Mercury as 90.

12:01.470 --> 12:04.920
So we have to put in all the combination, all different possibilities.

12:05.280 --> 12:11.220
So after doing that, we will be setting the atmosphere as inlet outlet inlet value as one one.

12:11.220 --> 12:12.750
And we have this.

12:12.750 --> 12:18.180
So atmosphere here is just basic outlet condition on the top wall okay.

12:18.180 --> 12:25.560
Similarly we have for all the four files you can open and see it just in case I would open the port

12:25.560 --> 12:26.040
face alone.

12:27.780 --> 12:30.900
See we have everything else has normally.

12:30.900 --> 12:36.350
So we only set the alpha dot air because it is in the default, so we are setting it.

12:36.350 --> 12:43.940
Then this would correspond to other files while open alpha will see when this is a normal file.

12:43.940 --> 12:45.830
So only the default phase.

12:45.830 --> 12:49.760
We have to set all these uh contact angle at all okay.

12:49.760 --> 12:56.690
Now similarly we will be having just you which is the overall velocity thing okay.

12:56.690 --> 13:00.650
We are setting the walls as no slip and atmosphere is corrected.

13:00.650 --> 13:05.360
A flux corrected velocity is 000, which is a Neumann condition.

13:05.480 --> 13:10.280
Then we have the velocity of air, which is again a normal file.

13:10.430 --> 13:13.190
Then we have velocity of mercury.

13:13.190 --> 13:15.290
That is also a normal velocity file.

13:15.290 --> 13:17.600
So only the alpha dot air will be different.

13:18.080 --> 13:20.690
And p minus r is a new thing.

13:20.810 --> 13:27.140
So here apart from transport and turbulence properties and gravity, we also have something called motion

13:27.140 --> 13:31.250
properties where we are setting it as static of a mesh.

13:31.250 --> 13:37.160
But when you are going to advance level of openfoam, you can do, uh, adaptive refinement in the mesh.

13:37.160 --> 13:43.070
So that can be defined here instead of static, we will be using dynamic f v mesh which we are not going

13:43.070 --> 13:44.000
to cover in this course.

13:44.000 --> 13:47.060
So it is just going to be static f mesh in this case.

13:47.510 --> 13:50.060
Now we can see what other files we have.

13:50.090 --> 13:51.770
We have the control dict.

13:52.790 --> 13:56.240
So in control dict you can see the application is multiphase Euler form.

13:56.390 --> 14:01.190
And apart from maximum SEO we are also setting maximum alpha zero.

14:01.220 --> 14:05.900
So this is taking care of individual phase current number.

14:05.900 --> 14:07.640
So that is 0.5.

14:07.640 --> 14:14.630
As I said one is fine for most cases but for multi phase going less than one is preferable.

14:15.380 --> 14:20.750
Then we have delta t as 0.001 and we are ending at time six.

14:20.750 --> 14:25.730
So this simulation is going to take a lot of time to get run.

14:25.730 --> 14:30.830
So that is why I have pasted the YouTube link for the final simulation video.

14:31.280 --> 14:33.320
Uh, it is going to take hovers of your time.

14:33.440 --> 14:35.660
That is what multiphase does.

14:35.870 --> 14:38.270
Okay, now we will do the set fields.

14:38.270 --> 14:40.640
Now, as you see at the time zero.

14:40.640 --> 14:42.890
We don't have any phases at all.

14:43.100 --> 14:43.580
Okay.

14:44.360 --> 14:52.460
Uh, yeah I'll go to time zero so you can see we can see Alpha dot water is also completely zero.

14:52.460 --> 14:55.130
Alpha dot air is also completely zero.

14:57.530 --> 15:02.260
And if we see velocity it is also completely zero because we have set everything to zero.

15:02.260 --> 15:04.030
So it's no surprise.

15:04.330 --> 15:07.180
Now what I will do is I will do.

15:07.180 --> 15:08.710
Set fails.

15:09.610 --> 15:11.890
Now the set fails has been done.

15:11.920 --> 15:14.140
Now I will refresh this case.

15:15.130 --> 15:19.330
Now you can see we have something called uh, I forgot.

15:19.330 --> 15:21.730
Here you can see the alpha dot here.

15:22.030 --> 15:26.350
Here one is the maximum value and blue is zero.

15:26.350 --> 15:28.660
So everything else is here.

15:28.840 --> 15:29.470
These are.

15:29.470 --> 15:33.430
This is the place where we have other three, three, three phases.

15:33.430 --> 15:35.980
So the mercury is just this place.

15:36.880 --> 15:41.020
Oil has this area and water has this area.

15:41.020 --> 15:45.310
So apart from whatever these three it everything else is here okay.

15:45.310 --> 15:53.620
So to see all the four phases in the same map, we will, uh, be able to do it only when we run the

15:53.620 --> 15:54.100
simulation.

15:54.100 --> 15:55.000
Otherwise we can't.

15:55.000 --> 16:00.910
So you can see that every phase has mostly zero velocity.

16:00.910 --> 16:02.080
Only initially.

16:02.080 --> 16:05.830
Okay, now we can run the case by decomposing.

16:05.830 --> 16:13.210
So decompose power is, uh, a regular decompose case which we set in previous simulations Also, I'm

16:13.210 --> 16:22.300
going to run Mpirun NP eight multiphase Euler form okay.

16:25.870 --> 16:33.100
So it has started and it is running now we have around uh, ten time steps, including the zero.

16:33.100 --> 16:34.570
While running the command.

16:34.570 --> 16:40.630
I missed the hyphen parallel at the end, so if you followed the video, just make sure that you are

16:40.630 --> 16:42.820
typing the hyphen parallel also.

16:43.720 --> 16:47.980
I stopped the simulation, run it, and reconstructed and deleted all the processor files.

16:48.790 --> 16:51.730
Okay, now I'll go here to the Paraview.

16:51.730 --> 16:53.200
I'll refresh the case.

16:53.770 --> 16:56.710
Now I'll go to the last time step.

16:56.980 --> 16:58.510
I'll choose alphas.

16:58.540 --> 16:58.990
Okay.

16:59.470 --> 16:59.650
Okay.

16:59.650 --> 17:07.060
Now you can see that we have, uh, the animation, like, sort of animation.

17:07.060 --> 17:07.840
It is moving.

17:07.840 --> 17:12.460
So when you run the entire simulation, it would look something like this.

17:12.640 --> 17:14.530
So this is the render video.

17:14.560 --> 17:17.680
You can check out that link now I will play it for you.

17:21.460 --> 17:25.770
As you can see it predicts all the bubbles.

17:25.770 --> 17:27.120
It releases air.

17:27.150 --> 17:28.590
It accounts for density.

17:28.620 --> 17:30.630
It accounts for the waviness.

17:30.630 --> 17:34.110
So when you are seeing it, it feels realistic.

17:34.110 --> 17:41.490
So that is what we can achieve by having a good mesh and good time step by maintaining the current number.

17:41.760 --> 17:44.910
So I hope you learned a lot in this course.

17:45.600 --> 17:52.170
If you have any specific doubts regarding the contents in this course, you can always contact me.

17:54.810 --> 17:56.400
Thank you for taking up this course.

17:56.400 --> 18:02.760
Look up for advanced level of courses regarding Openfoam by Code dynamics.

18:03.330 --> 18:09.480
Also, check out our YouTube channel regularly for more information on using Openfoam and specific features

18:09.480 --> 18:10.440
inside Openfoam.

18:10.950 --> 18:11.730
Thank you.

18:11.730 --> 18:12.840
See you in another course!
