WEBVTT

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

00:01.130 --> 00:04.910
Welcome back to the CFD using Openfoam course beginners to intermediate.

00:05.510 --> 00:07.100
This is the third class.

00:07.100 --> 00:13.430
In this class, we'll be seeing how to use Block mesh tool to generate further complicated mesh using

00:13.430 --> 00:15.380
another tool called Snappy Hex Mesh.

00:16.190 --> 00:18.680
So snappy hex mesh is dependent on block mesh.

00:19.220 --> 00:26.030
So we have to use block mesh in certain way to use it for snappy x mesh that we will be looking, and

00:26.030 --> 00:32.230
how to set up a snappy hex mesh and what actually snappy hex mesh is, and how to create complex meshes

00:32.230 --> 00:33.430
using snappy hex mesh.

00:33.430 --> 00:37.780
Then we will look at a command called check mesh to check the quality of our mesh.

00:38.830 --> 00:45.970
Okay, so the block mesh is used to create the background mesh in case of uh, snappy hex mesh.

00:45.970 --> 00:47.500
So what is background mesh?

00:47.500 --> 00:48.220
We will look that.

00:48.220 --> 00:55.620
So the mesh must consist purely of hexes like we should have a pure cube or pure cuboid, just like

00:55.620 --> 00:58.800
how we created the rectangular cavity in the previous tutorial.

00:59.460 --> 01:02.550
So the cell aspect ratio should be approximately one.

01:02.550 --> 01:03.840
That is the ideal condition.

01:03.840 --> 01:10.320
So it is good to maintain that and at least near the surfaces at which the subsequent snapping procedure

01:10.320 --> 01:14.790
is applied, which if you did not understand now, you will understand later.

01:14.790 --> 01:21.270
But if you are good with meshing in general, you will understand what snapping is so near the areas

01:21.270 --> 01:23.220
where there will be snapping towards the surface.

01:23.220 --> 01:29.070
We have to keep the cell aspect ratio as one and towards the convergence of the snapping.

01:29.070 --> 01:35.880
If the procedure is slow, it could lead to the possibility of failure and we are not wanting to do

01:35.880 --> 01:36.180
that.

01:36.180 --> 01:42.340
So we have to make sure that the aspect ratio is one and there must be at least one interaction, sorry,

01:42.340 --> 01:48.040
intersection of a cell edge with the cell surface that is, a mesh of one cell will not work.

01:48.040 --> 01:53.290
So it has to intersect with some cell edges with the cell surface.

01:53.290 --> 02:00.010
If everything till now goes through your head, don't worry, you will understand right when we get

02:00.010 --> 02:01.870
into the presentation.

02:02.350 --> 02:06.540
Okay, now let's assume that we have an STL surface okay.

02:06.540 --> 02:07.920
This car is the STL.

02:07.920 --> 02:11.250
We are interested in simulating flow over a car.

02:12.090 --> 02:12.510
Okay.

02:12.510 --> 02:17.010
Now the gray area is your fluid domain and we have the STL surface okay.

02:17.010 --> 02:19.470
STL is basically surface geometry.

02:19.470 --> 02:20.490
So we have it.

02:20.490 --> 02:25.380
We are interested in mesh in the gray area, not the white area because we are interested in flow over

02:25.380 --> 02:25.800
the car.

02:26.520 --> 02:32.420
Okay, now the block mesh will act as the background mesh which will create the the outer box.

02:32.420 --> 02:34.250
Like you see this black box.

02:34.910 --> 02:39.080
The black mesh will create these blocks and it will have some subdivisions over there.

02:40.010 --> 02:44.240
It also contains the boundary patch such as inlet, outlet and walls.

02:44.240 --> 02:48.290
Let's say that this patch has to be inlet and this has to be outlet.

02:48.290 --> 02:50.690
Then we will define that in the block mesh itself.

02:50.690 --> 02:55.840
We are not going to do using snap hex mesh, because snap hex mesh is going to deal only with the surface.

02:56.500 --> 03:01.030
Okay, then the block mesh will enclose the entire STL and can act as the fluid domain.

03:01.030 --> 03:04.450
If the mesh is required around the model and inside the block mesh.

03:04.480 --> 03:11.680
So what this means is that now we have created this black box is generated enclosing the STL surface.

03:11.680 --> 03:19.460
So this block mesh has created a fluid domain which is the gray area which encloses the surface.

03:19.460 --> 03:21.440
So this grey area is the fluid domain.

03:22.160 --> 03:29.060
And this is essential only if we want to make a mesh which is outside the surface.

03:29.060 --> 03:34.790
But if this is this surface is like a pipe, then it does not have to be this big.

03:34.790 --> 03:38.600
It can just enclose the pipe and we can generate the mesh inside the pipe.

03:38.600 --> 03:42.520
Then the SDL will act as the enclosure, not the block mesh.

