Difference between revisions of "Win10OpenSUSEShell by Stefan Radl"

From OpenFOAM Wiki
Jump to navigation Jump to search
Line 11: Line 11:
  
 
Go back to [https://wiki.openfoam.com/%223_weeks%22_series 3 weeks series].
 
Go back to [https://wiki.openfoam.com/%223_weeks%22_series 3 weeks series].
 +
 +
Go back to [https://wiki.openfoam.com/Collection_by_authors#Stefan_Radl '''Stefan's collection''']
  
 
=Purpose and Intro=
 
=Purpose and Intro=

Revision as of 17:12, 12 February 2019

Go back to Tips.

Go back to 3 weeks series.

Go back to Stefan's collection

Purpose and Intro

Having an OpenSUSE shell on Win10 with OpenFOAM installed is of great advantage for Windows users that do not want to have a dual-boot or virtual maschine installed. I recommend the "shell on Win10" solution especially for installations on laptops, and users that would like to run simple cases and do not care about performance too much. It is hence ideal for beginners, students, and instructors that work with Windows users.

Note, some Linux users prefer the Ubuntu distribution. You will find Win10 shell tutorials for Ubuntu for example HERE (Jozsef Nagy's work).

How to install OpenFOAM in Windows 10 using an OpenSUSE Leap 42 shell

This section explains how to setup an OpenSUSE Leap 42 shell in Windows 10, and install OpenFOAM from source. The beautiful thing with such a "from source" installation is that you add libraries, solvers, external tools like CFDEM etc. as you need.

  • Enable developer mode. E.g., see HERE
  • Enable the Windows Subsystem for Linux (this may require a restart). E.g., see HERE
  • Download and install OpenSUSE Leap 42 from the "Microsoft Store" in Win 10.
  • Start an OpenSUSE shell, and install missing libraries using zypper (i.e., as a superuser, do "zypper in openmpi", "zypper in openmpi-devel"). Note, the root password should be the same as that of the user.
  • Un-tar THIS TAR FILE with a pre-compiled version of OF 4.x into your newly available /opt/ directory of your OpenSUSE shell (you need root privileges there!). Ensure that you un-tar in your Linux shell, NOT the Windows file editor! Alternatively, check-out the source code of the OpenFOAM version of your choice, and compile from source (tested with OF version 4.0 and 5.0).
  • adjust your .bashrc file in your linux home to make linux understand where your OpenFOAM libs and execs are.

File Structure and Arrangement

You need to be careful with the file structure, since this may mess up your OpenSUSE shell!

Thus, never try to access the LINUX file tree with your Windows explorer or the like (although you could: your linux system lifes in C:\Users\<userName>\AppData\Local\Packages\*SUSE.openSUSELeap42.2_*\LocalState. Never tough this in windows!)

It is not problematic to access the classical windows file structure from linux. Therefore, it is practical to create a symbolic link to the drives in your windows machines. These drives are mounted in the linux shell to /mnt. E.g., if you like to have a link named "winUser" in your linux system, simply do:


ln -s /mnt/c/Users/<yourUserName> winUser

Suggested Workflow for Running and Postprocessing OpenFOAM runs

  • create a symbolic link (as above) to make it easy for you to navigate to your Windows file system from the linux shell
  • change to your a directory on your windows file system in which you want to run simulations (it is NOT suggested to use the default OF run directory, since this is on the Linux file system, and hence data cannot be easily accessed there!)
  • you can now easily feed information to your simulations from Windows (e.g., STLs, text files) since you work on the windows file system.
  • compile/run/monitor your simulations in the linux shell
  • Use paraview, Matlab/Octave, and other post-processing tools in your Windows installation, and load data from our windows directory that you used for running