Ubuntu16.04 安装 OpenFOAM4.0
按照以下官网安装步骤操作。
https://openfoam.org/download/4-0-ubuntu/
sudo add-apt-repository http://dl.openfoam.org/ubuntu
sudo sh -c “wget -O - http://dl.openfoam.org/gpg.key | apt-key add -”
sudo apt-get update
sudo apt-get -y install openfoam4
// 执行这一步时网络一定要好,否则会中断下载。(或者搬梯子) 作者这一步执行了好多遍,终于完成了。作者这里比较慢,以小时计。
User Configuration
gedit ~/.bashrc
在.bashrc文件最后输入如下内容:
source /opt/openfoam4/etc/bashrc
// Note 1: If a similar line has already been added to the user’s .bashrc file, e.g. for a previous version of OpenFOAM, then the line should be deleted or, alternatively, commented out by inserting a # at the beginning of the line.
// 由于是 ~/.bashrc,因此只针对某个用户有用。如果其他用户想使用OpenFOAM时,需要对其他用户的 .bashrc 进行配置。
打开一个新终端查看安装是否成功:
simpleFoam -help
// Note 2: If a user wishes to execute simpleFoam in the same terminal window, they must first register the change to the .bashrc file by typing at the terminal prompt (note the dots): source $HOME/.bashrc