Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect OpenFOAM dev version #20

Closed
wants to merge 1 commit into from

Conversation

matsievskiysv
Copy link

@matsievskiysv matsievskiysv commented Sep 12, 2020

Detect OpenFOAM dev version

Closes #19

@qingfengxia
Copy link
Owner

qingfengxia commented Sep 15, 2020

The latest OpenFOAM is 8.x, can we set a really big number to indicate it is latest.

Secondly, ubuntu 's openfoam use a version of 19.06, seems change the origin of source code.

do you happen to know any command to detect openfoam?

@matsievskiysv
Copy link
Author

do you happen to know any command to detect openfoam?

Do you mean detect foam version or location?

@qingfengxia
Copy link
Owner

I had a requirement to detect OpenFOAM installation into WSL, to let CFD on windows working with official openfoam.
It once works,now breaks. I am looking for a exe like "foamVersion"

@matsievskiysv
Copy link
Author

WM_PROJECT_VERSION envvar seems to be the only method.

@matsievskiysv
Copy link
Author

BTW, this code is unnecessarily complicated. Python can access environment variables:

from os import environ

path = environ.get("WM_PROJECT_DIR", None)
version = environ.get("WM_PROJECT_VERSION", None)
if not version or not path:
    raise RuntimeError("OpenFOAM envvars are not set")

@qingfengxia
Copy link
Owner

qingfengxia commented Sep 18, 2020

`from os import environ

path = environ.get("WM_PROJECT_DIR", None)
version = environ.get("WM_PROJECT_VERSION", None)
if not version or not path:
raise RuntimeError("OpenFOAM envvars are not set")
`
will only work if FreeCAD is running from linux terminal. It will not work if FreeCAD is started from start manual even for Linux. because all those env var are yet source to bash.

I have updated config.py yesterday. Agree your setting (8, 0) is a solution, to save future error, I set it as 10000, big engouh. Openfoam.com using version 1906

for our latest installation, there should be a command called foamVersion what is the output for your installation.

@matsievskiysv
Copy link
Author

I have updated config.py yesterday

I don't see this update

@qingfengxia qingfengxia closed this Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

init fails when OpenFOAM version is dev
2 participants