WEBVTT

00:00.170 --> 00:01.010
Hello everyone!

00:01.010 --> 00:05.030
Welcome to the CFD using Openfoam Beginner to Intermediate course.

00:05.480 --> 00:09.230
This will be the first class in this class.

00:09.230 --> 00:15.890
We will be looking at the introduction to Openfoam, installation and setup of the software basic file

00:15.890 --> 00:18.650
structure and basic commands which is used in Openfoam.

00:18.830 --> 00:20.630
First, what is Openfoam?

00:20.630 --> 00:24.440
Openfoam stands for Open Field Operation and Manipulation.

00:24.560 --> 00:28.850
It is an open source software used for computational fluid dynamics, commonly known as CFD.

00:29.760 --> 00:35.430
It is designed for solving continuum mechanics problem including fluid flow, heat transfer, and chemical

00:35.430 --> 00:36.120
reactions.

00:37.020 --> 00:43.410
Initially, it was developed by open CFD limited, a company, a division of the ESI Group, first released

00:43.410 --> 00:45.060
in the year 2004.

00:45.270 --> 00:51.660
Since then continuously enhanced and maintained by the Openfoam Foundation and an active user community.

00:51.660 --> 00:55.210
So we generally say.com and.org.

00:55.240 --> 00:59.590
Version or it is also known as foundation and community version.

00:59.590 --> 01:04.180
So in this course we will be using the community version which is the essay version.

01:04.930 --> 01:12.460
So what happens is the org or foundation version they release in the format of version one.

01:12.460 --> 01:15.010
Version two and the latest one is version 11.

01:15.010 --> 01:18.270
So it is mostly like V9V ten v 11.

01:18.270 --> 01:22.410
And uh, when this course is published the latest is v 11.

01:22.410 --> 01:27.240
But ESA they do it in a slightly different format.

01:27.240 --> 01:36.540
So they release uh two versions every year, one in the month of June and one in the month of December.

01:36.540 --> 01:43.630
So you see the latest version, which is released as of this course recording is, uh, 231, two.

01:43.660 --> 01:50.110
So version two, three one to what it means is it is released in the year 23, which is 2023.

01:50.110 --> 01:54.670
And the one two means the 12th month of the year, which is December.

01:55.360 --> 01:59.290
So the previous release was version 2306.

01:59.290 --> 02:00.550
So it was in the June.

02:00.550 --> 02:01.870
So 2306.

02:01.870 --> 02:05.200
And previous to that it is obviously 2 to 1 two.

02:05.200 --> 02:06.410
And it goes on.

02:06.410 --> 02:11.570
And uh, as of this course, it is recorded in June 2024.

02:11.570 --> 02:14.570
So we are expecting 20 406 soon.

02:14.750 --> 02:17.870
We will be using 2312 for this course.

02:20.270 --> 02:26.810
Uh, features and capabilities of Openfoam wide range of solvers is present for incompressible compressible

02:26.810 --> 02:27.770
flow solvers.

02:27.770 --> 02:33.720
We also have solvers for multiphase heat transfer, combustion, chemical reaction, and everything.

02:33.720 --> 02:37.770
It is also highly customizable since it is an open source software.

02:37.770 --> 02:42.120
You can modify create your own custom solver, edit the source code.

02:42.120 --> 02:48.780
You can play around the coding as much as you want and there is no restriction and it is absolutely

02:48.780 --> 02:49.230
free.

02:49.380 --> 02:55.720
Also, there are extensive libraries for physical models and numerical methods even if it is not coming

02:55.720 --> 02:59.320
in the installation, you can download it from external websites.

02:59.320 --> 03:01.120
Contributors from GitHub.

03:01.120 --> 03:03.190
It is called form extend version.

03:03.850 --> 03:10.210
You can write your own solvers if you need, or you can use solvers written by other people in terms

03:10.210 --> 03:10.990
of openfoam.

03:10.990 --> 03:17.650
So it is highly customizable and its pre-processing and post-processing utilities are highly powerful,

03:17.650 --> 03:23.900
like the tools for mesh generation and manipulation comes within the installation, and data analysis

03:23.900 --> 03:29.210
and visualization tools can be done using a software called Paraview, which is also open source.

03:29.210 --> 03:32.390
And it comes along with the installation of Openfoam.

03:32.690 --> 03:38.180
And we can also do complex geometries and dynamic meshing where the mesh moves with respect to time.

03:38.180 --> 03:45.460
So it is also possible in Openfoam it supports structured as well as unstructured meshes capable of

03:45.460 --> 03:50.650
handling moving boundaries and mesh deformation, and also rotating meshes in many cases.

03:51.730 --> 03:56.770
So we will see how to do the installation and setup for installation.

03:56.980 --> 04:00.580
Uh, we need WSL which is called Windows Subsystem Linux.

04:00.790 --> 04:04.690
Openfoam works only in Linux system and not in windows system.

04:04.690 --> 04:09.740
But that doesn't mean we have to get a computer which is entirely booted with Linux.

04:09.980 --> 04:17.600
That is why we have something called WSL or Windows Subsystem Linux, where we get the terminal window

04:17.600 --> 04:24.620
of the Linux inside windows so that we can use a Linux subsystem within the windows.

04:25.460 --> 04:31.430
So to install that, all you have to do is open your command prompt or run as administrator.

04:31.440 --> 04:35.040
Or you can also open your PowerShell and run this command.

04:35.580 --> 04:36.840
WSL space.

04:37.200 --> 04:39.360
Hyphen hyphen install space.

04:39.360 --> 04:43.890
Hyphen D where d means the distribution version and space.

04:43.890 --> 04:46.350
You can type ubuntu with capital U.

04:46.380 --> 04:48.990
Hyphen 22.04.

