个人工具

“UbuntuHelp:OpenFOAM/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
Testing the installation 测试安装是否成功
How to install OpenFOAM CFD software 怎样安装OpenFOAM计算流体力学软件
 
(未显示3个用户的24个中间版本)
第7行: 第7行:
  
 
   
 
   
== How to install OpenFOAM CFD software 怎样安装OpenFOAM计算液体力学软件 ==
+
== How to install OpenFOAM CFD software 怎样安装OpenFOAM计算流体力学软件 ==
=== Introduction 简介 ===
+
简介  
  
This HowTo is aimed to all Engineers, Scientist, Students interested in learning/applying/experimenting Computational Fluids Dynamics (CFD)本教程为那些对学习、应用、实验计算液体力学(CFD)感兴趣的工程师、科学家和学生而创作, CFD uses numerical approximation to the partial differential equations that govern flow of fluids in nature (i.e. Navier-Stokes equation, etc) the solution of the Navier-Stokes equation once it comply with the requirements of the Continuity equation gives the behavior of the fluids subject to the given boundary and initial conditions. This has a tremendous importance since practically any fluid can be simulated/modelled in a computer before doing any 'real life' experiment. For example you can test the design of a new aircraft using computational techniques before even build a small scale prototype for wind tunnel testing. Thus a wide range of experimental conditions can be fully tested and corrected on the fly...
+
    本教程为那些对学习、应用、实验计算流体动力学(CFD)感兴趣的工程师、科学家和学生而创作。CFD采用数值逼近方法来求解控制自然流动的偏微分方程(如Navier-Stokes等),只要满足Navier-Stokes方程的连续性方程,就能求解出服从指定和初始条件下的流动现象,这在实践中有着极大的重要性,任何流体现象在进行真实试验之前都可以在计算机上进行模拟/建模,例如,在进行缩尺样机风洞测试之前,你可以通过计算模拟技术来验证一个新的飞机设计方案,因而可以在实验中对各种飞行状态进行全面的测试和校正】
Since the basic equations (full) that govern fluid flow are in form of PDEs, the numerical methods to approximate the solution are complex, a very simple problem can be solved in a couple of minutes however if the problem is much more complicated the solver can take days in find a solution... in general CFD is not intended for common PCs but for high end computers designed to tackle this kind of problems. Of course this cannot stop you, you can install this software in your computer and 'play' with simple geometries and doing a lot of assumptions to solve a given problem more easily.
+
      由于流动控制基本方程是偏微分方程,数值逼近求解方法非常复杂,一个简单问题的求解都需要几分钟,如果遇到更加复杂的问题,求解需要几天来得到一个结果……CFD通常不是运行在PC上的,而是专门运行在专门用于求解这类问题的高性能终端计算机上。当然这不是阻止你用,你可以在你的计算机上安装本软件,并求解简单的几何状态,为了求解容易做大量假设,世界上已经存在一些CFD的商业程序如Fluent, COMSOL, CFD-RC, CFD-ADAPCO,但它们是非常昂贵的。然而,也有一些免费的选择如ELMER Multiphysics, OpenFOAM 等。使用CFD软件从来都有点复杂,需要对给定问题的物理现象有深入的理解,并有较好的数学背景。
There are several CFD brands out there like Fluent, COMSOL, CFD-RC, CFD-ADAPCO, (which are quite expensive though) ... however there are also free alternatives like ELMER Multiphysics, OpenFOAM and many others.
+
Inherently CFD software is a bit complicated to use, it requires a deep understanding of the physical phenomena involved in given problem, and a good mathematical background.
+
  
=== AMD64 Systems 对于AMD64系统 ===
+
=== 对于AMD64系统 ===
If you are installing this on an AMD64 system, it is necessary to set the parameter $WM_64 to "on".  To achieve this, do the following in a terminal:
+
 
 +
如果要把它安装在 AMD64 系统上,必须把参数 $WM_64打开。在终端下按如下操作进行:
 
<pre><nowiki>
 
<pre><nowiki>
 
gedit ~/OpenFOAM/OpenFOAM-1.3/.bashrc
 
gedit ~/OpenFOAM/OpenFOAM-1.3/.bashrc
 
