CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   how to access windows files from openfoam v2012 (https://www.cfd-online.com/Forums/openfoam-solving/237845-how-access-windows-files-openfoam-v2012.html)

boffin5 August 8, 2021 18:03

how to access windows files from openfoam v2012
 
Hello,
Although I'm a newbie with OF8, I'm even more of one for v2012.
I have some text files that I want to use to create a case in the windows version. But I can't figure out how to access them from OF v2012. I think it involves something like a mnt/c command, but I can't make it work. Sorry for such a basic question, but after researching, I'm still stumped. Hope someone can save me from the spectre of vi-ing them in.

janibo August 9, 2021 04:53

Hi Alan,

are you using a virtual box or the ubuntu subsystem?

petros August 9, 2021 07:03

Hi,

If you are using WSL, you can navigate to the ubuntu files with:

Code:

cd /mnt/c/Users/<USERNAME>/AppData/Local/Packages/CanonicalGroupLimited.<UBUNTUVERSION>/LocalState/rootfs/home

boffin5 August 9, 2021 11:34

Thanks petros and janibo,
The system that I'm having trouble with is OpenFOAM Min GW cross-compilation; this is the WSL version, I believe. While in this OpenFOAM, I need to be able to read native windows10 files, but haven't found the method.
Also I run OpenFoam8 via Ubuntu on virtual box; for this one I have a bridge to the windows files, so it's no problem. I think it's similar to what petros has suggested.
But the problem remains: how to bridge between native windows10, and WSL OpenFoam?

Yann August 10, 2021 03:48

Hi Alan,

What Petros is talking about is referenced as "Windows 10 native (WSL)"

What you are using is "Windows - minGW" installation which is, I guess, different.

I cannot really help with that since I never used it. On windows I usually go for WSL which is quite easy to use and works for both ESI-OpenCFD and Foundation versions. I find it easier than setting up a virtualbox.

By the way, if you are already using OpenFOAM-8 on a virtualbox, why not installing OpenFOAM-v2021 on the same virtualbox? It would save you the effort of setting up 2 different installations for OpenFOAM-8 and v2012 and you could seamlessly switch from one version to another. (same goes for WSL where you can use both versions)

----
Just in case some people might be interested, here are clarifications about filesystems under WSL:

In WSL, your windows filesystem is accessible from /mnt/c. From there you can navigate in your windows files. So you can setup your cases from the windows explorer pretty much wherever you want. For instance, something like /mnt/c/USER/OpenFOAM-run.

You can also access your linux filesystem through the windows explorer following the path given by Petros: /mnt/c/Users/<USERNAME>/AppData/Local/Packages/CanonicalGroupLimited.<UBUNTUVERSION>/LocalState/rootfs

This makes things pretty easy to share files from both windows and openFoam-linux environments.
----

I hope this helps,
Yann

janibo August 11, 2021 06:08

You could either try the:

explorer.exe . command for direct access.

or you could try a shared (linked) folder with:

ln command.

https://superuser.com/questions/1083...side-of-ubuntu

engio August 12, 2021 02:38

If you're using Windows 10 MinGW cross-compiled OpenFOAM2012, you can access your windows file system like this..(c, d is drive letter in windows)

ls -l /c/Windows
cp /c/Windows/write.exe /d/testDirectory


All times are GMT -4. The time now is 09:05.