04:48.990 --> 04:55.410
So what this will do is it will install the Windows Subsystem Linux along with the ubuntu version of

04:55.420 --> 04:59.980
Linux, which is 22.04 along with the installation.

04:59.980 --> 05:03.010
And you will get ubuntu inside your system.

05:03.010 --> 05:11.650
But if you know how to do a second boot second OS inside your system, then you are free to do a Linux

05:11.650 --> 05:12.220
boot up.

05:12.220 --> 05:19.630
Or if you have a spare laptop and you can afford to remove windows OS and put in Linux completely,

05:19.630 --> 05:20.810
you can also do that.

05:20.990 --> 05:25.250
So once you enter this command and hit enter, the process will start.

05:25.250 --> 05:27.230
Now wait for the process to finish.

05:27.230 --> 05:34.700
Since I have already installed it, uh, I am not installing it again, so you can just run this command

05:34.730 --> 05:35.180
now.

05:35.180 --> 05:38.780
After it is over, it will prompt you to restart your PC.

05:39.680 --> 05:42.170
Now restart your PC and wait.

05:42.410 --> 05:46.530
So you just do the next slide also.

05:46.710 --> 05:49.650
Watch the next slide and then do this process.

05:49.740 --> 05:51.180
That's what I recommend.

05:52.260 --> 05:55.830
After restarting a window named ubuntu will open.

05:56.520 --> 06:00.420
Wait till it asks you to enter your username and password.

06:00.420 --> 06:07.710
So this username and password will be your login details for your Linux system which is in Windows Subsystem.

06:08.750 --> 06:13.580
If the ubuntu terminal does not open automatically, you can also open from the search bar.

06:13.580 --> 06:19.760
You can just open your search bar and search for ubuntu and a terminal window can be opened.

06:20.180 --> 06:26.240
Note when you are typing username, you can see the username, but when you are typing the password,

06:26.240 --> 06:28.010
the password won't be visible.

06:28.010 --> 06:32.210
So you might be wondering, I am typing something but it is not visible on the screen.

06:32.210 --> 06:36.780
It won't even show the stars like how we generally do when we type a password.

06:36.780 --> 06:39.630
It will show stars, but in this case it won't show.

06:40.200 --> 06:45.090
So instead what it will do is it will keep a blank space.

06:45.090 --> 06:48.180
So when you are typing the password, type it very carefully.

06:48.180 --> 06:50.700
It need not be very highly secure.

06:50.730 --> 06:54.210
It is just for a small security purpose.

06:54.210 --> 06:57.160
It's not going to affect your overall security of your system.

06:57.760 --> 06:59.980
So keep it as simple as possible.

07:00.760 --> 07:05.290
It need not, uh, involve anything like numbers, special characters.

07:05.290 --> 07:06.670
There is nothing mandatory like that.

07:06.670 --> 07:08.680
You can keep it as simple as you want.

07:08.830 --> 07:12.970
So make sure you are typing it very carefully and hit enter.

07:14.380 --> 07:17.350
Then the installation will be done for ubuntu.

07:17.380 --> 07:22.820
Now there is a quick tip since we are talking about installation now, I would recommend you to either

07:22.820 --> 07:25.670
install Notepad Plus Plus or Visual Studio Code.

07:25.670 --> 07:31.880
Since Openfoam is open source, we will be modifying the codes to run the simulation.

07:31.880 --> 07:35.600
There is no specific graphical user interface or GUI for this.

07:35.600 --> 07:40.340
Any notepad word or any text editor for that matter would work just fine.

07:40.340 --> 07:45.960
But some specialized Ides can make your work easier and comfortable, so I recommend you to install

07:45.960 --> 07:48.510
either Notepad Plus Plus or VSCode.

07:48.540 --> 07:56.430
I would personally use VSCode because it has amazing user interface and it will help me with autofill

07:56.430 --> 07:57.240
sometimes.

07:57.510 --> 08:03.240
So if you want to follow along, same as mine, you can go with VSCode.

08:03.240 --> 08:08.220
But if you just want to settle down with notepad Plus plus it's your personal preference.

08:08.910 --> 08:09.270
Okay.

08:09.280 --> 08:11.950
now we have the XL.

08:11.950 --> 08:17.140
If you faced any issues, please do, uh, contact me or you can search on the web.

08:17.140 --> 08:23.290
There is various resources to, uh, help you on how to install WSL.

08:23.290 --> 08:24.550
It will be very easy.

08:24.580 --> 08:29.170
Now we will do the installation and setup of Openfoam version 2312.

08:29.260 --> 08:36.870
In my system I already have the 2212 version, but now I want to install the Openfoam 2312 version.

08:36.870 --> 08:41.130
So I will do that along with you so that you can also follow along.

08:41.130 --> 08:46.110
So for that we have to visit the website uh https and so on.

08:46.110 --> 08:47.670
What is there on the screen.

08:47.670 --> 08:51.510
You can also simply search Openfoam install V2312.

08:51.540 --> 08:54.120
The first link will do just fine.

08:55.290 --> 09:04.330
So what we have to do is we have to open our terminal or it is also the ubuntu terminal.

09:04.330 --> 09:06.460
So I will tell you two methods.

09:06.460 --> 09:13.180
One is click on your windows button or open the search bar and search for ubuntu.

09:13.210 --> 09:14.860
This thing will appear.

09:14.860 --> 09:18.610
You can hit enter and it will open a terminal.

09:19.960 --> 09:21.400
Just wait for it to load.

09:27.530 --> 09:29.060
Now it is loaded.

09:29.090 --> 09:31.100
This is also fine.

09:31.130 --> 09:39.110
Okay, but if it is not opening or if it is throwing an error, there is another method.

09:39.140 --> 09:45.800
You can press windows key plus R and this run window will open.