03:42.550 --> 03:49.810
Okay, so only when the, uh, mesh is, uh, required outside the surface, then we need block mesh

03:49.810 --> 03:52.990
bigger than the STL and it will act as the fluid domain.

03:52.990 --> 03:55.180
You will understand it when we actually do it.

03:56.140 --> 04:01.480
Okay, then the purpose of Snappy Mesh is that it is advanced mesh generation tool for very complex

04:01.480 --> 04:03.430
geometry like this aircraft.

04:03.550 --> 04:09.390
So this is generated by, uh, fuzzy Lab, which is at IIT Bombay.

04:09.900 --> 04:11.100
I used to work there.

04:11.100 --> 04:19.710
So one of the, uh, research researchers generated this mesh for the Sukhoi 30 MKI Mach one aircraft.

04:19.710 --> 04:24.840
So we were interested in simulating flow over the aircraft.

04:24.840 --> 04:26.820
So this is just the surface mesh?

04:26.820 --> 04:31.280
Actually, the mesh lies, uh, in the fluid domain, but we can view the surface mesh.

04:31.580 --> 04:32.780
Okay, that's what this image is.

04:32.780 --> 04:37.250
The point is, we can generate mesh for highly complicated surfaces, too.

04:37.280 --> 04:39.320
That's what I wanted to say.

04:39.320 --> 04:43.190
And the capabilities is it can handle complex geometries.

04:43.310 --> 04:48.860
It can handle refinement features like if you want to refine just one region, you can't do that.

04:48.860 --> 04:52.580
And mesh quality improvement can be done through an iterative process.

04:53.660 --> 04:56.270
Snappy workflow is like follows.

04:56.270 --> 05:01.970
First, we will be importing the STL file into a folder called Try surface, which will reside under

05:01.970 --> 05:06.110
constant directory like how we have Polymesh adjacent to Polymesh.

05:06.110 --> 05:10.610
We will create a new folder called try surface and put the necessary STL file inside that.

05:10.610 --> 05:17.150
Then we will be extracting the surface feature using a feature called Surface Feature Extract or surface

05:17.150 --> 05:23.070
feature extract is the command to extract the surfaces from the STL and save it into dot e mesh file,

05:23.070 --> 05:24.870
which is openfoam understandable.

05:25.020 --> 05:27.450
Then we will create a castellated mesh.

05:27.450 --> 05:32.970
If you are good with meshing and the techniques used in it, you will understand what castellated mesh

05:32.970 --> 05:39.780
is and we, the snap mesh will initially create a castellated mesh using snapping and refinement.

05:39.780 --> 05:45.080
Then it will adjust the mesh to conform the surface geometry through further snapping.

05:45.080 --> 05:50.390
And then if you want layer additions like boundary layers, five layers or six layers through layer

05:50.390 --> 05:54.380
thickness for wireless, then you can add layers also.

05:54.380 --> 05:56.420
So that can also be done in snaps mesh.

05:56.780 --> 06:00.020
So now we will see how actually snap mesh works.

06:00.020 --> 06:03.860
Now the blocks which you are seeing is generated by the block mesh.

06:03.890 --> 06:05.450
That is the background mesh.

06:05.450 --> 06:10.300
Then we have the car which is overlapping with the mesh, but we are interested in mesh outside the

06:10.300 --> 06:11.290
car, not inside it.

06:11.290 --> 06:11.650
Right.

06:11.650 --> 06:14.500
So this is the first scenario where we have the setup.

06:14.770 --> 06:16.870
We have a block mesh and we have an STL file.

06:17.920 --> 06:25.060
Then the snap mesh process will start to split the cells near the surface.

06:25.060 --> 06:25.330
Okay.

06:25.330 --> 06:28.300
The feature edge is what we say for the surface.

06:28.300 --> 06:36.180
So wherever there is a feature edge the snappy mesh solve, uh, algorithm will split the cells to refine

06:36.180 --> 06:39.030
it so that we can capture it accurately.

06:39.030 --> 06:41.460
It will do for all the feature edges.

06:41.460 --> 06:43.740
So it will look something like this.

06:43.740 --> 06:44.100
Okay.

06:44.100 --> 06:49.890
It has, uh, divided the blocks into smaller blocks to capture the features.

06:50.730 --> 06:55.610
Then it will remove whatever is residing inside the cell SDL surface.

06:55.610 --> 06:57.080
We are not interested in that right?

06:57.080 --> 07:03.170
We are interested only in the mesh outside it, so it will remove or delete all the cells inside the,

07:03.500 --> 07:05.090
uh, SDL surface.

07:05.240 --> 07:08.540
Then it will start snapping to surfaces.

07:08.540 --> 07:10.340
As you can see, this is not very good.

07:10.340 --> 07:14.630
The car wheel is circular, but we are getting mesh inside also, and it's not very nice.

