Score:0

Viewing OpenFOAM Files from WSL Bash Environment Only

in flag

I am running OpenFOAM v2012 on WSL2. Previously, I ran OpenFOAM on Linux OS and was able to navigate the tutorial files through the operating system pretty easily. Now, using the bash environment on Windows, I am running into some obstacles.

More specifically:

I am trying to follow an OpenFOAM tutorial located here. When I try to access the elbow_quad.msh file that is provided in the video link, I am not sure how to copy this set of data (while only using the bash environment through WSL2) into the appropriate OpenFOAM folder library and ensure OpenFOAM treats it as a .msh file. I am also wondering how I can view the pressure and velocity files within each OpenFOAM tutorial folder while only using the bash environment (for example in incompressible/icoFoam/elbow/0 there are two files - P and U - how do I view these in the bash environment?). Right now, I only know how to access these folders using the WSL bash environment, and I am not sure how to physically open the data inside the folder from here.

Any suggestions would be appreciated.

hr flag
It would be helpful if you described how you viewed the files in "Linux OS". Are they just text files?
in flag
I would view the files in Linux OS through the standard Linux file/folder structure. I would click on a folder, and then click on the files. When I opened a .msh file this way, gedit would open the file and I could view the contents. It looked identical to how the guy in the video I linked accessed the files. Now, I do not have access to that OS because I am using Ubuntu through WSL, so the only way I know currently is through the bash environment (Command prompt).
hr flag
OK so it sounds like they are text files - you should be able to navigate to the containing directory in the terminal using `cd` (with `ls` and `pwd` to help you find your way around) and then view them with a pager such as `less` (or view AND edit with `nano` or `vi`).
in flag
Thanks @steeldriver ! The nano command seems to be what I was looking for. My last remaining question (for now) is how I am able to convert a text file into a .msh file. Specifically, I am trying to use the content in this file: https://github.com/jnmlujnmlu/OpenFOAMTeaching/blob/master/JozsefNagy/elbow_quad.msh, but first I save it to a text file.
hr flag
As far as I can see, a .msh file *is* a text file. Remember that file extensions don't really have any significance in *nix. Just save it and rename it if necessary (ex. `mv somefile somefile.msh`).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.