09:45.800 --> 09:49.320
You can type in W cell and hit enter.

09:50.580 --> 09:51.930
Now this will open.

09:52.230 --> 09:58.200
Even if this doesn't work you can do the windows Plus R type in cmd.

09:58.470 --> 10:00.270
This will open your command prompt.

10:00.270 --> 10:03.900
Or you can also search command prompt from here and open it.

10:03.900 --> 10:04.650
No problem.

10:04.650 --> 10:09.180
You don't have to run it as administrator, just normal command prompt is fine.

10:09.180 --> 10:12.010
And then you can type cell and hit enter.

10:12.460 --> 10:15.400
Now this will load the cell for you.

10:18.100 --> 10:19.480
Okay now I got the cell.

10:19.480 --> 10:21.310
How do I know I have the lab?

10:21.610 --> 10:24.730
Uh, my username at the device name.

10:24.730 --> 10:31.120
And we will see something like slash mnt slash the, uh, directory of this.

10:31.120 --> 10:33.130
So this is what we call the directory.

10:33.130 --> 10:38.660
The location from the base where we are working is called directory.

10:38.660 --> 10:40.340
I will use this word very often.

10:40.850 --> 10:44.060
If you are comfortable with terminal you would already know this.

10:44.060 --> 10:47.330
So the first command which will be knowing is clear.

10:47.330 --> 10:49.700
So you type clear hit enter.

10:49.700 --> 10:51.260
It will clear it okay.

10:51.260 --> 10:58.730
Now what we are going to do is um, we are going to type in these commands and we are going to run it.

10:58.730 --> 11:01.840
It will install the, uh, openfoam.

11:01.840 --> 11:07.330
But you can also go to the website which I just mentioned, and you can copy paste this entire code,

11:07.330 --> 11:11.170
but I'm going to, uh, type this out.

11:11.170 --> 11:11.770
Okay.

11:11.770 --> 11:14.230
Now what I'm going to do is I will type CD.

11:14.560 --> 11:20.170
Now, you don't have to understand what I'm doing, uh, or what these commands mean, but CD is change

11:20.170 --> 11:20.980
directory.

11:21.010 --> 11:22.930
Now it will take me to the home directory.

11:22.940 --> 11:25.010
Now we are in the home just after dollar.

11:25.010 --> 11:26.930
If we don't see anything, that is the home.

11:27.470 --> 11:28.580
Again, I will clear it.

11:28.580 --> 11:31.940
Now I will type this command whatever is there on the screen.

11:32.450 --> 11:35.450
SQL space https

11:37.310 --> 11:49.650
dll.openfoam.com/r hyphen Debian hyphen repo dot s h space state bar.

11:49.680 --> 11:55.890
I don't know what is that space sudo space space bash.

11:56.040 --> 11:57.180
I'll hit enter.

11:57.210 --> 11:59.760
Now it is asking me for the password.

11:59.760 --> 12:04.980
So I will type the password and it is running.

12:05.010 --> 12:08.850
This is the only place where we will be needing the password we just set.

12:09.390 --> 12:17.320
So it is doing apt get update which is updating what is available already and it will see if there are

12:17.320 --> 12:19.270
any updates for the system.

12:20.770 --> 12:22.450
So wait for some time.

12:22.450 --> 12:26.560
Make sure your internet is stable, only then it will be done faster.

12:26.560 --> 12:28.390
Then we can do the second command.

12:28.390 --> 12:32.980
So by the way, whatever is there after the hash, it is not needed.

12:32.980 --> 12:34.330
It is just a comment.

12:34.330 --> 12:41.090
Now we can do the second command which is sudo apt get update.

12:41.780 --> 12:45.050
Now this is also going to update whatever is done.

12:45.050 --> 12:47.270
So this is getting the update.

12:47.270 --> 12:51.410
And uh then we will install whatever update is there.

12:51.410 --> 12:52.670
It will be done automatically.

12:52.670 --> 12:53.600
You don't have to worry.

12:53.600 --> 12:58.190
Now this is the command which will actually install openfoam.

12:58.490 --> 13:04.270
It is sudo apt get install openfoam 2312.

13:04.270 --> 13:05.620
Hyphen default.

13:05.620 --> 13:08.200
So there are many methods to install.

13:08.200 --> 13:11.950
Default is going to install everything that is there.

13:12.010 --> 13:16.120
Now this is case sensitive so don't make anything capital.

13:16.120 --> 13:17.500
Everything is small here.

13:17.590 --> 13:18.310
Hit enter.

13:18.310 --> 13:21.070
Now it is going to ask you whether do you want to continue.

13:21.070 --> 13:23.980
Now you can just type why this is not case sensitive.

13:24.010 --> 13:26.270
You can type capital Y or small Y.

13:26.300 --> 13:27.410
Doesn't matter.

13:27.410 --> 13:31.250
Type Y and hit enter and keep your internet stable.

13:31.250 --> 13:35.600
This is going to take a while and it will install Openfoam for you.

13:36.440 --> 13:40.250
Now let us wait till it is over and I'll get back to you.

13:41.510 --> 13:44.060
Now the installation is over.

13:44.060 --> 13:48.170
As you can see, it is asking us to do something.

13:48.270 --> 13:58.140
It is asking us to set up Openfoam through a command called source from bashrc file dot space and this

13:58.140 --> 13:58.680
thing.

13:58.710 --> 14:06.210
Okay, so this is what is going to tell the Linux to, uh, locate Openfoam.

14:06.210 --> 14:10.590
So whenever we are calling Openfoam it has to know where Openfoam is installed.

14:10.590 --> 14:13.030
So this is the location where it is installed.

14:13.030 --> 14:15.370
So we have to source that.

14:15.370 --> 14:16.450
It's called sourcing.