07:14.630 --> 07:22.660
So the process of snapping will start and it will confirm the mesh and it will snap to the surface,

07:22.660 --> 07:26.470
and it will not have anything outside or inside the surface.

07:26.470 --> 07:28.300
So it will be on the surface.

07:28.300 --> 07:29.020
Exactly.

07:29.020 --> 07:31.510
So this is what snapping does.

07:31.810 --> 07:33.040
Uh, snapping does.

07:33.040 --> 07:38.890
And we will start adding mesh layers wherever it is necessary so we can control the mesh layer where

07:38.890 --> 07:39.820
it is necessary.

07:39.820 --> 07:40.750
We can do that.

07:41.560 --> 07:45.720
So this is the entire process of how snappy hex mesh works.

07:45.750 --> 07:52.320
Now, for example, we will mesh a simple cylindrical pipe using a pipe geometry pipe.

07:52.320 --> 07:52.980
Dostal.

07:52.980 --> 07:57.240
You will have the STL file already in the resources so you can download and use it.

07:57.240 --> 08:03.630
So first we will set up the file called surface feature extracted, because that is what is going to

08:04.050 --> 08:09.450
extract the feature from STL and put it into r dot m s e mesh.

08:09.540 --> 08:11.790
That's what Openfoam can understand.

08:12.780 --> 08:13.080
Okay.

08:13.080 --> 08:15.750
This is how the surface feature extract dict looks.

08:15.750 --> 08:19.920
So I will open the file itself so you can understand it better.

08:19.920 --> 08:22.680
Now I am in the terminal.

08:23.190 --> 08:26.370
I will go to the class three.

08:26.670 --> 08:30.390
We have the pipe external folder as the first tutorial.

08:30.600 --> 08:32.380
So I will enter that.

08:32.410 --> 08:36.130
Okay, we have constant perform and system.

08:36.130 --> 08:37.480
We are not going to set up the case.

08:37.480 --> 08:45.700
Run it so we don't have the zero file now okay now I will first run the block mesh okay.

08:45.700 --> 08:46.750
We have the block mesh.

08:46.870 --> 08:49.060
Now to open this exact location.

08:49.180 --> 08:53.740
We can do this command explorer dot x space dot and hit enter.

08:54.310 --> 08:55.990
It will open the exact location.

08:56.000 --> 08:58.640
you can see C3 Won by Paxton.

08:59.090 --> 09:02.600
I'll open the parameter file to view the mesh generated by block mesh.

09:04.250 --> 09:06.830
Yeah, this is the mesh we have.

09:06.860 --> 09:07.400
Okay.

09:08.720 --> 09:11.660
This will act as the background mesh.

09:12.170 --> 09:17.690
Now what we are going to do is we are going to mesh up pipe.

09:17.780 --> 09:26.800
As I said under uh, constant folder, we have tri surface and we have pipe dot STL.

09:26.980 --> 09:29.890
I'll click on okay and apply.

09:30.700 --> 09:33.760
Now you can see this is the pipe we are going to work with.

09:34.570 --> 09:37.210
I will put it in wireframe so you can see it better.

09:37.240 --> 09:40.090
So this is the background mesh and this is the pipe.

09:40.090 --> 09:42.310
Now we are interested in meshing around the pipe.

09:43.150 --> 09:44.760
Please don't ask me why we are doing it.

09:44.760 --> 09:46.860
We are just doing it for learning purpose.

09:47.460 --> 09:49.860
So we are not going to run any simulation.

09:49.860 --> 09:52.260
We are going to mesh around the pipe.

09:52.560 --> 10:00.090
Okay, so by the block mesh we have inlet outlet upper and lower.

10:00.720 --> 10:02.760
And we also have front and back.

10:04.200 --> 10:06.030
This is what we have okay.

10:06.240 --> 10:09.110
And I will close this.

10:09.950 --> 10:12.320
I will go system under this.

10:12.320 --> 10:16.760
We will be able to find the surface feature, extract it I will open that.

10:18.440 --> 10:21.320
So you can see that we have sourced pipes.

10:21.560 --> 10:24.200
So what is the location by the way.

10:24.200 --> 10:25.820
You will not have this file when you get it.

10:25.820 --> 10:29.090
So you will just have polymesh and tri surface.

10:29.090 --> 10:35.980
The Polymesh will contain the mesh from block mesh and this dry surface will have only dot STL.

10:36.010 --> 10:41.650
Okay, so we have this STL which we created using any CAD software I created using FreeCAD.

10:41.680 --> 10:44.770
I have put it here so you will get it through the resources.

10:45.010 --> 10:46.780
So it is inside dry surface.

10:46.780 --> 10:49.210
And notice that's is capital.

10:49.630 --> 10:54.460
Okay now we are sourcing that name pipe dot STL.

10:54.520 --> 10:57.340
The extraction method is always extract from surface.

