WEBVTT

00:00.080 --> 00:00.770
Hello everyone!

00:00.770 --> 00:07.400
In this video we are going to see how to install Openfoam version 20 406 using WSL.

00:07.400 --> 00:13.760
So WSL is Windows Subsystem Linux, where you can get almost all the access of Linux system within your

00:13.760 --> 00:14.780
windows machine.

00:14.780 --> 00:16.400
So that is what we are going to see.

00:16.400 --> 00:23.120
We are going to start from the installation of WSL and get till the installation of Openfoam 20 406,

00:23.120 --> 00:28.940
and also I have an additional tip on how to set up the Openfoam so that it does not consume a lot of

00:28.940 --> 00:31.880
space in your hard disk or SSD.

00:31.880 --> 00:38.720
So usually WSL has this problem where even after you delete certain files inside the WSL architecture,

00:38.720 --> 00:42.170
it will not show as free space in your hard disk.

00:42.710 --> 00:45.890
So we will see one method which will rectify that problem.

00:45.890 --> 00:49.760
So to install Openfoam you can visit this website openfoam.

00:49.760 --> 00:50.300
Comm.

00:50.300 --> 00:53.000
There are two versions I will suggest using this one.

00:53.000 --> 00:58.550
So once you go to Openfoam comm you go to downloads here, press on Linux.

00:59.330 --> 01:01.610
Then this will open up this window.

01:01.610 --> 01:06.560
So here you can press Debian plus Ubuntu and it will open a new window.

01:06.560 --> 01:11.450
And these are the commands that we have to run in a terminal which is the Linux terminal.

01:11.480 --> 01:13.220
To install Openfoam.

01:13.220 --> 01:15.410
So for that we need a shell right.

01:15.410 --> 01:17.420
So we will see how to install that.

01:17.450 --> 01:22.850
First you can open your command prompt in a regular fashion.

01:22.880 --> 01:25.700
Then you can choose any drive that you want.

01:25.700 --> 01:30.740
If you want to use your C drive only, you can just type all the commands which I am typing directly.

01:30.740 --> 01:34.220
But now let us say that I want to use my D drive.

01:34.250 --> 01:39.830
Then I will put D colon, press enter and it will take me there.

01:39.830 --> 01:42.890
So it's up to you on which drive you want to do it.

01:43.010 --> 01:47.180
I have multiple drives and I don't want to put it in C, so I am putting it in D.

01:47.210 --> 01:49.670
If you want to continue with C, you can do it in.

01:49.670 --> 01:53.030
The command is okay let me zoom it up slightly.

01:53.450 --> 01:56.660
So space hyphen D sorry.

01:56.720 --> 01:59.640
Hyphen hyphen Install space.

01:59.640 --> 02:01.620
Hyphen D space.

02:01.800 --> 02:02.670
Ubuntu.

02:03.810 --> 02:06.870
Hyphen 24.04.

02:06.870 --> 02:12.600
So version 24.04 is the latest version, so I am installing that.

02:12.630 --> 02:20.010
If it asks for any permission, you can give it and it will take a bit of time to install the WHL.

02:20.010 --> 02:22.080
So let us wait till it is over.

02:22.470 --> 02:25.110
Okay, now the installation is happening.

02:25.350 --> 02:30.630
I will give it the access now after it has downloaded it is installing now.

02:30.630 --> 02:32.880
Let's wait till it installs.

02:33.750 --> 02:39.780
Okay, now the installation has been done and it is saying the requested operation is successful, but

02:39.780 --> 02:43.020
the changes will not be effective until the system is rebooted.

02:43.230 --> 02:50.190
So generally we will have to reboot, but for some system it might or might not work without a reboot.

02:50.190 --> 02:53.130
So let us see whether it is working without a reboot.

02:53.160 --> 02:55.410
If it is not working, then we will reboot.

02:56.070 --> 02:58.140
So to check whether it is it's working or not.

02:58.140 --> 03:00.270
Just hit your search button.

03:00.300 --> 03:03.030
Then search for, uh, ubuntu.

03:03.060 --> 03:03.510
Yeah.

03:03.540 --> 03:07.050
So it is showing ubuntu 24.04.

03:07.080 --> 03:08.610
Just press enter.

03:09.150 --> 03:09.660
Okay.

03:09.900 --> 03:12.930
You can see that it is giving me an error.

03:12.960 --> 03:18.000
This may take a few minutes and the register distribution failed at all.

03:18.000 --> 03:20.910
So for me it did not work without a reboot.

