-
Notifications
You must be signed in to change notification settings - Fork 37
Repository Installation
The following instructions are provided as a basis for compiling the repository on a typical Linux workstation and also under the premise that OpenFOAM has been compiled before. It also aims to ensure a complete installation, including building the paraFoam module. You may skip steps that do not apply to you as you see fit.
The repository includes more detailed documentation on the methods used in the Micro & Nano Flow (MNF) applications with the base Documentation folder, as well as a set of tutorial cases to get you started within the appropriate area of the Tutorials folder.
In the case that compilation is taking place in a more complex environment than a personal workstation, such as an HPC resource, it may be necessary to modify some steps in accordance with the operating environment available, you should contact your system administrator for further assistance in these cases as each system is different and it is unlikely we will be able to help directly.
If OpenFOAM has never been installed on the machine in question before then please review the general instructions available on the main OpenFOAM Foundation website, you may also wish to look at the OpenFOAMWiki installation guide documentation. As a general rule, if you can build and run the basic 2.4.0 package then you will be able to use the MicroNanoFlows repository also.
- Download the 2.4.0 ThirdParty archive (or pull a copy of the 2.4.x repository if you wish), this can be retrieved either through GitHub or by direct download from the OpenFOAM Foundation website.
- Clone a copy of the MicroNanoFlows OpenFOAM-2.4.0 repository to a directory of your choice.
- Extract the ThirdParty-2.4.0 archive to the same directory level and with the same name structure as the cloned repository folder (i.e. if this folder resides at $HOME/OpenFOAM/OpenFOAM-2.4.0-MNF then the ThirdParty folder needs to be at $HOME/OpenFOAM/ThirdParty-2.4.0-MNF). Please note: you will need to rename the default folder name extracted from the ThirdParty-2.4.0 archive.
- As with the standard version of OpenFOAM 2.4.0, if you expect to need further ThirdParty functionality (such as Metis) then please follow the usual steps to add these to the ThirdParty folder before compilation.
- This installation is designed to be built with GNU GCC (greater than 4.4) and applies system specific optimisations and random functionality optimisations. If you do NOT wish for this and want to build using typical GCC options or another compiler then:
- Modify the line "export WM_COMPILER=GccMNF" in OpenFOAM-2.4.0-MNF/etc/prefs.sh.
- If you want a standard GCC compilation, comment the line out entirely, if you want something else such as a different compiler then replace GccMNF with your own option and ensure that an appropriate "rules" folder exists in OpenFOAM-2.4.0-MNF/wmake/rules.
- Ensure the OpenFOAM home directory is set correctly if you have not cloned the repository to the default $HOME/OpenFOAM/OpenFOAM-2.4.0-MNF (otherwise this does not need editing):
- Edit /OpenFOAM-2.4.0-MNF/etc/bashc.
- Set foamInstall=$HOME/$WM_PROJECT on line 45 equal to the actual path of your installation.
- Ensure the MNF OpenFOAM bashrc file is sourced in your environment to set up your system variables. It is recommended this is done by creating an alias in your .bashrc file for future use, this example assumes your OpenFOAM directory is in the default location, however if you have put it somewhere else (i.e. the value you set foamInstall equal to in step 3) then please use this location instead:
- Edit $HOME/.bashrc.
- Add a new alias (updating anything in [] brackets): "alias of24MNF='source $HOME/OpenFOAM/OpenFOAM-2.4.0-MNF/etc/bashrc; export WM_NCOMPPROCS=[number of threads to compile with]'
- Source the newly modified .bashrc file (or open a new terminal).
- Load the newly created alias, there should be no errors.
- To compile the build please then follow these instructions in this order:
- Enter the ThirdParty folder.
- If your version of cmake is the same as or less than that provided by the ThirdParty 2.4.0 package (i.e. type cmake --version) then you are OK to proceed to step 7.4, otherwise go to 7.3.
- You need to use the version of cmake that ships with the ThirdParty 2.4.0 package or earlier for all components to compile (in fact any 2.8.x version should suffice apart from for compiling ParaView, where a version close to the one supplied by the ThirdParty package may be required, this is discussed later on in the guide), therefore type ./makeCmake, once complete type wmSET $FOAM_SETTINGS to add this cmake version to your path (this is only associated with your of24MNF alias so will only be loaded once that is).
- Type ./Allwmake, once this is complete if you do not want to build the paraFoam module then skip to step 8, otherwise type ./makeParaView4. If you get an error stating your Qt version is not high enough go to step 7.5, if it informs you that your cmake version is not high enough then go to step 7.6, otherwise go to step 7.7.
- If the makeParaView4 script informs you your Qt version is not high enough then:
- Ensure you have the latest Qt library installed in your machine (use your standard package manager) as well as a Qt4 installation. 7. Determine the location of the Qt4 libraries on your system, these are installed along with Qt5 for legacy purposes (this is likely to be something like /usr/lib/x86_64-linux-gnu/qt4, use qmake --version to help). 7. Try the makeParaView4 script again but this time with the added "-qmake" options, i.e. ./makeParaView4 -qmake /usr/lib/x86_64-linux-gnu/qt4.
- If the makeParaView4 script informs you your cmake version is not high enough then:
- enter the ThirdParty directory: cd $WM_THIRD_PARTY_DIR 7. Download a newer version of cmake: wget https://raw.github.com/wyldckat/scripts4OpenFOAM3rdParty/master/getCmake" 7. sed -i -e 's=version}.3=version}.12.1=' getCmake 7. chmod +x getCmake 7. ./getCmake 7. ./makeCmake 7. wmSET $FOAM_SETTINGS
- Once ParaView has built it informs you of 3 system variables that need to be exported, ParaView_Dir, PATH and PV_PLUGIN_PATH. It is recommended you add these as new exports to the end of your alias after the existing "export WM_NCOMPPROCS=".
- Either close your terminal session and re-open or source the new .bashrc file with source $HOME/.bashrc
- Load the new alias with the command of24MNF to ensure all paths are set. You will need to load this alias in the future before using any application within the repository.
- Enter the OpenFOAM-2.4.0-MNF folder and type ./Allwmake, once this is complete you will have a working OpenFOAM-2.4.0 installation that also includes the MicroNanoFlows group codes.