10:57.340 --> 10:58.750
This include angle.

10:58.750 --> 11:00.280
We are setting it to 150.

11:00.280 --> 11:05.140
If it is zero it will select no h and if it is 180 it will select all h.

11:05.140 --> 11:07.570
So h is basically triangulated surface.

11:07.570 --> 11:09.130
So it also has edges.

11:09.970 --> 11:13.810
And uh we are giving 150 to be okayish.

11:13.810 --> 11:15.670
It will select everything in a cylinder.

11:15.670 --> 11:21.830
For highly complex surface we might need 180 degrees and subset of features.

11:21.830 --> 11:26.120
We will set non-manifold edges as no and open edges as yes.

11:26.120 --> 11:29.000
It is always safe to keep it in this setting.

11:29.000 --> 11:33.890
If you want to know more about this, you can read the documentation and you can explore.

11:34.430 --> 11:41.120
Nothing wrong, but I always like to keep my non-manifold edges as no and open edges as yes.

11:41.360 --> 11:44.150
And you have to set right obj as yes.

11:44.150 --> 11:45.790
Okay, I will save this file.

11:46.450 --> 11:57.970
And the next command which we have to do is extract sorry surface feature extract.

11:58.090 --> 12:02.650
Notice that every other word has the first letter as capital I'll hit enter.

12:03.100 --> 12:06.430
You should be seeing end without any error or warning.

12:06.940 --> 12:12.960
Now what this will do is it will create this folder called Extended Feature Edge Mesh.

12:12.960 --> 12:15.390
And it has written all these files.

12:15.390 --> 12:17.490
So this is what write obj does.

12:17.520 --> 12:18.210
Okay.

12:18.390 --> 12:20.370
And um this is fine.

12:20.370 --> 12:24.840
Now we also have the pipe dot extended feature edge mesh file.

12:24.840 --> 12:26.460
But we're not interested in that.

12:26.460 --> 12:30.180
If you go to try surface we pasted only dot stl file here.

12:30.180 --> 12:31.950
But it also has dot image file.

12:31.950 --> 12:33.950
That is what is needed actually.

12:34.190 --> 12:38.540
Okay, now we are ready to do snappy hex mesh.

12:40.040 --> 12:40.550
Okay.

12:40.700 --> 12:42.320
So snappy hex mesh data.

12:42.350 --> 12:45.260
It has these three parameters as the main thing.

12:45.260 --> 12:47.720
So castellated mesh it has to be true.

12:47.720 --> 12:49.370
Otherwise you are not going to get the mesh.

12:49.370 --> 12:51.170
Snap has to be true.

12:51.170 --> 12:53.330
Otherwise you are not going to get a smooth mesh.

12:53.360 --> 12:54.170
Add layers.

12:54.170 --> 12:55.820
It can be true or false.

12:55.820 --> 12:58.780
It depends on what your necessity is, okay?

12:59.260 --> 13:03.370
And by default we will be giving five dot style.

13:03.370 --> 13:09.490
In this case, if you are having any other dot style, it has to match with the name under tri surface

13:09.490 --> 13:09.880
folder.

13:09.880 --> 13:14.050
So you are giving it here and the type will be tri surface mesh.

13:14.050 --> 13:17.950
The name is pipe this pipe under name.

13:17.950 --> 13:19.270
It is user defined.

13:19.270 --> 13:21.600
You can keep anything that you want Okay.

13:21.600 --> 13:23.760
It is not a syntax you can keep.

13:23.760 --> 13:28.950
Whatever you want and feature will be given through file pipe dot image.

13:28.950 --> 13:32.640
This is what the surface feature extract has uh generated.

13:32.640 --> 13:36.210
And we are setting it to level six for very good refinement.

13:36.210 --> 13:40.710
It can be three, four, five, six anything, but generally three is okayish okay.

13:40.710 --> 13:42.030
And six will be very good.

13:42.030 --> 13:43.710
You can also go above that.

13:43.710 --> 13:50.780
There is no limit but generally six is very fine and three is coarse or a decent mesh.

13:52.070 --> 13:57.200
And the next thing is refinement surfaces where we are selecting this pipe.

13:57.530 --> 13:57.770
Right.

13:57.770 --> 14:02.450
So this pipe is same as what you defined in here the name.

14:02.450 --> 14:09.320
So it has to match okay the pipe and the level I have set it to 5 to 6 minimum and maximum refinement

14:09.320 --> 14:09.740
level.

14:09.740 --> 14:14.740
So it will see how the surface is and it will choose whether to do minimum or maximum.

14:14.740 --> 14:15.850
So it can be same.

14:15.850 --> 14:21.850
Also five five also be given six six can also be given and the patch info will be type pipe.

14:22.630 --> 14:24.400
And in groups it is pipe.