14:16.450 --> 14:20.590
Before that we will check whether Openfoam is installed properly or not.

14:20.590 --> 14:24.580
So to do that you can type in the next command on the slide.

14:24.790 --> 14:29.620
It says Openfoam 2312 and hit enter.

14:29.680 --> 14:34.660
Now if you see this then your installation is done.

14:34.660 --> 14:36.010
Well okay.

14:36.010 --> 14:41.030
Now now, uh, you have to see your username dollar and, uh, blinking thing.

14:41.030 --> 14:43.460
It will also say open form two, three, one, two here.

14:43.460 --> 14:46.760
If it is saying that, then your installation is great.

14:46.760 --> 14:50.150
If you are facing any problem, do ask me.

14:50.270 --> 14:57.320
Uh, you can contact me or there are again, various, uh, resources available on the internet to sort

14:57.350 --> 14:59.630
out any issue which you are getting an installation.

14:59.630 --> 15:05.280
Most probably someone has got that before you, so you can always check it out.

15:06.180 --> 15:11.550
Now we are going to do the sourcing thing to to come out of this terminal.

15:11.550 --> 15:16.830
You can click here and probably control C or control D will work for me.

15:16.830 --> 15:17.850
Control D works.

15:17.850 --> 15:21.660
So then I am going to do something called just CD.

15:21.810 --> 15:22.530
Okay.

15:22.650 --> 15:25.050
Just to ensure that I'm in the home directory.

15:25.090 --> 15:30.910
now we are going to type explorer dot e x e space dot.

15:30.940 --> 15:34.090
Don't miss the space dot and hit enter.

15:34.570 --> 15:41.980
Okay now this window will pop up where you will be able to see something called Dot bash RC, which

15:41.980 --> 15:45.760
is the file Openfoam was talking about dot bashrc file.

15:45.970 --> 15:50.670
So just open that it will ask for permission.

15:50.670 --> 15:52.740
You can open it using VSCode.

15:52.740 --> 15:54.840
I am using VSCode to open it.

15:54.840 --> 15:58.110
Go all the way down to the last line.

15:58.110 --> 16:01.680
Actually, you won't be seeing any of these so just forget it.

16:01.680 --> 16:02.430
You will.

16:02.430 --> 16:03.690
This will be your last line.

16:03.690 --> 16:05.760
This file will be your last line.

16:05.760 --> 16:09.030
So, uh, don't mind any of this, okay?

16:09.030 --> 16:11.130
Pretend that it doesn't exist here.

16:11.520 --> 16:18.490
So what you are going to do is you are going to copy paste this entire thing.

16:18.490 --> 16:18.880
Okay.

16:18.880 --> 16:22.360
I'm just going to copy go to VS code.

16:22.360 --> 16:27.610
And in the last line of your bashrc file you are going to paste it in.

16:27.610 --> 16:29.230
In your case it will be after the.

16:29.230 --> 16:31.810
If I go to the new line and paste it.

16:31.990 --> 16:38.360
Now you are going to do something called sauce.

16:38.390 --> 16:38.870
Okay.

16:38.870 --> 16:42.140
So this will work for you.

16:42.140 --> 16:45.350
So what you have to do is you have to type sauce.

16:45.350 --> 16:50.240
Then you have to type this then save it.

16:50.750 --> 16:54.740
And then you can open a new terminal.

16:55.130 --> 17:01.220
Uh, I will be preferring to use Windows plus R and then we'll see.

17:01.220 --> 17:03.870
Now you should not get any errors here.

17:03.870 --> 17:11.190
If you are getting any error, it means that your sourcing is gone wrong somewhere.

17:11.910 --> 17:14.970
Uh, you can safely close the previous terminal.

17:14.970 --> 17:16.020
It is fine now.

17:16.020 --> 17:18.750
Only the new terminal will work with the source.

17:18.780 --> 17:24.270
Okay, so if you are, uh, if you have done it perfectly, it will not show any error.

17:24.270 --> 17:27.760
Otherwise it will show some command that it is not sourced or something.

17:28.510 --> 17:31.180
So I will also explain what I have done here.

17:31.600 --> 17:39.100
Uh, whenever you want some shortcut, let's say that I want to go to a specific area in my PC, some

17:39.100 --> 17:39.580
directory.

17:39.580 --> 17:43.300
Now it is in main slash c slash user slash Harris Jayaraj.

17:43.570 --> 17:45.130
This is my home directory.

17:45.220 --> 17:47.800
This is the directory where I am at the terminal.

17:47.980 --> 17:54.170
But if I want to go to a specific directory, say, Udemy Openfoam course.

17:54.170 --> 18:03.500
So if I want to go there, then the command is actually CD space, then the location of that folder.

18:03.500 --> 18:08.930
Then I if I just type that, let's say I'm typing specifically that.

18:08.930 --> 18:10.460
So I'll go to my home directory.

18:10.460 --> 18:19.330
Now I am typing series slash empty slash d slash openfoam V2212.

18:20.350 --> 18:25.870
Uh, Udemy Openfoam course, if I am typing, you can see that I am entering that location.

18:25.870 --> 18:31.510
But if I don't want to do that, let's say I am going to use this folder very often.

18:31.510 --> 18:34.630
Then what I can do is I will create something called alias.

18:34.630 --> 18:40.430
So if I want to enter that location, all I have to do is enter the home directory by typing in CD.

18:40.580 --> 18:42.050
Then I will type Udemy.

18:42.470 --> 18:45.350
Hit enter and it will take me there directly.

18:45.350 --> 18:49.730
So it is an alias to do specific commands.

18:49.760 --> 18:56.510
Now if you have multiple, uh, versions of Openfoam, or if you also want to do something like this,

18:56.510 --> 19:05.250
then what you can do is you can put this entire thing within a single quotations.