03:20.910 --> 03:23.430
So I am going to proceed and reboot.

03:23.430 --> 03:27.690
So once the reboot is done then I will show you what is the procedure.

03:28.290 --> 03:29.460
So now I will reboot.

03:30.120 --> 03:32.490
Okay, now my system has been rebooted.

03:32.490 --> 03:36.360
So what I am going to do is this search for ubuntu.

03:36.630 --> 03:40.410
This might open automatically or might not open automatically.

03:40.440 --> 03:41.880
So let it take some time.

03:42.120 --> 03:46.860
Then once the installation is over it will ask for username and password.

03:46.860 --> 03:52.050
Then we will do the setup because this is like a separate machine inside your windows machine.

03:52.110 --> 03:54.300
So we have to give the username and password.

03:54.330 --> 03:54.600
Okay.

03:54.600 --> 03:59.170
Now it is asking for a username, so I am just entering a username.

03:59.170 --> 04:02.200
Press enter, then it will ask for a password.

04:02.200 --> 04:06.130
But you have to be very careful while typing the password because when you type.

04:06.160 --> 04:11.590
Usually when we type password anywhere, either it will show what we are typing or it will show at least

04:11.620 --> 04:13.900
a star or some symbol, right?

04:13.900 --> 04:16.150
But here now it will not show anything.

04:16.150 --> 04:20.830
So you have to type it very carefully and it will ask for a confirmation also.

04:20.830 --> 04:26.800
So now I am going to type enter and it will ask to retype the password.

04:26.800 --> 04:35.530
So type it again carefully and make sure that you are not giving any space special character while typing

04:35.530 --> 04:37.360
your username or password.

04:37.360 --> 04:42.670
So it should not have any special character or it should not have any spaces in between.

04:42.670 --> 04:47.350
So once you do that, this window will appear and this is your cell machine.

04:47.350 --> 04:50.860
So how will you know whether you are in a cell or in a command prompt?

04:50.860 --> 04:56.860
So when you are in a cell, you will see that your username but your device name will appear here.

04:56.860 --> 05:03.610
But if you are on your command prompt, then this will all be white, right?

05:03.610 --> 05:05.770
And it will just say C users HP.

05:05.800 --> 05:08.260
The laptop name, all that will come here.

05:08.260 --> 05:13.030
So here you will be getting this green color and then it will be followed by blue color.

05:13.030 --> 05:14.320
So all that will be there.

05:14.320 --> 05:16.750
That is how you know that you are in your WSF.

05:17.050 --> 05:21.310
So let me close this and open a new ubuntu terminal.

05:21.940 --> 05:25.120
Now we can start installing our Openfoam.

05:25.120 --> 05:29.500
So the first method is like just copy this.

05:29.650 --> 05:35.140
Go to your terminal either right click right mouse button or just press Ctrl V.

05:35.170 --> 05:36.880
So mostly right button will work.

05:36.880 --> 05:37.540
Right button.

05:37.540 --> 05:38.440
Press enter.

05:38.470 --> 05:41.500
Now it is asking for a password right.

05:41.620 --> 05:43.450
So you have to type it very carefully.

05:44.620 --> 05:46.720
You have to remember the password all the time.

05:46.900 --> 05:48.400
You should not forget it.

05:48.430 --> 05:51.880
Otherwise you have to uninstall and reinstall it again.

05:51.910 --> 05:53.290
It's going to be a big problem.

05:53.290 --> 05:54.860
So always remember the password.

05:54.890 --> 05:57.170
Now it is saying the repository is set up.

05:57.170 --> 05:59.330
You can now install packages.

05:59.330 --> 06:04.040
So first we have to update get updates the updates for the packages.

06:04.040 --> 06:06.890
So copy this right click press enter.

06:07.160 --> 06:09.410
It will search for any updates available.

06:09.410 --> 06:11.030
This might take a bit of time.

06:11.030 --> 06:13.490
So once that is done we are ready to install.

06:13.520 --> 06:15.620
So you just copy this entirely.

06:15.650 --> 06:22.940
Go here right click use your left arrow button to change this to 20 406 instead of 2312.

06:22.970 --> 06:24.290
Then press enter.

06:24.680 --> 06:27.230
Then it will ask for a confirmation.

06:27.260 --> 06:33.620
Right now it is asking yes or no and it will consume one, two, four, six MB of additional space.

06:33.620 --> 06:34.910
So I will type y.

06:35.180 --> 06:35.870
Hit enter.

