Differences
This shows you the differences between two versions of the page.
software:openfoam:install [2017-10-23 18:01] – created sraskar | software:openfoam:install [2021-04-27 16:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Installing an OpenFOAM application ===== | ||
+ | |||
+ | To install an OpenFOAM application, | ||
+ | |||
+ | - Setup the directory for your OpenFOAM application and versions | ||
+ | - Setup a VALET package (or just add a ''< | ||
+ | - Setup your OpenFOAM application environment using '' | ||
+ | |||
+ | To run an OpenFOAM application, | ||
+ | |||
+ | ==== Setup the application directory ==== | ||
+ | |||
+ | We suggest using your workgroup work directory to setup your application directory. | ||
+ | |||
+ | ==== Setup a VALET package ==== | ||
+ | |||
+ | If you already created a VALET package for your OpenFOAM, then skip to the section to edit your OpenFOAM application VALET package template, otherwise copy the OpenFOAM application template, ''/ | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | to automatically have VALET find the package. | ||
+ | |||
+ | < | ||
+ | Your VALET filename (e.g. '' | ||
+ | </ | ||
+ | |||
+ | === Edit your OpenFOAM application VALET package template === | ||
+ | |||
+ | Now edit the template (e.g. '' | ||
+ | |||
+ | == Change the package id == | ||
+ | |||
+ | < | ||
+ | <package | ||
+ | xmlns=" | ||
+ | xmlns: | ||
+ | xsi: | ||
+ | http:// | ||
+ | id=" | ||
+ | </ | ||
+ | to match the name of your OpenFOAM application '' | ||
+ | |||
+ | == Change the package prefix directory == | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | to be the directory location containing the different versions of your OpenFOAM application. | ||
+ | | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | == Add a version section for each OpenFOAM application version == | ||
+ | |||
+ | < | ||
+ | <version id=" | ||
+ | <script shell=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | where '' | ||
+ | | ||
+ | < | ||
+ | $WORKDIR/ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Naturally, if you require a different version of OpenFOAM and compiler for this version of your OpenFOAM application, | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | |||
+ | < | ||
+ | FOAM_INST_DIR=/ | ||
+ | WM_PROJECT_USER_DIR=$WORKDIR/ | ||
+ | source ${FOAM_INST_DIR}/ | ||
+ | </ | ||
+ | |||
+ | You can check your VALET package by using | ||
+ | |||
+ | < | ||
+ | vpkg_versions < | ||
+ | vpkg_info < | ||
+ | </ | ||
+ | |||
+ | ==== Use VALET to setup your OpenFOAM application and build it ==== | ||
+ | |||
+ | If you have correctly created and/or edited your VALET package for your OpenFOAM application package and version, then simply use the '' | ||
+ | |||
+ | For our sowfa version 2.0 based on OpenFOAM 2.1 and gcc example, we would use | ||
+ | |||
+ | < | ||
+ | vpkg_require sowfa/ | ||
+ | cd $WM_PROJECT_USER_DIR | ||
+ | Allwmake | ||
+ | </ | ||
+ | |||