14:24.400 --> 14:30.940
So as we were seeing in Paraview we have empty patch as well as uh walls patch.

14:31.000 --> 14:33.460
We can also do pipe.

14:33.460 --> 14:35.040
We can give our own group.

14:35.040 --> 14:36.360
If there are like many pipes.

14:36.360 --> 14:38.070
In the same case, we can do pipes.

14:38.070 --> 14:39.900
Okay, this will be in the patch info.

14:40.500 --> 14:42.930
Then we have to give location and mesh.

14:42.930 --> 14:45.210
So this is what is most important.

14:45.210 --> 14:50.370
I will try to explain it through visualization.

14:53.070 --> 14:56.190
So we have our block mesh here.

14:56.790 --> 14:59.770
And I will also load the try surface here.

15:01.330 --> 15:02.710
Our STL file.

15:03.040 --> 15:04.750
Yeah we have it okay.

15:04.750 --> 15:10.420
So if I want the mesh outside the surface I have to choose a point outside the surface.

15:10.420 --> 15:12.370
But it has to be inside the block mesh.

15:12.370 --> 15:19.360
You can turn on data access grid and see what are the points on x, y and z.

15:19.360 --> 15:26.730
So the point if it lies outside the pipe, but inside the block mesh, it will generate the block mesh

15:26.730 --> 15:27.840
as the fluid domain.

15:27.960 --> 15:34.710
But if your point lies inside the surface of the pipe, uh, then the mesh will be inside the pipe.

15:34.740 --> 15:37.230
The second tutorial will be on inside the pipe.

15:37.230 --> 15:39.150
So for now we are doing outside the pipe.

15:39.870 --> 15:50.330
So if you see the part we are choosing zero comma 0.5 comma zero uh, which is around in x, it is zero

15:50.450 --> 15:54.740
y, it is 0.5.

15:54.740 --> 15:56.480
And is it is it is zero.

15:56.480 --> 16:00.290
So zero, 0.5 and zero.

16:00.290 --> 16:02.660
It is slightly above the pipe.

16:02.960 --> 16:07.640
It is almost same on the surface of the pipe, but uh, it is outside the pipe.

16:07.640 --> 16:12.190
So it is going to generate the mesh outside the pipe and nothing inside.

16:12.190 --> 16:13.630
So inside will be hollow.

16:14.560 --> 16:15.040
Okay.

16:15.040 --> 16:17.680
And the next feature is add layer controls.

16:17.680 --> 16:24.850
If you set the initial conditions to false for add layers in this region, then you don't have to set

16:24.850 --> 16:26.860
up anything under Add Layers control function.

16:26.860 --> 16:30.580
But if you are setting it to true then you can add the end face layers.

16:30.880 --> 16:36.030
You have to choose the name of the uh region, which in this case is pipe.

16:36.090 --> 16:38.730
So now we will run snappy hex mesh.

16:38.730 --> 16:44.400
So that commands to do it is first we will do block mesh, then the surface feature extract which two

16:44.430 --> 16:45.570
we have already done.

16:45.570 --> 16:50.580
Then we have to run the command snappy hex mesh uh hyphen override.

16:50.580 --> 16:55.350
But before that we will look at the actual file instead of just screenshots.

16:56.130 --> 17:02.210
So it is under snappy hex mesh dict If you go here we have the same file here.

17:02.720 --> 17:03.200
Okay.

17:04.010 --> 17:09.860
And we also have these things called maximum local cells set to 100,000.

17:09.860 --> 17:12.740
Maximum global cells is set to 2 million.

17:12.740 --> 17:14.360
So these are like limits.

17:14.360 --> 17:18.590
You can play over it but pretty much you can leave it default in most cases.

17:19.040 --> 17:24.970
And we have seen this I have set level three because level six is going to take a lot of time.

17:25.450 --> 17:26.680
Uh, that's why I said two three.

17:26.680 --> 17:29.650
But if you want to increase six then it's fine.

17:29.740 --> 17:31.540
Then for uh, refinement levels.

17:31.540 --> 17:36.640
Also, I said to three and four because it will do it faster and resolve angles.

17:36.640 --> 17:37.870
This is very important.

17:37.870 --> 17:44.320
Unlike, uh surface which are extracted, the more the angle the better the capturing.

17:44.320 --> 17:47.970
But in this case, lesser the angle, better the capturing.

17:47.970 --> 17:49.650
So it is to resolve sharp angles.

17:49.650 --> 17:51.240
So usually 30 is fine.

17:51.240 --> 17:54.990
It's not good to go like 10 or 5 in general.

17:54.990 --> 17:56.490
So that is decent.

17:57.240 --> 17:58.890
And we have refinement reasons.

17:59.010 --> 18:01.020
We will cover this in a later tutorial.

18:01.020 --> 18:04.380
So this is not getting used in our case.

18:04.380 --> 18:04.860
Okay.

