GeoChemFoam Native version: Install GeoChemFoam from source code - GeoChemFoam/GeoChemFoam GitHub Wiki

Welcome to the GeoChemFoam wiki!

First things first, let's get GeoChemFoam working on your system. These instructions will be for using GeoChemFoam Native version. For GeoChemFoam with Docker, please refer to the GeoChemFoam with Docker: Set up

Prerequisite:

GeoChemFoam-5.1 uses the ESI OpenCFD Release OpenFOAM-v2212. It is also compatible with the previous versions OpenFoam-V2206, OpenFoam-v2112 and OpenFoam-v2106. Compatibility with earlier versions hasn't been tested. Installation instruction can be obtained at:

https://www.openfoam.com

Set-up file directory

Create a directory in your home folder named 'works':

mkdir $HOME/works

cd $HOME/works

Clone GeoChemFoam:

git clone https://github.com/GeoChemFoam/GeoChemFoam-5.1

Set-up the bashrc script:

The bashrc file gives the path to the openfoam directory, as well as a few aliases that are used during compilation. It is located in the 'etc' directory. To set-it up to your system, change line #13 and #14 according to your openfoam installation directories (nothing to do if in /usr/lib/openfoam). Then source the bashrc file.

source etc/bashrc

Create an alias

echo "alias gf51='source $HOME/works/GeoChemFoam-5.1/etc/bashrc'" >> $HOME/.bashrc

This line means that whenever you start a new terminal window or tab, you should run the alias command associated to GeoChemFoam-5.1. In other words, whenever you start a new terminal, you should run:

gf51

Compiling:

The following command compile the code:

./Allwmake

Checks

To check that the code has correctly compiled, one can run the checkInstall command:

./checkInstall.sh

If the code has compiled correctly, the final line should be:

Installation successful

Python for tutorial scripts:

If you are planning on running the tutorials, python is required. We recommend downloading and installing the latest version of anaconda (https://www.anaconda.com) for your system then:

conda create --name gcfoam python=3.12

conda init

close and reopen your terminal/cmd

conda activate gcfoam

pip install -r requirements.txt

The requirements.txt file can be downloaded from https://github.com/GeoChemFoam/GeoChemFoam.