|
|
# Debian/Ubuntu repositories for OpenFOAM
|
|
|
|
|
|
## Initial setup
|
|
|
|
|
|
To use these repositories, you will need to add the signing key and the
|
|
|
repository location(s) to your system.
|
|
|
This typically only needs to be done once per distribution.
|
|
|
|
|
|
The most convenient way is to use the
|
|
|
[installer script](https://dl.openfoam.com/add-debian-repo.sh).
|
|
|
Depending if you have `curl` or `wget` installed:
|
|
|
```
|
|
|
curl -s https://dl.openfoam.com/add-debian-repo.sh | sudo bash
|
|
|
```
|
|
|
or
|
|
|
```
|
|
|
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash
|
|
|
```
|
|
|
|
|
|
This adds a [signing key](https://dl.openfoam.com/pubkey.gpg)
|
|
|
for the repository, and repository information for a given distribution
|
|
|
(eg, _buster_, _focal_, etc.):
|
|
|
```
|
|
|
deb [arch=amd64] https://dl.openfoam.com/repos/deb DIST main
|
|
|
```
|
|
|
|
|
|
The installer script also invokes an `apt-get update` to refresh the
|
|
|
repositories.
|
|
|
|
|
|
You should now be able to install your preferred OpenFOAM package.
|
|
|
For example,
|
|
|
```
|
|
|
$ sudo apt-get install openfoam1912-default
|
|
|
```
|
|
|
|
|
|
|
|
|
### Installation Locations
|
|
|
|
|
|
The packages are designed to allow simultaneous installation of
|
|
|
different OpenFOAM versions (eg, 1912, 2006).
|
|
|
They are all installed under `/usr/lib/openfoam`. For example,
|
|
|
|
|
|
- `/usr/lib/openfoam/openfoam1912`.
|
|
|
- `/usr/lib/openfoam/openfoam2006`.
|
|
|
- ...
|
|
|
|
|
|
In addition, an OpenFOAM bash session wrapper will be created under
|
|
|
`/usr/bin`. For example,
|
|
|
- `/usr/bin/openfoam1912`
|
|
|
- `/usr/bin/openfoam2006`
|
|
|
- ...
|
|
|
|
|
|
|
|
|
After migrating from one version to another, you can remove the old
|
|
|
version with the usual commands. For example,
|
|
|
```
|
|
|
$ sudo apt-get autoremove openfoam1912-default
|
|
|
```
|
|
|
|
|
|
|
|
|
## OpenFOAM Debian Package Description
|
|
|
|
|
|
OpenFOAM is currently split into a number of sub-packages as follows
|
|
|
(where _VER_ refers to the API version such as 1912 etc):
|
|
|
|
|
|
- `openfoamVER-default`
|
|
|
- Meta package for everything normally needed.
|
|
|
- Includes `openfoamVER`, `openfoamVER-dev`, `openfoamVER-tutorials`
|
|
|
- `openfoamVER`
|
|
|
- The OpenFOAM runtime. Solvers, utilities and libraries.
|
|
|
- `openfoamVER-dev`
|
|
|
- Source code headers and wmake build chain.
|
|
|
Needed for developing with OpenFOAM, but also if dynamic code
|
|
|
compilation is required.
|
|
|
- `openfoamVER-tutorials`
|
|
|
- Tutorials
|
|
|
|
|
|
The following are normally only installed indirectly:
|
|
|
- `openfoamVER-common`
|
|
|
- Version information and share files (including the `etc/` directory)
|
|
|
- `openfoamVER-tools`
|
|
|
- Binaries for OpenFOAM-specific build tools.
|
|
|
|
|
|
|
|
|
### Using the OpenFOAM environment
|
|
|
|
|
|
The bash session wrapper provide the simplest means of starting
|
|
|
OpenFOAM immediately. For example,
|
|
|
```
|
|
|
$ openfoam1912
|
|
|
```
|
|
|
This can be used for an interactive bash session, or to run a single
|
|
|
OpenFOAM command within the OpenFOAM environment.
|
|
|
|
|
|
|
|
|
For a persistent OpenFOAM environment, the OpenFOAM bashrc file can be
|
|
|
sourced from your `~/.bashrc` file by adding a line resembling the
|
|
|
following to that file:
|
|
|
```
|
|
|
source /usr/lib/openfoam/openfoam1912/etc/bashrc
|
|
|
```
|
|
|
The exact path used will change depending on the OpenFOAM version.
|
|
|
|
|
|
|
|
|
Never attempt to embed the shell session wrapper as part of your
|
|
|
`~/.bashrc` - this may cause an infinite loop!
|
|
|
|
|
|
---
|
|
|
Copyright (C) 2020 OpenCFD Ltd. |