18:05.400 --> 18:08.730
Uh, so you can pretend that this doesn't exist here.

18:08.730 --> 18:12.320
And the location and meshes also set in the snap controls.

18:12.320 --> 18:19.490
It has a lot of parameters, but pretty much you can leave it default in a beginner level or intermediate

18:19.490 --> 18:19.700
level.

18:19.700 --> 18:26.630
If you want to do very fine level of meshing, then you can maybe play with this and add layer controls.

18:26.630 --> 18:32.060
Also has this expansion ratio, final layer thickness, minimum thickness and at what parameters it

18:32.060 --> 18:32.660
has to grow.

18:32.660 --> 18:36.970
So you can check these commands on what these parameters are actually.

18:36.970 --> 18:39.670
So that is why these come commands exist.

18:39.670 --> 18:46.000
You can read and understand what each of these parameters do, and you can play with the values accordingly.

18:46.750 --> 18:49.420
Now we have something called mesh quality controls.

18:49.420 --> 18:56.980
So it is including a file called mesh quality dict which is also in the systems folder.

18:56.980 --> 19:01.560
You can always copy paste this mesh quality dict Mostly this is perfectly fine.

19:01.560 --> 19:03.570
You don't have to change anything in this.

19:03.870 --> 19:09.870
So we are going to leave it and after this it can be always default.

19:09.870 --> 19:11.280
You don't have to change it.

19:11.520 --> 19:12.990
Pretty much most of the time.

19:13.200 --> 19:13.590
Okay.

19:13.590 --> 19:16.830
Now we will run snappy hex mesh.

19:16.860 --> 19:17.310
Okay.

19:17.310 --> 19:22.920
So the command is snappy hex mesh and always do overwrite.

19:23.690 --> 19:29.810
It is not mandatory to do this space hyphen override, but what this will do is since we are running

19:29.810 --> 19:31.640
multiple iterations, right.

19:31.640 --> 19:37.910
So you can see here we have refinement levels.

19:37.910 --> 19:43.520
So for each refinement level it will try to write it in a new time step file.

19:43.550 --> 19:44.870
We are not interested in doing that.

19:44.870 --> 19:46.910
So we are writing the command overwrite.

19:46.910 --> 19:50.170
So it will override the, uh, polymesh itself.

19:50.170 --> 19:53.650
So we will have consistent mesh under Polymesh folder itself.

19:53.770 --> 19:57.580
So I'll hit enter and it will start to do the meshing.

20:01.060 --> 20:02.620
Now the mesh is over.

20:02.620 --> 20:12.930
So now you can see that in the poly mesh we have more files not just boundary faces points and owner

20:12.930 --> 20:13.440
and neighbour.

20:13.440 --> 20:14.580
We have more.

20:14.580 --> 20:17.130
We also got a new file called sets.

20:17.130 --> 20:21.660
So if I go to boundary now we have five.

20:21.660 --> 20:23.460
Like we also have pipe.

20:23.460 --> 20:25.260
Previously we had only four.

20:25.260 --> 20:26.550
Now we also have pipe.

20:26.550 --> 20:28.770
This is what snappy hex mesh has added.

20:28.800 --> 20:30.600
Now we will actually view the mesh.

20:30.600 --> 20:31.380
I'll go here.

20:31.380 --> 20:33.930
Hide the pipe with para dot form.

20:33.930 --> 20:35.550
I'm going to give refresh.

20:35.720 --> 20:38.120
You can see it has pipe in it.

20:38.720 --> 20:38.930
Okay.

20:38.930 --> 20:40.970
We have generated the mesh of the pipe.

20:41.780 --> 20:43.370
So this is the background mesh.

20:43.370 --> 20:44.960
It stays consistent.

20:44.960 --> 20:46.790
It doesn't it doesn't change.

20:46.790 --> 20:53.360
Now I can go here and select inlet outlet and pipe alone okay.

20:53.360 --> 20:54.200
We have the inlet.

20:54.200 --> 20:55.460
We have the outlet.

20:55.460 --> 20:57.020
And we also have the pipe.

20:58.010 --> 21:00.720
Yeah it is a decent enough mesh.

21:00.720 --> 21:04.440
It's not good to run simulation, but to learn a meshing it is fine.

21:04.500 --> 21:09.930
So as you can see, this is almost, uh, all quad, all hexahedral.

21:09.930 --> 21:11.970
This is what snappy hex mesh does.

21:12.120 --> 21:14.520
So the hex means hexahedral.

21:14.520 --> 21:15.810
Mostly it is Hexahedral.

21:15.810 --> 21:18.030
Sometimes it fails and makes tetra.

21:18.360 --> 21:21.990
But 99% it is hexahedral.

21:23.550 --> 21:29.900
Okay, we have this pipe if you want to see a slice of it, you can also do that.

21:29.900 --> 21:31.040
I'll create a slice.

