Hello everyone.
Welcome back to CFD using Openfoam beginner to intermediate course.
So this is our last class which is class ten.
In this video we will be seeing introduction to multiphase Flow simulations modeling approaches and
practical considerations.
The under demonstration which will be doing uh using multiphase Euler foam which is one of the most
popular uh multiphase solver in Openfoam we will be doing something called a dam break case.
Uh, usually it is done in two phase, but we are going to consider four phases and we are going to
do in four phases.
Introduction to multiphase flow simulation.
Multiphase flow simulations involve the simultaneous flow of multiple phases, which can include combinations
of gases, liquid, as well as solids.
Sometimes these simulations are essential in various industries such as chemical processing, oil and
gas, power generation, and environmental engineering.
The complexity of multiphase flow arises from the interaction between different phases, which can involve
mass, momentum, and energy transfer.
So modeling approaches and practical considerations.
Eulerian Euler models are one of the most followed one.
Description of the Euler Euler model is.
Both phases are treated as interpenetration continuum, which each face represents by its own set of
conservation equations.
Application is suitable for flows where the phases are intermingled, such as bubbly flows or fluidized
beds.
Example solver is multiphase Euler form, which is what we are going to see in this uh video.
Then we have Euler and Lagrangian models.
The continuous phase is treated as a continuum using the Euler approach while the dispersed phase,
which can be like particles, droplets, bubbles, is tracked using the Lagrangian approach.
This is computationally very expensive, ideal for dilute dispersed flows such as sprays and particulate
flows.
We also need a very fine mesh to do these kind of simulations.
Example solver is DPM foam which is discrete phase model.
Then we have the volume of fluid models.
The interface between phases is tracked using a volume fraction function, which is advected with the
flow effective for free surface flows such as waves or dam breaks.
Example solver is interval.
Then we have integer interface tracking methods also, which is explicit tracking of the interface between
phases using methods like level set or print tracking suitable for detailed multi phase interface dynamic
studies such as droplet coalescence or breakup reacting.
Multiphase Euler foam for reactive multiphase flows is one of the example solvers, but this is very
highly advanced and it's not very popular in industries either.
So practical considerations while modeling a multiphase flow mesh quality ensure a fine and high quality
mesh, especially near phase interface to capture detailed interactions.
Then, about the time step, choose an appropriate time step to balance the accuracy and computational
cost.
Considering the Cuda number generally, we will keep the core number as one, but it would be better
to keep even less than one around 0.8 or 0.75.
But it also depends on physics and what kind of accuracy you are expecting Then, for the boundary condition,
we have to carefully set the boundary condition to accurately represent physical phenomena at the boundary
domains.
For initial condition, proper initialization of the phase distribution can significantly impact the
convergence and accuracy of the solution.
Because we have to set the type of phases in every area of the mesh for the initial condition, which
would be solved by the solver.
For further changes in the flow domain.
For face interaction model, we have to implement appropriate models for interface momentum, heat and
mass transfer.
Multiphase flows can also do uh, heat equation solving which will account for the temperature.
But for this tutorial we will be using multiphase Euler form which doesn't need to, uh, solve the
temperature equations.
So we will not be seeing any temperature plot.
But if you want to see temperatures, you can use, uh, solvers like two phase Euler form, which would,
uh, consider temperature changes also.
So now we will see the demonstration on using multiphase Euler form for a dam break case for four phase.
Okay.
Now the picture you are seeing is the old run file.
So we have restored zero directory, which will copy the zero dot original and paste it into zero folder.
Then we are going to run the application block mesh.
Then we are going to do something called set fields.
So this is new which I will explain.
Then as usual we will decompose.
Then run the application which in this case is multiphase Euler form and reconstruct the case.
Now this is the mesh that we are going to use.
Now we are seeing the internal mesh.
So as you can see we have the left wall, lower wall, right wall, default faces, atmosphere wall
and empty.
As you can see, there is a big fluid domain and there is a small obstacle in between uh, in the lower
place.
So we will be having fluid all over here and we will release the fluid.
So it will tend to move around here.
And this obstacle will prevent that, prevent the flow or cause the flow disturbance.
And we will see how the flow is propagating.
So after setting the fields this is how it will look.
So we have four phases here.
One is air, one is water.
Then we have oil and then mercury.
So these are the four phases we are going to work with.
So this can be obtained at the initial condition which will be inside zero folder.
And we will see how to do it using the set fields dict.
So if you want to see the final simulation video you can jump in here.
Uh this is my YouTube channel.
You can check it out.
Okay, now we will run the simulations.
I am in the working directory.
Okay.
Now, either we can initiate the all run or do it one by one.
So I will do it manually.
If you want to run the case, you can do it yourself.
Okay.
Now we have the 00. original uh, constant and system.
Okay, now, as you know, the first command is block mesh.
So I'll run block mesh.
Then it is set fields.
So before we do set fields, I will explain what set fields actually does and what that is about.
Now we will just see the mesh which we have now.
As you could recognize from the PPT, this is the mesh we have and this is the obstacle.
We had the, uh, other three fluids here and the rest of the area where.
Yeah, right.
So I will keep everything at the zeroth time step.
Now, we don't have any phases at all.
Okay.
So it will not have any faces.
Okay, so now we are going to do something called the set fields.
So what set fields does.
Under set fields dict which is under system directory we have many functions.
So first thing is we are going to set the default field values.
So in any atmosphere all we have is here.
That is the default field value.
So we are setting alpha dot air as one.
As alpha is the face fraction.
And we are setting out for water as zero, alpha dot oil as zero and alpha dot mercury as zero, and
initial vector field value, which is velocity will be 000 in all three directions.
This is the default field values.
Now we are going to set the regions and the region.
We need three phases now because everything is already here.
We are going to set three more fields.
So the first field would be a box two cell.
So that is the function.
Then we have to define the box.
So that box as you can see again it has a minimum point.
And the maximum point just like what we did for snapping hex mesh.
So we are going to do this which is zero zero, minus one two, 0.1461 to 0.29 1 to 1.
So if you want to see what that actually means, you can turn on data access grid.
And you can see we have zero zero uh 20.14.
It is somewhere around here, the x direction, y direction.
It is 0.292.
So this is this region.
So here we are setting one field.
Then we are setting another field from this .0.14610 minus one to some point.
You can ponder over what these points actually mean from the data access grid.
I'm not going to exactly show those points.
We are just having these points which you can download this case and take over it.
So for the first box, we are setting it to alpha dot value of water as one and everything else as zero,
which is oil, mercury and air will be zero for two phases cannot exist at the same place, so everything
else must be zero.
Then we have oil phase.
This will be one.
Everything else will be zero.
Then we have mercury as one and everything else as zero.
So we have set the entire domain into a four different phases.
If you miss any point while doing this, that would be set to here.
So that is the entire thing about setting default field values.
Otherwise it would have pure mesh without any values at all.
So how is it going to get saved?
It is because we have these files apart from you.
Uh, which we generally have.
We also have something called p.
Uh, underscore RG actually it means p minus RJ.
As you can realize RG h is the hydrostatic forces.
This is pressure minus the hydrostatic effects.
That is what p minus rg h means.
But since we can't use hyphen in a file name, we are using underscore.
Okay.
So this is basically pressure minus the hydrostatic forces.
And we are defining it as flux pressure.
And it is all set to zero.
Now we have alpha alpha dot mercury alpha dot oil and alpha dot water.
Similarly we also have the velocity for each phases.
As I explained in the ppt for Euler Euler model we are solving the transport equation for every different
phase separately, because everything has its density different.
So I'll open the alphabet here, and you can see that the uniform field is initially set to zero and
everything else is also set.
So this can be set based on any templates which is already available.
So we are doing this called theta properties.
So this theta properties is the uh volume fraction or also known as the contact angle of the volume
fraction.
So when two phases are meeting it will have some angle.
So that angle has to be defined so that it is resolved properly.
And that alpha contact angle is called theta.
So we are setting it to orthogonal which is 90 degree.
So it will meet at the intersection of 90 degrees.
We have to set it for every face.
So when you see left wall that has water air as 90 oil, air as 90, mercury air as 90 and water oil
as 90, water, Mercury as 90, oil, Mercury as 90.
So we have to put in all the combination, all different possibilities.
So after doing that, we will be setting the atmosphere as inlet outlet inlet value as one one.
And we have this.
So atmosphere here is just basic outlet condition on the top wall okay.
Similarly we have for all the four files you can open and see it just in case I would open the port
face alone.
See we have everything else has normally.
So we only set the alpha dot air because it is in the default, so we are setting it.
Then this would correspond to other files while open alpha will see when this is a normal file.
So only the default phase.
We have to set all these uh contact angle at all okay.
Now similarly we will be having just you which is the overall velocity thing okay.
We are setting the walls as no slip and atmosphere is corrected.
A flux corrected velocity is 000, which is a Neumann condition.
Then we have the velocity of air, which is again a normal file.
Then we have velocity of mercury.
That is also a normal velocity file.
So only the alpha dot air will be different.
And p minus r is a new thing.
So here apart from transport and turbulence properties and gravity, we also have something called motion
properties where we are setting it as static of a mesh.
But when you are going to advance level of openfoam, you can do, uh, adaptive refinement in the mesh.
So that can be defined here instead of static, we will be using dynamic f v mesh which we are not going
to cover in this course.
So it is just going to be static f mesh in this case.
Now we can see what other files we have.
We have the control dict.
So in control dict you can see the application is multiphase Euler form.
And apart from maximum SEO we are also setting maximum alpha zero.
So this is taking care of individual phase current number.
So that is 0.5.
As I said one is fine for most cases but for multi phase going less than one is preferable.
Then we have delta t as 0.001 and we are ending at time six.
So this simulation is going to take a lot of time to get run.
So that is why I have pasted the YouTube link for the final simulation video.
Uh, it is going to take hovers of your time.
That is what multiphase does.
Okay, now we will do the set fields.
Now, as you see at the time zero.
We don't have any phases at all.
Okay.
Uh, yeah I'll go to time zero so you can see we can see Alpha dot water is also completely zero.
Alpha dot air is also completely zero.
And if we see velocity it is also completely zero because we have set everything to zero.
So it's no surprise.
Now what I will do is I will do.
Set fails.
Now the set fails has been done.
Now I will refresh this case.
Now you can see we have something called uh, I forgot.
Here you can see the alpha dot here.
Here one is the maximum value and blue is zero.
So everything else is here.
These are.
This is the place where we have other three, three, three phases.
So the mercury is just this place.
Oil has this area and water has this area.
So apart from whatever these three it everything else is here okay.
So to see all the four phases in the same map, we will, uh, be able to do it only when we run the
simulation.
Otherwise we can't.
So you can see that every phase has mostly zero velocity.
Only initially.
Okay, now we can run the case by decomposing.
So decompose power is, uh, a regular decompose case which we set in previous simulations Also, I'm
going to run Mpirun NP eight multiphase Euler form okay.
So it has started and it is running now we have around uh, ten time steps, including the zero.
While running the command.
I missed the hyphen parallel at the end, so if you followed the video, just make sure that you are
typing the hyphen parallel also.
I stopped the simulation, run it, and reconstructed and deleted all the processor files.
Okay, now I'll go here to the Paraview.
I'll refresh the case.
Now I'll go to the last time step.
I'll choose alphas.
Okay.
Now you can see that we have, uh, the animation, like, sort of animation.
It is moving.
So when you run the entire simulation, it would look something like this.
So this is the render video.
You can check out that link now I will play it for you.
As you can see it predicts all the bubbles.
It releases air.
It accounts for density.
It accounts for the waviness.
So when you are seeing it, it feels realistic.
So that is what we can achieve by having a good mesh and good time step by maintaining the current number.
So I hope you learned a lot in this course.
If you have any specific doubts regarding the contents in this course, you can always contact me.
Thank you for taking up this course.
Look up for advanced level of courses regarding Openfoam by Code dynamics.
Also, check out our YouTube channel regularly for more information on using Openfoam and specific features
inside Openfoam.
Thank you.
See you in another course!