19:05.280 --> 19:08.340
Then after the quotation, you just type a dot.

19:08.340 --> 19:14.130
So it has to be like dot space, then the, uh, location instead of source space.

19:14.760 --> 19:18.450
Then I am going to type alias space.

19:18.450 --> 19:21.060
Then you can give whatever word you want.

19:21.060 --> 19:24.810
I am going to use of two, three, one, two for this.

19:24.810 --> 19:27.850
So whenever I type of 2312.

19:28.540 --> 19:31.720
This file or this location will be sourced.

19:31.720 --> 19:35.230
So let's say I want to use Openfoam 2 to 1 to some time.

19:35.230 --> 19:38.230
Then I can type f 2 to 1 two in my terminal.

19:40.390 --> 19:40.780
Okay.

19:40.780 --> 19:41.650
Now.

19:43.840 --> 19:50.680
If I type that then my terminal is taking me to openfoam 2 to 1 to location wherever it is installed.

19:50.680 --> 19:57.690
But if I want to work with Openfoam 231 to say I will type Openfoam 2312.

19:58.380 --> 20:01.920
Now you see it is taking me to Openfoam 2312.

20:01.950 --> 20:04.620
So that is what we are trying to do.

20:05.280 --> 20:08.040
Okay, that is what we are trying to source here.

20:08.040 --> 20:10.890
If I type F23, one two it will take me to the log.

20:10.920 --> 20:13.050
It will source it automatically.

20:13.440 --> 20:18.460
Uh sorry it is not available as of now, so I have to restart and it will work.

20:18.460 --> 20:21.670
So this is what alias Dot does.

20:21.670 --> 20:24.610
Okay, so this is what I have done here as well.

20:24.610 --> 20:27.760
Now this is what is going to work here as well.

20:27.760 --> 20:30.100
So I hope you understood.

20:30.100 --> 20:30.940
Till there.

20:32.200 --> 20:34.780
Now the next thing okay.

20:34.780 --> 20:39.580
Now we have typed in CD clear and we have also sourced this.

20:39.580 --> 20:41.990
So this is what we did till now.

20:41.990 --> 20:45.080
If you want to go through the slides you can go through.

20:45.230 --> 20:50.120
Now uh, we are going to do something called make directory.

20:50.120 --> 20:50.420
Okay.

20:50.420 --> 20:53.120
For this I will open a new terminal.

21:00.200 --> 21:03.710
Now I will source open form 2312.

21:03.740 --> 21:08.910
Now I have sourced Openfoam 2312, which is the new version which I have just installed.

21:08.910 --> 21:14.760
So whenever you have multiple versions you might have to source it manually, but if you just did the

21:14.760 --> 21:19.290
source space slash your user, then you don't have to do this line.

21:20.190 --> 21:25.890
You will find me doing this command throughout this course very often, so you can choose to do it or

21:25.890 --> 21:27.420
skip it whenever you want.

21:27.420 --> 21:37.840
So what we are going to do is create a directory mkdir space hyphen p dollar form underscore run and

21:37.840 --> 21:38.410
hit enter.

21:38.440 --> 21:42.040
What this is going to do is just like how we created alias.

21:42.040 --> 21:45.520
It is open form has its own method of creating alias.

21:45.520 --> 21:46.390
That is this.

21:46.390 --> 21:51.970
Now if I type just run it will take me to a location.

21:52.270 --> 21:52.720
Um.

21:52.720 --> 21:56.930
um, where it has created a run directory.

21:56.930 --> 22:02.120
Usually this is the place where we will be doing all the simulations.

22:02.120 --> 22:05.990
And this is generally is what is considered as a run directory.

22:05.990 --> 22:10.640
But I will suggest you to do something else, which I will tell in the next class.

22:10.640 --> 22:10.880
Okay.

22:10.880 --> 22:12.980
We will be creating our own run directory.

22:13.490 --> 22:14.000
Okay.

22:14.000 --> 22:22.860
So uh, this is what we had to do then what you can do is uh, I is instead of running, just run there.

22:22.860 --> 22:29.790
You can also run CD dollar form underscore run.

22:29.790 --> 22:30.300
Okay.

22:30.300 --> 22:37.260
Now after that, open form offers us set of tutorials which we can copy and use it whenever we want.

22:37.260 --> 22:41.160
So whenever we are working with open form, we don't set up anything from scratch.

22:41.160 --> 22:45.230
We will copy paste some of the tutorials and modify it to cater our needs.

22:45.950 --> 22:56.510
So to do that we have to type in this command and it is CP hyphen r dollar form underscore tutorials.

22:56.750 --> 23:01.730
Slash incompressible slash.

23:01.730 --> 23:03.140
Simple form.

23:03.410 --> 23:05.300
Make sure that f is capital.

23:05.300 --> 23:10.050
It is case sensitive, so make sure everything is set properly.

23:10.350 --> 23:11.070
It's.

23:13.200 --> 23:14.250
Daley.

23:17.490 --> 23:20.610
Space dot and hit enter.

23:20.760 --> 23:21.570
Okay.

23:21.570 --> 23:26.010
Now previously when I typed LHS, we did not see anything like here.

23:26.220 --> 23:30.760
But now when I type LHS, you can see that we have something called pits daily.

23:30.760 --> 23:32.410
This is what we just copied.

23:32.410 --> 23:36.940
So CP is copy command hyphen R is copy recursively.

23:36.940 --> 23:39.850
So it means that whatever file is there inside pits daily.

23:39.850 --> 23:40.930
Copy that also.

23:42.220 --> 23:43.990
Now we have copied that also.

23:43.990 --> 23:55.730
But now uh I will ask you to do something like CP hyphen r dollar form underscore to Tory else space

23:55.730 --> 23:55.970
dot.