21:31.040 --> 21:35.750
To create a slice you can click on this button and hide the show plane.

21:35.750 --> 21:36.410
Apply.

21:37.100 --> 21:43.130
So you can see we have the pipe only as a line because we have removed internal mesh I'll select internal

21:43.130 --> 21:43.640
mesh.

21:46.490 --> 21:48.820
And select the slice surface with edges.

21:49.180 --> 21:52.120
As you can see, this is what we have got.

21:54.340 --> 21:57.760
We have the layers also good amount of layers.

21:57.850 --> 21:58.750
We have the mesh.

21:58.750 --> 22:00.190
This is a very coarse mesh.

22:00.190 --> 22:02.470
If you want to work on the refinement levels it's up to you.

22:02.470 --> 22:08.920
But I am saying that when you once you start refining the mesh, it is going to take a lot of time.

22:08.920 --> 22:11.920
So for tutorial purpose I have kept it very low.

22:11.920 --> 22:14.380
You can go up to six seven refinements also.

22:15.280 --> 22:15.490
Okay.

22:15.490 --> 22:18.760
Now we have done the pipe meshing outside the pipe.

22:18.760 --> 22:21.370
But what if we want to do inside the pipe.

22:21.400 --> 22:24.430
The procedure remains literally the same.

22:24.430 --> 22:24.880
Okay.

22:24.880 --> 22:28.750
So I'm going to go to the internal pipe case.

22:28.750 --> 22:30.100
We have the block mesh.

22:30.100 --> 22:33.310
We have surface mixer extract snap x mesh.

22:33.640 --> 22:37.490
And we will pretend that this doesn't exist already.

22:38.330 --> 22:40.790
So initially, you will have only this.

22:40.970 --> 22:45.560
Okay, so we have the try surface and inside that we have the pipe dot STL.

22:46.040 --> 22:48.710
And we have these files also.

22:49.430 --> 22:56.420
Now the method to do as you know already is go to the right location.

22:58.850 --> 23:02.650
Check if it is the right location then run block mesh.

23:02.890 --> 23:09.160
Get a good end and do surface feature extract.

23:09.820 --> 23:11.080
Get a good end.

23:11.290 --> 23:17.500
Ensure that it has created the extended feature edge mesh folder and the dot mesh.

23:17.860 --> 23:20.770
And we already set up the snappy hex mesh.

23:20.770 --> 23:22.480
But there is a slight change.

23:22.480 --> 23:25.350
As I said, the location in mesh is going to change.

23:26.190 --> 23:35.310
Previously it was zero comma 0.5 comma zero, but now it is one comma, 0.25 comma 0.25, because that

23:35.310 --> 23:39.840
is going to reside inside the pipe and not on the block mesh.

23:39.840 --> 23:41.280
So I will show you.

23:46.770 --> 23:49.430
You can see the block mesh is exactly the same.

23:49.430 --> 23:50.660
There is no change at all.

23:51.140 --> 23:57.650
But the point which I have chosen, it lies inside the pipe somewhere in the middle.

23:57.650 --> 24:01.580
It need not be exactly middle, it just has to reside inside the pipe.

24:01.640 --> 24:05.900
Then the entire mesh is going to be inside the pipe and not on the block mesh.

24:05.900 --> 24:09.920
Okay, but the problem is it is not going to do the inlet outlet and all.

24:09.920 --> 24:12.650
It's going to be getting completely removed.

24:12.650 --> 24:18.280
We will look how to do that also in a later tutorial, but for now this is fine.

24:22.840 --> 24:29.260
Now the next thing is we run snappy hex mesh override.

24:29.500 --> 24:38.160
If you want to play, uh, and learn what the command without uh, override does, then you can just

24:38.160 --> 24:41.160
run snappy hex mesh and see what it does to the time step.

24:41.430 --> 24:44.790
Apart from the zero time step, it will also have other time steps.

24:44.790 --> 24:48.210
If you want to play around that, you are free to do.

24:53.220 --> 24:56.460
Or the meshing is over very fast.

24:58.050 --> 25:00.090
Go here and give refresh.

25:00.090 --> 25:01.940
As you can see, this is our only mesh.

25:02.600 --> 25:03.980
This is all that we have.

25:04.160 --> 25:09.020
I'll close this and open it again so you can see the boundary conditions also properly.

25:10.880 --> 25:14.150
You see we have one pipe here, nothing else.

25:17.750 --> 25:24.050
This is what the inside the location will do.

25:28.000 --> 25:28.240
Okay.

25:29.080 --> 25:30.670
We have this mesh.

25:35.200 --> 25:36.880
So this is the internal mesh.

25:36.970 --> 25:44.080
So now you understood how to make snaps mesh outside as well as inside the geometry.

25:44.080 --> 25:49.330
This works pretty much with every geometry, even if it is an aircraft or a ship.