</nowiki></pre>
 
</nowiki></pre>
Then, I added directly above the Java section, the following:
+
,然后,在 Java 段上面我直接添加了下面几句:
 
<pre><nowiki>
 
<pre><nowiki>
# 64 Bit Machine set to on else set to blank
+
#   64位系统设为 on, 否则留空即可
 
WM_64="on"
 
WM_64="on"
 
</nowiki></pre>
 
</nowiki></pre>
  
After doing so you must source your bashrc to make sure the changes take effect.
+
完后为了使这些变化生效,你必须把这些变化提供给 bashrc。'''
 
<pre><nowiki>
 
<pre><nowiki>
 
. ~/.bashrc
 
. ~/.bashrc
 
</nowiki></pre>
 
</nowiki></pre>
N.B. it is . space ~/...
+
'注意这里是 .空格~/...'''
  
=== System requirements 系统要求 ===
+
                                                          == System requirements 系统要求 ===
  
(based on the specs of the PC tested for the installation)
+
(基于测试安装的个人电脑的配置)
  
* AMD Athlon XP LV 1500+ (or equivalent or higher or better or Intel or PowerPC)
+
AMD Athlon XP LV 1500+ (或相当及更好更高的配置,可以是Intel的或苹果的PowerPC,640MB内存(网站上未提及,大家都知道越多越好),有1GB可用硬盘空间,这是必须的,文件解压后占用750MB,另外还要留出实例、教程、网格等的存储空间,宽带连接(压缩文件平均有约50到100MB),当然也可以用拨号连接下载48小时,这取决于你……, 核心版本号是2.6.12-9-386,如果你下载的是64位(AMD64)版就用64位内核, 尚未在更高或更低的内核版本上测试,所以如果你的内核不是该版本,你需要试着测试一下, 不能保证它能在其他LINUX发行版上正常运行'''
* 640 MB (The web page states nothing, but everybody knows the more, the better)
+
* 1 GB hard drive available, this is a must, uncompressed files takes 750 MB, plus the cases, tutorials, grids, etc
+
* Broadband conection (the compressed files are from 50 to 100 MB average) of course you can use dial up and wait 48 hours to download it, it's up to you...
+
* Ubuntu LINUX 5.10 Breeze Badger Kernel version 2.6.12-9-386, if you download the AMD64 version then use the 64bit LINUX kernel
+
* Not tested on kernel versions above or below (you should try to do this if this is not yor kernel version)
+
* Not sure if this would work on other LINUX distributions
+
  
=== Step by step instructions 一步一步教你安装 ===
+
                                一步一步教你安装
  
1 * Check system requirements (listed above)
+
1 检查系统要求(上面已列出)
  
2 * Enter to OpenFOAM web page
+
2 '进入OpenFOAM网页'''
  
 
* http://www.openfoam.org
 
* http://www.openfoam.org
or
+
'或
 
* http://www.opencfd.co.uk
 
* http://www.opencfd.co.uk
  
3 * Click on download
+
3 * Click on download '''点击下载'''
4 * Select your version
+
 
5 * Dowload all the packges to your Desktop (very advance LINUX users can avoid obvious steps)
+
4 *选择你想要下载的版本
 +
 
 +
5 * '把程序包下载到你的桌面(LINUX高级用户可跳过这些简单步骤)'''
  
 
<pre><nowiki>
 
<pre><nowiki>
第62行: 第57行:
 
</nowiki></pre>
 
</nowiki></pre>
  
where ~/ is the home folder for example /home/<username>
+
'其中~/就是主文件夹,如 /home/<用户名>'''
  
N.B from this point it is necesary to remenber that LINUX is CASE SENSITIVE, a mistake can delay you some hours...
+
注意,这里需要记住LINUX对大小写敏感,一个小小的错误就能耽搁你好几个小时'''
  
second I did install everything in my home folder which is ~/ it is the recommended option from the web site
+
第二,我都是在我的主文件夹~/下进行所有安装的,这是“官方”网站上建议的选择'''
  
  
6 * create a folder caller OpenFOAM in ~/ using mkdir
+
6 * ~/下用mkdir命令建立一个叫做OpenFOAM的文件夹'''
  
copy
+
  复制
  
 
* OpenFOAM-1.3.General.gtgz
 
* OpenFOAM-1.3.General.gtgz
第77行: 第72行:
 
* OpenFOAM-1.3.linuxGcc4SPOpt.gtgz
 
* OpenFOAM-1.3.linuxGcc4SPOpt.gtgz
  
which are on ~/Desktop to the folder you've just created ~/OpenFOAM
+
  它们都在~/Desktop(桌面)上,将其复制到刚刚建立的 ~/OpenFOAM下
  
7 * create the following folder using mkdir (remember LINUX is case sensitive)
+
7 * 用mkdir命令建立如下文件夹(注意LINUX对大小写敏感)'''
  
 
<pre><nowiki>
 
<pre><nowiki>
第85行: 第80行:
 
</nowiki></pre>
 
</nowiki></pre>
  
8 * copy
+
8   复制
  
 
* gcc-4.1.0.linux.tgz
 
* gcc-4.1.0.linux.tgz
 
* paraview-2.4.2.linux.tgz
 
* paraview-2.4.2.linux.tgz
 
* j2sdk1.4.2_05.linux.tgz
 
* j2sdk1.4.2_05.linux.tgz
* which are in ~/Desktop to ~/OpenFOAM/linux
+
将其从 ~/Desktop 复制到 ~/OpenFOAM/linux
 
+
9 * 按照下面的顺序解压各文件
9 * untar avery single file in the following order
+
  
 
* OpenFOAM-1.3.General.gtgz
 
* OpenFOAM-1.3.General.gtgz
第101行: 第95行:
 
* j2sdk1.4.2_05.linux.tgz
 
* j2sdk1.4.2_05.linux.tgz
  
typing
+
  解压命令格式
  
 
<pre><nowiki>
 
<pre><nowiki>
tar -xzvf <filename>
+
tar -xzvf <filename>          tar -xzvf <文件名>
 
</nowiki></pre>
 
</nowiki></pre>
  
This takes a bit of time
+
  这个过程需要一些时间
  
10 * after finishing you will see new directories created in ~/OpenFOAM
+
10 * 完后你就会在~/OpenFOAM 下看到几个新目录
  
11 * now look for foamSystemCheck
+
11 现在找一下foamSystemCheck 它位于'
which is located at
+
  
 
<pre><nowiki>
 
<pre><nowiki>
 
~/OpenFOAM/OpenFOAM-1.3/bin
 
~/OpenFOAM/OpenFOAM-1.3/bin
 
</nowiki></pre>
 
</nowiki></pre>
 +
  这是一个我们要运行的shell脚本,但首先我们得将它变成可执行的格式
  
this is a shell script that we have to execute, however we need to change it to an executable format
+
  输入
 
+
type
+
  
 
<pre><nowiki>
 
<pre><nowiki>
chmod -v 555 foamSystemCheck
+
chmod -v 555 foamSystemCheck(直接拖路径过来)
 
</nowiki></pre>
 
</nowiki></pre>
  
press enter, then type
+
  回车,然后输入
  
 
<pre><nowiki>
 
<pre><nowiki>
[[UbuntuHelp:export PATH=$PATH:~/OpenFOAM/OpenFOAM-1.3/bin/]]
+
export PATH=$PATH:~/home/ying/OpenFOAM/OpenFOAM-1.7.1/bin  
 
</nowiki></pre>
 
</nowiki></pre>
  
press enter, then type
+
  回车,再输入
  
 
<pre><nowiki>
 
<pre><nowiki>
foamSystemCheck
+
/home/ying/OpenFOAM/OpenFOAM-1.7.1/bin/foamSystemCheck  
 
</nowiki></pre>
 
</nowiki></pre>
  
press enter
+
  回车
  
At this time, the shell script will call some functions to check if your system comply with the minimum requirements for the installation, Host, username, Linux version, and Network conectivity, however at the end of the process some error occur, just ignore any warning or fatal error about ssh or rsh, this is not needed for the stand alone installation (It doesn't matter what it tells you, just ignore it!!!)
+
      这时shell脚本将调用一些命令来检查是否满足安装的最低要求,主机、用户名、Linux 版本及网络连接等等,如果在处理的最后会报一些错,就忽略它报告的那些关于ssh或rsh的警告或致命错误,对于仅仅安装来说这没必要(不管它报告给你了什么,尽管忽略!!!)
  
type
+
  输入
  
 
<pre><nowiki>
 
<pre><nowiki>
chmod -v 755 foamSystemCheck
+
chmod -v 755 /home/ying/OpenFOAM/OpenFOAM-1.7.1/bin/foamSystemCheck
 
</nowiki></pre>
 
</nowiki></pre>
  
press enter
+
    回车
  
12 * * * * * *
+
12 * * 现在你须要为文件的正确读写设置环境变量,环境变量的设置存储在
Now you have to set the environment variables for a correct file access, the environment variable settings are stored in
+
  
 
<pre><nowiki>
 
<pre><nowiki>
第157行: 第148行:
 
</nowiki></pre>
 
</nowiki></pre>
  
since I am using the default options in UBUNTU, my shell is BASH and my text editor is gedit, you can use VIM as well
+
因为我在UBUNTU下用的是默认配置,我的 shell 是 BASH, 文件编辑器是 gedit, 也可以用 VIM'''
  
type
+
  输入
  
 
<pre><nowiki>
 
<pre><nowiki>
第165行: 第156行:
 
</nowiki></pre>
 
</nowiki></pre>
  
(if you are not sure which shell you are using and edit the following files according to your shell syntax)
+
(如果你不确定自己用的是哪个 shell 环境,按照你的 shell 的格式要求编辑如下文件
  
now type
+
  输入
  
 
<pre><nowiki>
 
<pre><nowiki>
第173行: 第164行:
 
</nowiki></pre>
 
</nowiki></pre>
  
once in gedit type
+
  进入 gedit 编辑环境后输入
  
 
<pre><nowiki>
 
<pre><nowiki>
. ~/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/bashrc
+
. ~/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc
 
</nowiki></pre>
 
</nowiki></pre>
  
N.B. it is 'dot', space~/.......
+
    注意是‘点’,空格~/......
select file>save
+
  点 文件>保存
and then file>quit
+
  然后点 文件>退出
 
+
现在更新环境,输入
now update the environment typing
+
  
 
<pre><nowiki>
 
<pre><nowiki>
 
. ~/.bashrc
 
. ~/.bashrc
 
</nowiki></pre>
 
</nowiki></pre>
N.B. it is 'dot', space ~/.......
+
  注意是'',空格~/.......
  
the environment variables are updated, you can see this if you type
+
'环境变量更新了,输入以下命令可以确认
  
 
<pre><nowiki>
 
<pre><nowiki>
第198行: 第188行:
 
=== Testing the installation 测试安装是否成功 ===
 
=== Testing the installation 测试安装是否成功 ===
  
13 **** look for foamInstallationTest which it is located at
+
13 **** look for foamInstallationTest which it is located at&nbsp;&nbsp;&nbsp; '''在下面的目录下找到文件foamInstallationTest'''<br>
 +
<pre>~/OpenFOAM/OpenFOAM-1.3/bin
 +
</pre>
 +
in the same way, this file is a shell script&nbsp;&nbsp;&nbsp;&nbsp; '''同样的,该文件也是一个shell脚本'''<br>
  
<pre><nowiki>
+
type&nbsp;&nbsp;&nbsp;&nbsp; '''输入'''<br>
~/OpenFOAM/OpenFOAM-1.3/bin
+
<pre>chmod -v 555 foamInstallationTest(直接拖路径过来)
</nowiki></pre>
+
</pre>  
 +
press enter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''回车'''<br>
  
in the same way, this file is a shell script
+
now you don't need to export the path, since you have already done it...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''现在你不必输出路径了,因为它已经实现了'''<br>
  
type
+
now type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''输入'''<br>
 +
<pre>foamInstallationTest
 +
</pre>
 +
press enter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''回车'''<br>
  
<pre><nowiki>
+
here the shell scrip verifies every directory and assigns to each of them an environment variable (PATH), also this takes a bit of time. However you will see an error at the end of the process, something like this:
chmod -v 555 foamInstallationTest
+
</nowiki></pre>
+
  
press enter
+
'''这里shell脚本确定各路径并指定它们的变量(路径PATH),这个个过程也要用一定的时间。但你将会在最后看到一个错误,像这样:'''
  
now you don't need to export the path, since you have already done it...
+
test_rsh unsuccessful_conection_refused* test_ssh unsuccessful_conection_refused*
  
now type
+
FATAL: No remote shell available (etc....)
  
<pre><nowiki>
+
For the stand alone version, this message is normal and you can safely ignore it, just after this OpenFOAM is ready to run
foamInstallationTest
+
</nowiki></pre>
+
  
press enter
+
'''就此版本而言,这个错误是正常的,你可以安全的忽略,完后OpenFOAM就可以运行了'''
  
here the shell scrip verifies every directory and assigns to each of them an environment variable (PATH), also this takes a bit of time. However you will see an error at the end of the process, something like this:
+
=== Getting started with OpenFOAM 开始 OpenFOAM 之旅 ===
  
test_rsh unsuccessful_conection_refused*
+
Library documentation is included in&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '''库文档位于'''<br>
test_ssh unsuccessful_conection_refused*
+
<pre>~/OpenFOAM/OpenFOAM-1.3/doc/Guides-a4
 +
</pre>
 +
you will find there some PDFs with tutorials and very useful examples, after a short reading you can start modelling right away.
  
FATAL: No remote shell available (etc....)
+
'''在这里你会找到若干教程和实例的PDF文件,简单阅读后你就能开始立即建模了'''
  
For the stand alone version, this message is normal and you can safely ignore it, just after this OpenFOAM is ready to run
+
=== Troubleshooting 常见问题 ===
  
=== Getting started with OpenFOAM ===
+
When installing this on a Dapper 64-bit system, I ran into the problem that the default JAVA_HOME, and therefore JAVA_PATH were directed to the following:
  
Library documentation is included in
+
'''在64位Dapper系统上安装时,我碰巧遇上了默认JAVA目录(JAVA_HOME)的问题,JAVA_PATH原定义路径是:'''
 +
<pre>/home/&lt;username&gt;/OpenFOAM/&lt;architecture&gt;/j2sdk1.4.2_05
 +
</pre>
 +
where there should be an OpenFOAM-1.3 directory after the OpenFOAM directory. To fix this, I opened a terminal and did the following:
  
<pre><nowiki>
+
'''这里在OpenFOAM路径後应该是OpenFOAM-1.3路径。纠正方法是,打开一个终端,然後:'''
~/OpenFOAM/OpenFOAM-1.3/doc/Guides-a4
+
<pre>gedit ~/OpenFOAM/OpenFOAM-1.3/.bashrc
</nowiki></pre>
+
</pre>  
 +
Then, browse to the Java section, under the # Linux Workstation subsection, edit the export JAVA_HOME line to look like the following:
  
you will find there some PDFs with tutorials and very useful examples, after a short reading you can start modelling right away.
+
'''然後,浏览到Java一节,在# Linux Workstation subsection 後编辑export JAVA_HOME 行,如下:'''
 +
<pre>export JAVA_HOME=$WM_PROJECT_INST_DIR/OpenFOAM-1.3/$WM_ARCH/j2sdk1.4.2_05
 +
</pre>
 +
Then save and close, and source your bashrc
  
=== Troubleshooting ===
+
'''保存并关闭,source 你的bashrc(不知道怎么翻译,译者注)'''
When installing this on a Dapper 64-bit system, I ran into the problem that the default JAVA_HOME, and therefore JAVA_PATH were directed to the following:
+
<pre>. ~/.bashrc
<pre><nowiki>
+
</pre>  
/home/<username>/OpenFOAM/<architecture>/j2sdk1.4.2_05
+
</nowiki></pre>
+
where there should be an OpenFOAM-1.3 directory after the OpenFOAM directory.  To fix this, I opened a terminal and did the following:
+
<pre><nowiki>
+
gedit ~/OpenFOAM/OpenFOAM-1.3/.bashrc
+
</nowiki></pre>
+
Then, browse to the Java section, under the # Linux Workstation subsection, edit the export JAVA_HOME line to look like the following:
+
<pre><nowiki>
+
export JAVA_HOME=$WM_PROJECT_INST_DIR/OpenFOAM-1.3/$WM_ARCH/j2sdk1.4.2_05
+
</nowiki></pre>
+
Then save and close, and source your bashrc
+
<pre><nowiki>
+
. ~/.bashrc
+
</nowiki></pre>
+
 
N.B. it is . space ~/....
 
N.B. it is . space ~/....
  
=== Acknowledgements ===
+
'''注意是:&nbsp; 空格~/……'''
 +
 
 +
=== Acknowledgements 致谢 ===
  
 
* Thank you to the OpenFOAM CFD developement team for making it available under the GLP.
 
* Thank you to the OpenFOAM CFD developement team for making it available under the GLP.
 +
 +
'''感谢OpenFOAM CFD 开发团队在通用许可证(GPL)下发布这个软件'''
 +
 
* Thank you to Ubuntu Team for the great effort in this Operating System
 
* Thank you to Ubuntu Team for the great effort in this Operating System
 +
 +
'''感谢Ubuntu团队在这个操作系统上付出的巨大辛劳'''
 +
 
* Thank you for reading this wiki
 
* Thank you for reading this wiki
 +
 +
'''感谢你阅读本维基'''
 +
 
* This wiki is based in my previous Ubuntu Forum Thread [http://ubuntuforums.org/showthread.php?t=156298 ScientificUbuntu Installing OpenFOAM CFD Software]
 
* This wiki is based in my previous Ubuntu Forum Thread [http://ubuntuforums.org/showthread.php?t=156298 ScientificUbuntu Installing OpenFOAM CFD Software]
 +
 +
'''本维基基于我先前在Ubuntu论坛上的帖子(……有兴趣点原文链接吧)'''
  
 
* * * * * derjames * * * * *
 
* * * * * derjames * * * * *
 +
 
----
 
----
[[category:CategoryCleanup]] [[category:CategoryScience]]
 
  
[[category:UbuntuHelp]]
+
[[Category:CategoryCleanup]] [[Category:CategoryScience]] [[Category:UbuntuHelp]]

2010年10月31日 (日) 10:51的最新版本

文章出处: http://wiki.ubuntu.org.cn/index.php?title=UbuntuHelp:OpenFOAM

翻译人员: HsChen07


编辑


How to install OpenFOAM CFD software 怎样安装OpenFOAM计算流体力学软件

简介 
   本教程为那些对学习、应用、实验计算流体动力学(CFD)感兴趣的工程师、科学家和学生而创作。CFD采用数值逼近方法来求解控制自然流动的偏微分方程(如Navier-Stokes等),只要满足Navier-Stokes方程的连续性方程,就能求解出服从指定和初始条件下的流动现象,这在实践中有着极大的重要性,任何流体现象在进行真实试验之前都可以在计算机上进行模拟/建模,例如,在进行缩尺样机风洞测试之前,你可以通过计算模拟技术来验证一个新的飞机设计方案,因而可以在实验中对各种飞行状态进行全面的测试和校正】
     由于流动控制基本方程是偏微分方程,数值逼近求解方法非常复杂,一个简单问题的求解都需要几分钟,如果遇到更加复杂的问题,求解需要几天来得到一个结果……CFD通常不是运行在PC上的,而是专门运行在专门用于求解这类问题的高性能终端计算机上。当然这不是阻止你用,你可以在你的计算机上安装本软件,并求解简单的几何状态,为了求解容易做大量假设,世界上已经存在一些CFD的商业程序如Fluent, COMSOL, CFD-RC, CFD-ADAPCO,但它们是非常昂贵的。然而,也有一些免费的选择如ELMER Multiphysics, OpenFOAM 等。使用CFD软件从来都有点复杂,需要对给定问题的物理现象有深入的理解,并有较好的数学背景。
=== 对于AMD64系统 ===

如果要把它安装在 AMD64 系统上,必须把参数 $WM_64打开。在终端下按如下操作进行:

gedit ~/OpenFOAM/OpenFOAM-1.3/.bashrc

,然后,在 Java 段上面我直接添加了下面几句:

#   64位系统设为 on, 否则留空即可
WM_64="on"

完后为了使这些变化生效,你必须把这些变化提供给 bashrc。

. ~/.bashrc

'注意这里是 .空格~/...

                                                          == System requirements 系统要求 ===

(基于测试安装的个人电脑的配置)

AMD Athlon XP LV 1500+ (或相当及更好更高的配置,可以是Intel的或苹果的PowerPC,640MB内存(网站上未提及,大家都知道越多越好),有1GB可用硬盘空间,这是必须的,文件解压后占用750MB,另外还要留出实例、教程、网格等的存储空间,宽带连接(压缩文件平均有约50到100MB),当然也可以用拨号连接下载48小时,这取决于你……, 核心版本号是2.6.12-9-386,如果你下载的是64位(AMD64)版就用64位内核, 尚未在更高或更低的内核版本上测试,所以如果你的内核不是该版本,你需要试着测试一下, 不能保证它能在其他LINUX发行版上正常运行

                                一步一步教你安装

1 检查系统要求(上面已列出)

2 '进入OpenFOAM网页

'或

3 * Click on download 点击下载

4 *选择你想要下载的版本

5 * '把程序包下载到你的桌面(LINUX高级用户可跳过这些简单步骤)

~/Desktop

'其中~/就是主文件夹,如 /home/<用户名>

注意,这里需要记住LINUX对大小写敏感,一个小小的错误就能耽搁你好几个小时

第二,我都是在我的主文件夹~/下进行所有安装的,这是“官方”网站上建议的选择


6 * 在~/下用mkdir命令建立一个叫做OpenFOAM的文件夹

  复制
  • OpenFOAM-1.3.General.gtgz
  • OpenFOAM-1.3.linuxGcc4DPOpt.gtgz
  • OpenFOAM-1.3.linuxGcc4SPOpt.gtgz
 它们都在~/Desktop(桌面)上,将其复制到刚刚建立的 ~/OpenFOAM下

7 * 用mkdir命令建立如下文件夹(注意LINUX对大小写敏感)

~/OpenFOAM/linux

8 复制

  • gcc-4.1.0.linux.tgz
  • paraview-2.4.2.linux.tgz
  • j2sdk1.4.2_05.linux.tgz

将其从 ~/Desktop 复制到 ~/OpenFOAM/linux 9 * 按照下面的顺序解压各文件

  • OpenFOAM-1.3.General.gtgz
  • OpenFOAM-1.3.linuxGcc4DPOpt.gtgz
  • OpenFOAM-1.3.linuxGcc4SPOpt.gtgz
  • gcc-4.1.0.linux.tgz
  • paraview-2.4.2.linux.tgz
  • j2sdk1.4.2_05.linux.tgz
 解压命令格式
tar -xzvf <filename>          tar -xzvf <文件名>
 这个过程需要一些时间

10 * 完后你就会在~/OpenFOAM 下看到几个新目录

11 现在找一下foamSystemCheck 它位于'

~/OpenFOAM/OpenFOAM-1.3/bin
 这是一个我们要运行的shell脚本,但首先我们得将它变成可执行的格式
 输入
chmod -v 555 foamSystemCheck(直接拖路径过来)
  回车,然后输入
 export PATH=$PATH:~/home/ying/OpenFOAM/OpenFOAM-1.7.1/bin 
 回车,再输入
 /home/ying/OpenFOAM/OpenFOAM-1.7.1/bin/foamSystemCheck 
 回车
     这时shell脚本将调用一些命令来检查是否满足安装的最低要求,主机、用户名、Linux 版本及网络连接等等,如果在处理的最后会报一些错,就忽略它报告的那些关于ssh或rsh的警告或致命错误,对于仅仅安装来说这没必要(不管它报告给你了什么,尽管忽略!!!)
 输入
chmod -v 755 /home/ying/OpenFOAM/OpenFOAM-1.7.1/bin/foamSystemCheck
   回车

12 * * 现在你须要为文件的正确读写设置环境变量,环境变量的设置存储在

~/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3
因为我在UBUNTU下用的是默认配置,我的 shell 是 BASH, 文件编辑器是 gedit, 也可以用 VIM
  输入
echo $SHELL

(如果你不确定自己用的是哪个 shell 环境,按照你的 shell 的格式要求编辑如下文件

 输入
gedit ~/.bashrc &
  进入 gedit 编辑环境后输入
. ~/OpenFOAM/OpenFOAM-1.7.1/etc/bashrc
    注意是‘点’,空格~/......
 点 文件>保存
 然后点 文件>退出
现在更新环境,输入
. ~/.bashrc
  注意是'点',空格~/.......

'环境变量更新了,输入以下命令可以确认

echo $PATH

Testing the installation 测试安装是否成功

13 **** look for foamInstallationTest which it is located at    在下面的目录下找到文件foamInstallationTest

~/OpenFOAM/OpenFOAM-1.3/bin

in the same way, this file is a shell script     同样的,该文件也是一个shell脚本

type     输入

chmod -v 555 foamInstallationTest(直接拖路径过来)

press enter      回车

now you don't need to export the path, since you have already done it...       现在你不必输出路径了,因为它已经实现了

now type      输入

foamInstallationTest

press enter      回车

here the shell scrip verifies every directory and assigns to each of them an environment variable (PATH), also this takes a bit of time. However you will see an error at the end of the process, something like this:

这里shell脚本确定各路径并指定它们的变量(路径PATH),这个个过程也要用一定的时间。但你将会在最后看到一个错误,像这样:

test_rsh unsuccessful_conection_refused* test_ssh unsuccessful_conection_refused*

FATAL: No remote shell available (etc....)

For the stand alone version, this message is normal and you can safely ignore it, just after this OpenFOAM is ready to run

就此版本而言,这个错误是正常的,你可以安全的忽略,完后OpenFOAM就可以运行了

Getting started with OpenFOAM 开始 OpenFOAM 之旅

Library documentation is included in      库文档位于

~/OpenFOAM/OpenFOAM-1.3/doc/Guides-a4

you will find there some PDFs with tutorials and very useful examples, after a short reading you can start modelling right away.

在这里你会找到若干教程和实例的PDF文件,简单阅读后你就能开始立即建模了

Troubleshooting 常见问题

When installing this on a Dapper 64-bit system, I ran into the problem that the default JAVA_HOME, and therefore JAVA_PATH were directed to the following:

在64位Dapper系统上安装时,我碰巧遇上了默认JAVA目录(JAVA_HOME)的问题,JAVA_PATH原定义路径是:

/home/<username>/OpenFOAM/<architecture>/j2sdk1.4.2_05

where there should be an OpenFOAM-1.3 directory after the OpenFOAM directory. To fix this, I opened a terminal and did the following:

这里在OpenFOAM路径後应该是OpenFOAM-1.3路径。纠正方法是,打开一个终端,然後:

gedit ~/OpenFOAM/OpenFOAM-1.3/.bashrc

Then, browse to the Java section, under the # Linux Workstation subsection, edit the export JAVA_HOME line to look like the following:

然後,浏览到Java一节,在# Linux Workstation subsection 後编辑export JAVA_HOME 行,如下:

export JAVA_HOME=$WM_PROJECT_INST_DIR/OpenFOAM-1.3/$WM_ARCH/j2sdk1.4.2_05

Then save and close, and source your bashrc

保存并关闭,source 你的bashrc(不知道怎么翻译,译者注)

. ~/.bashrc

N.B. it is . space ~/....

注意是:  空格~/……

Acknowledgements 致谢

  • Thank you to the OpenFOAM CFD developement team for making it available under the GLP.

感谢OpenFOAM CFD 开发团队在通用许可证(GPL)下发布这个软件

  • Thank you to Ubuntu Team for the great effort in this Operating System

感谢Ubuntu团队在这个操作系统上付出的巨大辛劳

  • Thank you for reading this wiki

感谢你阅读本维基

本维基基于我先前在Ubuntu论坛上的帖子(……有兴趣点原文链接吧)

  • * * * * derjames * * * * *