23:55.970 --> 23:57.230
Don't miss this dot.

23:57.710 --> 23:59.060
Then hit enter.

24:01.010 --> 24:02.300
It is going to take a while.

24:07.400 --> 24:11.540
Now if you type ls you can also see something called tutorials.

24:11.570 --> 24:20.640
Now this tutorials is uh main folder which I was telling you Like we have various solvers here.

24:20.640 --> 24:23.940
We will be using these tutorials to set up our cases.

24:23.940 --> 24:27.090
We won't set up it, set it up from scratch.

24:27.090 --> 24:28.200
We will just use this.

24:28.200 --> 24:28.740
Okay.

24:29.550 --> 24:33.930
So we have a, uh, created something called the Pitch Daily here.

24:33.930 --> 24:38.670
This is the way to check whether your installation is done properly or not.

24:38.670 --> 24:42.030
Now we are going to enter the Pitch Daily folder.

24:42.030 --> 24:45.520
It is the command CD space pitch daily.

24:45.520 --> 24:47.230
Make sure that this is capital.

24:47.320 --> 24:51.100
Hit enter now if you want to see what is there inside, you can type ls.

24:51.280 --> 24:54.070
You have zero constant and system.

24:54.070 --> 24:57.250
You don't have to worry what these things mean as of now.

24:57.280 --> 25:01.150
Now the command which you have to run next is block mesh.

25:01.150 --> 25:04.810
So I am just following whatever is there in the PPT.

25:05.080 --> 25:05.560
Okay.

25:05.770 --> 25:07.170
Now block mash.

25:07.170 --> 25:07.950
Hit enter.

25:07.980 --> 25:10.170
You have to see something called end.

25:10.170 --> 25:11.670
Here it will you.

25:11.670 --> 25:12.630
You don't have to.

25:12.660 --> 25:15.240
You should not see any warning word here.

25:15.240 --> 25:17.730
It will be ending smoothly with end.

25:17.820 --> 25:22.830
Then the next command is simple form.

25:23.580 --> 25:24.300
Hit enter.

25:25.020 --> 25:25.410
Now.

25:25.410 --> 25:26.910
Wait till this is over.

25:33.070 --> 25:36.010
It will take a bit of time, but it will be over soon.

25:38.950 --> 25:41.440
Okay, now again you are seeing something called N.

25:41.440 --> 25:42.430
Now this is over.

25:42.430 --> 25:48.820
What we have done is we have just simulated a backward facing step case.

25:48.820 --> 25:49.510
Okay?

25:49.600 --> 25:53.020
And we will be typing something called para form.

25:53.020 --> 25:55.970
This is the way to do the post-processing.

25:55.970 --> 25:58.940
This might or might not work for you.

25:58.940 --> 26:01.160
Like it did not work for me, right?

26:01.160 --> 26:05.870
Because it might or might not work for some people.

26:05.870 --> 26:08.120
So you don't have to worry about that.

26:08.120 --> 26:11.660
So what we will be doing is we will be installing something called Paraview.

26:12.380 --> 26:13.700
So what is Paraview?

26:13.760 --> 26:17.780
Paraview is the open source data analysis and visualization tool.

26:17.780 --> 26:22.980
It is developed by a company called Kitware and various institutions in collaboration.

26:23.070 --> 26:26.730
So the key features is it handles a large data sets.

26:26.730 --> 26:31.110
It can be used for any sort of scientific computation, not just Openfoam and CFD.

26:31.530 --> 26:36.870
It has an interactive 3D visualization platform and it is scriptable via Python.

26:36.870 --> 26:42.300
If you want to automate things or if you want to make it customizable, you can do it using Python and

26:42.300 --> 26:44.650
using Paraview along with Openfoam.

26:44.980 --> 26:48.460
It is very powerful to post-process all our data.

26:48.460 --> 26:52.090
We can perform operations like slicing, contour plots, stream line.

26:52.090 --> 26:57.310
If you want to do a graph over specific line on the geometry, you can do that.

26:57.310 --> 27:01.960
If you want to export the data within some cells in the mesh, you can do that.

27:02.350 --> 27:05.350
It has a wide variety of capabilities.

27:05.350 --> 27:07.360
So we are going to install Paraview.

27:08.030 --> 27:13.130
So the method to do it is we will be going to this website paraview.org.

27:13.130 --> 27:15.740
And you can download the latest version.

27:15.740 --> 27:21.380
You can install it install the software in your C drive in the default location.

27:21.440 --> 27:24.320
Now we are going to do something.

27:24.320 --> 27:26.420
I will type ls.

27:26.420 --> 27:29.750
As you can see we have zero 100 202 81.

27:29.750 --> 27:31.130
These are the time steps.

27:31.460 --> 27:38.740
Now we have to run a command called touch space para dot phone hit enter.

27:38.920 --> 27:42.910
Now what this essentially does is it created a file called para dot phone.

27:43.180 --> 27:44.710
This is the para view file.

27:44.710 --> 27:47.230
Now I have installed para view already.

27:48.010 --> 27:55.030
So what I'm going to do is I'm going to type explorer dot x space dot hit enter.

27:55.090 --> 27:59.030
It will take me to the location where these files are existing.

27:59.060 --> 28:00.560
Now we will be seeing this.

28:00.560 --> 28:07.790
So just right click open with choose another app.

28:09.020 --> 28:11.900
Then you can click on Choose app on your PC.

28:13.100 --> 28:20.420
If you scroll down you will be able to see this paraview whatever you wherever you have installed so

28:20.430 --> 28:22.770
you will be able to see Paraview.

28:22.770 --> 28:24.780
So this is my previous version.

28:24.780 --> 28:25.830
This is my new version.

28:25.830 --> 28:28.680
So I am double double clicking the new version.