25:49.330 --> 25:49.950
It works.

25:49.950 --> 25:56.100
Okay, so you can, uh, try to download some STL files from Grabcad or any online sources.

25:56.100 --> 26:01.800
Or if you are good at designing, you can design your own STL files and try to do this.

26:03.780 --> 26:07.050
Uh, so we will now do check mesh quality command.

26:07.050 --> 26:09.210
So it will ensure the accuracy.

26:09.210 --> 26:16.640
The, uh, it will check the accuracy of the mesh that is generated by this mesh or any mesh.

26:16.640 --> 26:19.040
Even if you do just the block mesh, you can do this.

26:19.040 --> 26:22.970
And it can be helpful in identifying potential problems in the mesh.

26:22.970 --> 26:25.310
So the command is just check mesh.

26:25.310 --> 26:30.290
So now since we have all the mesh we will do check mesh.

26:30.620 --> 26:37.340
You see it has given all the necessary details right from at what time it has checked the number of

26:37.340 --> 26:42.720
points or faces, number of cells and how many hexahedral is there?

26:42.720 --> 26:44.130
How many prism is there?

26:44.130 --> 26:45.960
How many wedge or pyramid is there?

26:45.960 --> 26:46.200
What?

26:46.200 --> 26:48.120
How many polyhedral is there?

26:48.120 --> 26:56.100
And breakdown of the polyhedral number of faces like four face thing is 16 and six face thing is 118.

26:56.100 --> 27:00.630
So all these data you get this is very highly informative.

27:00.630 --> 27:04.970
And the topology like what are the patch names and what is the face?

27:05.540 --> 27:11.570
Uh, how many faces it has, how many points it has and how is the surface like is it okay on the topology.

27:11.960 --> 27:14.630
Is it closely seeing a closed singly connected.

27:14.630 --> 27:19.820
So these are the things which are uh known from this check mesh command.

27:19.940 --> 27:23.630
And it also gives us simply mesh okay or mesh problems.

27:23.630 --> 27:28.120
If there is some problem it will say what problem it face like one error or two error.

27:28.120 --> 27:30.190
Then you can check what problem it has.

27:30.190 --> 27:33.400
It says okay for boundary openness.

27:33.580 --> 27:35.770
It says okay for couple point location.

27:35.770 --> 27:39.430
For maximum skewness it is saying okay non orthogonality check.

27:39.430 --> 27:40.090
It is saying okay.

27:40.090 --> 27:42.520
So you can see the cell volume is okay.

27:42.520 --> 27:43.900
Phase area magnitude is okay.

27:43.900 --> 27:49.090
If something is not okay it will say one error and you can go back and check which is not fine okay.

27:49.090 --> 27:56.670
So this is the, uh, purpose of doing check mesh command and it will basically say skewness aspect

27:56.670 --> 28:00.450
ratio non orthogonality and mesh consistency checks.

28:00.450 --> 28:07.290
So it will give you an understanding on the common issue and their implication on the mesh and how it

28:07.290 --> 28:09.780
will affect your uh final simulation result.

28:09.960 --> 28:13.470
So tips for resolving common mesh is also found online.

28:13.470 --> 28:16.700
You can check the documentation on how to resolve certain things.

28:16.700 --> 28:22.340
Let's say if you are facing non orthogonality errors then you can uh, check the documentation and see

28:22.340 --> 28:23.390
how to resolve it.

28:24.230 --> 28:25.610
It is case by case thing.

28:25.610 --> 28:27.950
So we can't generally say how it is.

28:27.950 --> 28:36.500
So you have to learn by practicing snap x mesh and refining snap X mesh will generally resolve most

28:36.500 --> 28:38.750
of the errors, but sometimes it also needs some.

28:39.520 --> 28:45.430
personalized curation on the mesh and how it is generated on certain surfaces, and how much refined

28:45.430 --> 28:45.820
it is.

28:45.820 --> 28:52.240
So it all comes with practice and experience on how to make a better snappy hex mesh.

28:52.630 --> 28:55.000
So this is how our final mesh looked.

28:55.450 --> 28:56.980
And you have a task now.

28:56.980 --> 29:01.810
So create a new mesh where the mesh is inside the pipe using the same STL.

29:01.810 --> 29:11.460
But now you have to create, uh, how to say, uh, boundary layers inside the pipe.

29:11.520 --> 29:15.000
So we did not have the boundary layers when we did this.

29:15.000 --> 29:18.030
So you have to create boundary layers inside the pipe.

29:18.210 --> 29:19.470
And that is your task.

29:19.470 --> 29:21.210
You can practice it on your own.

29:22.380 --> 29:22.650
Okay.

29:22.650 --> 29:25.320
So if you have any questions feel free to contact me.

29:25.350 --> 29:26.820
See you in the next video.

29:26.820 --> 29:27.690
Thank you.
