CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [Other] Hint: double-click for lazy Win users (https://www.cfd-online.com/Forums/openfoam-installation/143971-hint-double-click-lazy-win-users.html)

FrankFlow November 6, 2014 10:05

Hint: double-click for lazy Win users
 
1 Attachment(s)
Hi there,

how about running OpenFoam cases under Windows using a compiled OF just by a double-click? I am a happy user of blueCFD-Core, but this should also work for similar compiled OF versions.

(1) In the attachment you find two identical files named "Allclean.bat" and "Allrun.bat". Each dos batch file looks for a unix batch file with the same file name in the same directory and starts it. The files can just be renamed and will then look for any new file name. The files can also be copied into any new directory and will keep working. Initially, you might need to adjust the path to your OF installation (see comments).

Code:

@echo off
cls
set PATH=%WINDIR%;%WINDIR%\SYSTEM32
 
rem get dos path
set S_DIR=%~dp0
 
rem get file name (without extension)
set S_FILE=%~n0
 
rem merge dos path and file name
set S_MSYS=%S_DIR:~0,-1%\%S_FILE%
 
rem exchange dos path "\" to unix path "/"
set S_MSYS=%S_MSYS:\=/%
set S_MSYS=%S_MSYS:Program Files=PROGRA~1%
echo *** MSYS will start %S_MSYS% ***
 
rem start shell (if required, please change path to msys)
C:\PROGRA~1\blueCFD-Core-2.3\msys\bin\sh.exe --login -i -c %S_MSYS%
set /p DUMMY=Hit ENTER to continue...

(2) For viewing, one can associate a file named "para.foam" with the paraview.exe (via right click and "open with") to allow post-processing from Windows with one click (works with 4.1.0 64-bit).

Hope this might be helpful and doesn't keep you too far away from unix:)!


All times are GMT -4. The time now is 00:22.