28:28.680 --> 28:33.660
So whatever you have installed you will be able to see that double click inside bin.

28:34.410 --> 28:38.730
If you just scroll down you will be able to see Paraview and application file.

28:42.720 --> 28:44.250
See this is an application file.

28:44.250 --> 28:45.520
So click on this.

28:45.520 --> 28:49.390
Click on open and make sure to give always.

28:50.410 --> 28:52.570
Now this will load us the case files.

28:53.380 --> 28:55.690
It will take a bit of time for the first time.

29:04.660 --> 29:13.130
So once I clicked the green apply here you might be able to see something like this in terms of geometry,

29:13.130 --> 29:14.930
but the colors might be different.

29:14.960 --> 29:21.230
Okay, so the color map might be different, but as long as it looks similar it is fine.

29:21.260 --> 29:28.820
So if you go here you will be able to choose between velocity pressure or k epsilon nu t.

29:29.030 --> 29:35.640
We will be seeing what these are and how these got generated later, But for now you are just going

29:35.640 --> 29:37.920
to check whether the installation works fine or not.

29:38.790 --> 29:42.660
And this is the interface where we will be changing the times.

29:42.660 --> 29:48.210
As you can see, we have 100 to 100 and 281 since this is a steady state case.

29:48.210 --> 29:52.830
So we are interested only in the last time step where it got converged.

29:53.370 --> 29:53.640
Okay.

29:53.640 --> 29:55.560
So this is the pressure data.

29:56.070 --> 29:58.370
We have the velocity data.

29:58.370 --> 30:05.270
So if you click this button it is going to uh take all the data within this window.

30:05.270 --> 30:09.650
And uh set the minimum and maximum to the color map accordingly.

30:10.670 --> 30:14.990
So I'll this is called rescale to visible data range.

30:14.990 --> 30:16.070
I have selected that.

30:16.070 --> 30:18.530
So this is what we have just simulated.

30:18.530 --> 30:20.750
This is a backward facing step case.

30:20.750 --> 30:23.940
If I click here it will run me through the time step.

30:23.940 --> 30:27.120
But this is a steady state simulation so it doesn't matter.

30:27.690 --> 30:29.280
Now I can close this.

30:29.490 --> 30:35.430
If I go back to the terminal it will be uh, just like how we left it.

30:35.520 --> 30:38.490
Okay, now we will see what is left.

30:38.790 --> 30:40.110
We have done this.

30:40.110 --> 30:42.630
Your color might look something like this.

30:42.630 --> 30:45.240
I have changed the color map for my preference.

30:45.240 --> 30:49.240
Okay, now we will see what is the file structure and basic commands in Openfoam.

30:49.840 --> 30:52.150
So we have a case okay.

30:52.330 --> 30:58.120
A case is the setup which we will be using to run any simulation.

30:58.660 --> 31:01.810
So the case has three different parts.

31:01.810 --> 31:03.850
One is time directories.

31:03.970 --> 31:10.730
Then there is a folder called constant which will store all the constant values or properties related

31:10.730 --> 31:11.810
to the simulation.

31:12.230 --> 31:19.340
And then we have a folder called system, which will store all the control related things, which is

31:19.340 --> 31:20.780
related to the simulation.

31:21.170 --> 31:29.000
Under time directories will be having zero, uh, and after that it will progress as the time step.

31:29.000 --> 31:34.320
If your time step is 0.1, then after zero we will have 0.1, 0.10.20.3.

31:34.320 --> 31:40.950
If a time step is 0.001, then it will be 00.0.001, 0.002, and so on.

31:41.700 --> 31:42.900
So you get the point.

31:42.900 --> 31:52.230
So all these zero files will have corresponding velocity pressure temperature uh and uh pressure minus

31:52.230 --> 31:53.580
the hydrostatic forces.

31:53.580 --> 31:55.410
So all these files will be there.

31:55.740 --> 32:01.960
And in the constant folder Generally we have the mesh here which is stored in the format called poly

32:01.960 --> 32:02.230
mesh.

32:02.230 --> 32:08.560
We will be having a folder called poly mesh under which we will be having the point cell faces boundary

32:08.560 --> 32:09.160
details.

32:09.460 --> 32:14.290
After that we will have various properties like turbulence properties, transport properties which will

32:14.290 --> 32:19.180
have the uh fluids, kinematic viscosity and turbulence model.

32:19.180 --> 32:25.050
Turbulence properties will have the turbulence details like whether it is laminar or Reynolds averaged

32:25.200 --> 32:27.060
simulation or whatever it is.

32:27.600 --> 32:33.120
Under system we will be having the control dict which will be controlling the application, which will

32:33.120 --> 32:35.250
be using all the solver which we will be using.

32:35.970 --> 32:44.250
Any external function, user defined function to plot any data or if you want to change the time step,

32:44.490 --> 32:46.200
uh, start time, end time.

32:46.200 --> 32:51.160
Anything anything related to simulation or setup we will be doing through the control dict.

32:51.160 --> 32:57.640
If we scheme and if we solution correspond to the numerical schemes which will be using to generate

32:57.640 --> 32:58.090
the data.

32:58.090 --> 33:00.730
So we have various CFD numerical schemes.

33:00.730 --> 33:03.910
And we will be setting up those through those two files.

33:03.910 --> 33:12.410
Block mesh dict is a file which will be useful in generating mesh basic mesh snap A hex mesh can be

33:12.410 --> 33:15.380
used for generating complex meshes.

33:15.380 --> 33:19.220
So these are the general files under these folders.

33:19.220 --> 33:24.350
But usually there will be more files which is not uh generic.

33:24.350 --> 33:27.110
So we are not plotting it in this chart.

33:27.710 --> 33:36.240
So some of the useful commands are uh, these I will demonstrate by typing it okay.