06:35.900 --> 06:39.770
Doesn't matter whether it is small y or capital y, you don't have to worry about that.

06:39.770 --> 06:42.620
So once you press type Y, press enter.

06:42.620 --> 06:45.110
Just wait for openfoam to get installed.

06:45.170 --> 06:48.410
So once the installation is done, I will get back to you.

06:49.940 --> 06:53.210
Okay, now the installation of Openfoam is also done.

06:53.240 --> 06:58.910
But if you see that it is giving us some instructions to do so, now let us do that.

06:59.660 --> 06:59.840
Okay.

06:59.870 --> 07:08.540
To do that just type explorer dot x space dot press enter okay.

07:08.720 --> 07:11.720
Then this window will open.

07:12.770 --> 07:16.880
Here you can see that you have a file called dash dot bash RC.

07:16.910 --> 07:20.450
Now if this file is not there this location is not there.

07:20.450 --> 07:23.240
Then in the terminal you just type CD once.

07:23.240 --> 07:26.630
Then you type the explorer dot txt and it will be fine.

07:26.660 --> 07:33.020
Okay so now you can open this dot bashrc file either in VSCode or in notepad.

07:33.050 --> 07:37.070
So or if you have any other text editor anything is fine.

07:37.190 --> 07:40.550
So once you open that go go to the last line.

07:40.580 --> 07:41.000
Okay.

07:41.030 --> 07:43.400
Just create one more line after the file.

07:43.430 --> 07:44.900
This should be the last line.

07:45.050 --> 07:45.440
Okay.

07:45.470 --> 07:50.060
Now here you have to type this command that is shown here.

07:50.090 --> 07:55.640
Okay Just going to type it out.

07:55.850 --> 07:59.390
You can also copy paste, but I generally like to type it so don't miss.

07:59.390 --> 08:13.730
The dot starts with dot space slash user slash lib slash open form slash open form 20 406 slash ATC

08:13.760 --> 08:15.890
slash bash RC.

08:16.130 --> 08:19.250
So once you type that without any mistakes.

08:19.490 --> 08:21.080
I hope I did not make any mistakes.

08:21.110 --> 08:22.280
Save the file.

08:23.060 --> 08:23.960
Close this.

08:23.990 --> 08:24.980
Close this also.

08:25.010 --> 08:29.270
Then open a new ubuntu.

08:29.870 --> 08:33.920
Okay now you have to type the set of commands that I am telling you.

08:33.950 --> 08:39.500
So mkdir space hyphen p dollar form underscore run.

08:39.500 --> 08:42.050
So notice that form underscore run is capital.

08:42.080 --> 08:43.400
Press enter.

08:43.640 --> 08:44.060
Okay.

08:44.090 --> 08:50.820
Now what we are going to do is we are going to create a location where you can use your open form so

08:50.820 --> 08:52.890
you don't follow any other YouTube tutorial.

08:52.890 --> 08:57.210
They will be using the location where WSL is installed that will cause problems.

08:57.210 --> 09:00.270
So I will tell you this and you follow this all the time.

09:00.270 --> 09:01.980
So go to your drive.

09:01.980 --> 09:05.580
Any drive C or D or E, wherever you have space.

09:05.610 --> 09:10.230
Then create a new folder called Openfoam.

09:10.470 --> 09:16.350
Here you can create another new folder called version 20 406.

09:16.380 --> 09:16.920
Press enter.

09:16.920 --> 09:22.230
I am just doing this because if you want to create any other versions later, then you can have it nicely

09:22.230 --> 09:22.680
there.

09:22.710 --> 09:29.760
Okay, now what we are going to do is going to open the same explorer dot txt space dot.

09:29.790 --> 09:32.760
In this location open the bashrc.

09:42.060 --> 09:53.790
Go to the last line and just type out this command a l I s Equal to open a colon CD space.

09:53.820 --> 09:57.510
Then you have to type slash m and t slash.

09:57.540 --> 10:00.210
Then you just go to this location.

10:00.210 --> 10:03.120
If you are in C drive then you have to type small C.

10:03.150 --> 10:08.430
If you are in D drive with small D for me it's small D slash then this location.

10:08.460 --> 10:16.110
Okay so it's open form slash V2406.

10:16.560 --> 10:18.990
Then close the single quotes.

10:19.020 --> 10:21.210
Now here we have to give this a name.

10:21.210 --> 10:25.170
So I am going to call this off 20 406.

10:25.200 --> 10:25.650
Okay.

10:25.680 --> 10:28.140
There is no space between this and this and all.