33:36.840 --> 33:38.490
So first is LHS.

33:38.670 --> 33:40.050
LHS will do list.

33:40.050 --> 33:47.250
So it will list whatever um folder is there in that specific directory.

33:47.250 --> 33:52.050
Let's say I want to then the second command is CD space the name of the folder.

33:52.050 --> 33:54.390
So that is what I am going to do CD space.

33:54.390 --> 33:58.020
Now here I have Openfoam as one of my folders.

33:58.020 --> 34:04.120
So if you want to autofill, you just type first 1 or 2 letters and hit tab.

34:04.120 --> 34:05.680
It will auto fill for you.

34:05.770 --> 34:06.400
Hit enter.

34:06.400 --> 34:09.250
Now you can see that I am inside Openfoam.

34:09.460 --> 34:14.890
Now if I want to go back, what I will do is I will do CD space dot dot.

34:15.100 --> 34:16.330
It will take me back.

34:16.540 --> 34:18.100
Now for demonstration.

34:18.100 --> 34:19.660
I'll go back inside.

34:20.050 --> 34:23.410
Now, as you can see, I have four folders here.

34:23.680 --> 34:26.750
Uh, let's say I want to go into the fourth file.

34:26.750 --> 34:29.870
Now it's asking me to choose the one.

34:30.560 --> 34:33.110
I am choosing it and hitting enter.

34:33.290 --> 34:35.150
Okay, now under this I have run.

34:35.180 --> 34:41.780
Now, let's say if I want to go back to the home again, either I can do CD and hit enter.

34:41.780 --> 34:51.970
It will always take me to home, or else if I want to do let's say I am like very further into this.

34:52.420 --> 34:53.080
Okay.

34:53.170 --> 34:56.140
Now I just want to go back to folders.

34:56.140 --> 35:02.350
I will do CD space dot dot slash dot dot for coming out of two folders.

35:04.060 --> 35:10.720
And if I want to come out of three folders what I will do is CD space dot dot dot dot slash dot dot.

35:11.170 --> 35:13.430
It will take me back by three folders.

35:13.460 --> 35:15.500
Okay, I'll clear it.

35:16.100 --> 35:20.090
Now touch is a command which will create files.

35:20.090 --> 35:23.360
So generally we will use it to create paraview files.

35:23.630 --> 35:27.380
Let's say I have these three okay I will go back to my home.

35:27.380 --> 35:29.630
We have only open form now okay.

35:29.660 --> 35:36.320
Now I will create the paraview file here touch base para dot form I'll hit enter and search.

35:36.330 --> 35:37.230
What is there?

35:37.350 --> 35:40.080
You can see I have parrot form file.

35:40.440 --> 35:40.980
Okay.

35:40.980 --> 35:42.270
Now if you want to create.

35:42.270 --> 35:43.350
This is for creating a file.

35:43.350 --> 35:49.530
Now if you want to create a folder then you can use mkdir which basically means make directory.

35:50.160 --> 35:53.700
And I can type in the folder name let's say folder.

35:54.630 --> 35:54.810
Okay.

35:54.810 --> 36:00.210
Now when I type ls you can see we have two folders open form and folder which we just created.

36:00.820 --> 36:04.540
Now if you want to enter folder yeah I will enter.

36:04.540 --> 36:09.310
Now let's say I want to remove the folder okay.

36:09.310 --> 36:13.300
The folder which I just created it is r m hyphen r.

36:13.540 --> 36:15.370
Then I will type the folder name hit enter.

36:15.370 --> 36:17.800
Now if I search the folder is not there.

36:17.800 --> 36:22.780
If I want to remove the paraview file, I'll just do rm and it is also gone.

36:22.780 --> 36:26.030
So generally for folders we will be using hyphen.

36:26.030 --> 36:26.420
Ah.

36:26.420 --> 36:30.620
But um we will not be using it to delete files.

36:30.620 --> 36:38.000
Now explorer dot exe will generally open just your Windows Explorer okay.

36:38.000 --> 36:45.350
But if we want to open it in the specific location let's say I am inside Openfoam.

36:45.350 --> 36:48.500
Here I am in version 2212.

36:48.800 --> 36:52.290
And this I am under, uh, tutorials.

36:54.270 --> 36:55.290
Okay, I am under run.

36:55.290 --> 36:55.770
Okay.

36:55.770 --> 36:57.870
Now if I see there is nothing inside.

36:57.870 --> 37:00.240
But I just want to open this location.

37:00.240 --> 37:04.260
What I'm going to do is explorer dot x space dot.

37:04.260 --> 37:08.160
So that space dot means open it in this location.

37:08.160 --> 37:09.960
So dot means this location.

37:09.960 --> 37:17.810
It's a second parameter input I'll hit enter and as you can see it is exactly opening that location.

37:18.410 --> 37:20.510
So that is how that command is useful.

37:20.540 --> 37:23.600
So these are the basic commands which we will use very often.

37:23.630 --> 37:29.570
Apart from this we are not going to use much uh, which is related to Linux directly.

37:29.570 --> 37:31.370
So these are Linux commands.

37:31.370 --> 37:37.550
We will be using more commands which is related to openfoam which we will learn as the course progresses.

37:37.740 --> 37:39.360
So that's it for this video.

37:39.360 --> 37:43.020
If you have any questions, feel free to contact me.

37:44.550 --> 37:47.580
Um, there is a big openfoam community online.

37:47.580 --> 37:53.370
If you have any doubts, first try to check it online so you will be learning more than what you just

37:53.370 --> 37:57.870
need because you will be seeing, uh, problems from other people also.

37:57.870 --> 37:59.550
So you will learn more.

38:00.270 --> 38:00.960
Thank you.

38:00.960 --> 38:02.400
See you in the next class.