10:28.140 --> 10:30.360
So just save this.

10:30.390 --> 10:33.480
Close this bash RC open the sorry.

10:33.510 --> 10:34.590
Close the ubuntu.

10:34.620 --> 10:35.970
Open a new one.

10:37.350 --> 10:37.860
Okay.

10:38.850 --> 10:44.130
So whenever you want to run any open form simulation just type this.

10:44.160 --> 10:46.440
It will take you to this location.

10:46.470 --> 10:46.770
Okay.

10:46.800 --> 10:48.160
This is inside windows.

10:48.190 --> 10:50.860
That is what this m nt m nt means.

10:50.860 --> 10:53.410
So now let's test it.

10:53.560 --> 10:56.740
I am going to create a new file called file.

10:56.770 --> 11:00.400
You can see that it is appearing here instead of w sl location.

11:00.430 --> 11:02.680
So we don't want this file okay.

11:04.270 --> 11:07.450
So what I'm going to do now is I'm going to copy all the tutorials.

11:07.450 --> 11:12.760
If you are familiar with Openfoam, you will know that all the people use the tutorials to do anything

11:12.760 --> 11:13.300
we want.

11:13.300 --> 11:21.160
So the command here is CP space hyphen r dollar home underscore tutorials space dot.

11:21.190 --> 11:22.300
Don't miss the dot.

11:22.300 --> 11:26.350
So once you do that the tutorials folder will be copied here.

11:26.350 --> 11:29.800
If you are completely new to openfoam, just follow this.

11:29.830 --> 11:31.630
Trust me with the process.

11:31.660 --> 11:33.550
Don't worry what this tutorial means.

11:33.550 --> 11:34.690
Why are we doing this and all?

11:34.720 --> 11:41.440
You will get a hold of it later, but for now just copy the tutorials folder here and whenever you are

11:41.440 --> 11:45.490
following any Openfoam tutorial, open this location.

11:45.490 --> 11:48.940
First, type OIF zero six Ubuntu Terminal.

11:48.970 --> 11:54.400
Then you will be able to, uh, get to this location.

11:54.400 --> 12:00.790
Once you get to this location, then you can do the tutorials that they are telling you.

12:00.790 --> 12:07.780
So in fact, we will create one more folder where you will be able to, uh, copy all the tutorials,

12:07.780 --> 12:13.210
create separate folder for all the cases that you are running instead of putting everything in the tutorials.

12:13.210 --> 12:16.630
So we will also create that once this copying is done.

12:16.630 --> 12:23.410
So once your tutorials folder is completely copied, just create a new folder called run.

12:23.440 --> 12:27.940
Then you can enter the folder called run through this okay.

12:27.970 --> 12:32.710
Now in fact you can open this location every time, right?

12:32.740 --> 12:38.560
So when you open a new terminal this will be something like this.

12:38.800 --> 12:39.070
Right.

12:39.100 --> 12:44.170
So once the terminal is open just type of 20 406.

12:44.200 --> 12:45.500
Then it will take you there.

12:45.500 --> 12:47.720
Then you can enter the run location.

12:47.720 --> 12:49.490
So this is where it is.

12:49.520 --> 12:51.800
Then you can run any case that you want.

12:51.800 --> 12:53.480
So there is also another way.

12:53.480 --> 12:55.850
Let's say you are having multiple folder inside run.

12:55.850 --> 12:57.080
Then you have to navigate right.

12:57.110 --> 12:59.660
Instead of that you can just right click here.

12:59.990 --> 13:02.570
Open in terminal okay.

13:02.570 --> 13:04.430
Any location this works for any location.

13:04.430 --> 13:06.320
Open any location in windows.

13:06.380 --> 13:09.290
Just right click open in terminal.

13:10.490 --> 13:15.530
So once it is open in the terminal just type WSL enter.

13:15.560 --> 13:18.350
Then it will open the ubuntu terminal here.

13:18.350 --> 13:23.480
Then you don't have to worry about opening the location through your terminal.

13:23.570 --> 13:27.080
And this will work all the time for any location.

13:27.380 --> 13:28.370
Okay this is open.

13:28.370 --> 13:31.670
So that's it for the installation of Openfoam.

13:31.670 --> 13:34.160
Then you can follow the other tutorials in other videos.

13:34.970 --> 13:36.950
Make sure to like the video if you liked it.

13:37.160 --> 13:39.410
If you have any doubts you can comment down in the video.

13:39.410 --> 13:40.160
Thank you.
