查看“︁OpenFOAM”︁的源代码
←
OpenFOAM
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{NoteTA|G1=IT|G2=FL|G3=Science}} {{Infobox Software | name = OpenFOAM | logo = | screenshot = [[File:Screenshot OpenFOAM-2.1.x gnome-terminal.png|200px]] | caption = 在命令行窗口中运行的OpenFOAM | author = Henry Weller | developer = The OpenFOAM Foundation | released = 2004-12-10 | latest release version = 4.1 | latest release date = {{Release date and age|2016|10|13}} | programming language = C++ | operating system = [[Unix]]/[[Linux]] | status = 运行中 | genre = [[计算流体力学]] | license = [[GNU通用公共许可证]] | website = [http://www.openfoam.org www.openfoam.org] }} '''OpenFOAM'''(英文 Open Source Field Operation and Manipulation 的缩写,意为开源的场运算和处理软件)是对[[连续介质力学]]问题进行[[数值计算]]的[[C++]][[自由软件]]工具包,其代码遵守[[GNU通用公共许可证]]。它可进行数据预处理、后处理和自定义求解器,常用于[[计算流体力学|计算流体力学(CFD)]]领域。该软件由OpenFOAM基金会维护<ref>[http://www.openfoam.org/ The OpenFOAM Foundation homepage]</ref>(商标'''OpenFOAM'''的拥有者[[硅谷图形公司|硅谷图形公司(SGI)]]赞助)。 ==历史== OpenFOAM的早期开发始于1980年代末期的[[伦敦帝国学院]],其目标是为了编写一个相对于当时事实上的标准,[[FORTRAN]],更为强大和灵活的通用模拟计算平台。并且因此选择了拥有高度[[模組 (程式設計)|模块化]]和[[面向对象]]特性的[[C++]]作为其编程语言。在2004年OpenFOAM以开源方式发布之前,英国Nabla有限公司曾销售过FOAM,OpenFOAM的前身。<ref>[http://www.openfoam.org/download/history.php OpenFOAM Release History]</ref>2011年8月15日,[[OpenCFD]]宣布它被[[硅谷图形公司|硅谷图形公司(SGI)]]收购。<ref>{{cite web |url=http://www.sgi.com/company_info/newsroom/press_releases/2011/august/opencfd.html |title=存档副本 |accessdate=2016-08-23 |deadurl=yes |archiveurl=https://web.archive.org/web/20121206010926/http://www.sgi.com/company_info/newsroom/press_releases/2011/august/opencfd.html |archivedate=2012-12-06 }}</ref> OpenFOAM是最早的用C++写成的重要科学计算软件包之一{{citation needed|date=October 2011}}。现已成为使用多面体网格的最主要的通用[[计算流体力学|计算流体力学(CFD)]]软件. == 特色 == === 语法 === OpenFOAM一个非常有特色的地方是它描述[[张量]]和[[偏微分方程]]的语法与被求解的方程本身非常相似,事实上便捷地在程序中表达传统的数学记号正是其语法设计的目标。例如方程<ref>{{Cite web |url=http://www.openfoam.com/features/creating-solvers.php |title=Creating solvers in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-08-07 |archive-url=https://web.archive.org/web/20120807151621/http://www.openfoam.com/features/creating-solvers.php |dead-url=no }}</ref> : <math> \frac{\partial \rho \mathbf{U}}{\partial t} + \nabla \cdot\phi\mathbf{U} - \nabla \cdot\mu\nabla\mathbf{U} = - \nabla p </math> 对应的OpenFOAM代码是 <syntaxhighlight lang = "cpp"> solve ( fvm::ddt(rho,U) + fvm::div(phi,U) - fvm::laplacian(mu,U) == - fvc::grad(p) ); </syntaxhighlight> 得益于[[面向对象程序设计|面向对象的程序设计]]和[[运算符重载]],使用者可以相对容易地建立自己的求解器。然而,大量[[模板超编程|模板元编程]]的运用以及相应开发文档的缺乏,使得越是深入库底层的定制化越是困难和充满挑战。 === 可扩展性 === 由于使用了[[工厂方法]]和[[类 (计算机科学)|基类]]作为[[介面 (程式設計)|接口]],OpenFOAM具有很好的可扩展性。使用者在建立定制化的物体或对象(例如[[边界条件]]或湍流模型)时,无需修改或是重新编译OpenFOAM软件包,便可在已有的求解器上工作。OpenFOAM称之为''运行时决策(run-time selection)''<ref>{{Cite web |url=http://openfoamwiki.net/index.php/OpenFOAM_guide/runTimeSelection_mechanism |title=OpenFOAM's ''run-time selection mechanism'' explained |accessdate=2012-07-17 |archive-date=2014-01-08 |archive-url=https://web.archive.org/web/20140108081930/http://openfoamwiki.net/index.php/OpenFOAM_guide/runTimeSelection_mechanism |dead-url=no }}</ref> ==OpenFOAM的架构== OpenFOAM核心功能的实现是由大量的基础库完成的,其中包括: * 张量和场操作 * 人类可读的偏微分方程离散化语法 * [[线性系统]]求解<ref>{{Cite web |url=http://www.openfoam.com/features/linear-solvers.php |title=Linear system solvers in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001443/http://www.openfoam.com/features/linear-solvers.php |dead-url=no }}</ref> * 常微分方程求解<ref>{{Cite web |url=http://www.openfoam.com/features/ODE-solvers.php |title=Ordinary differential equation solvers in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-08-07 |archive-url=https://web.archive.org/web/20120807151833/http://www.openfoam.com/features/ODE-solvers.php |dead-url=no }}</ref> * 高级操作的自动并行化 * 动态网格<ref>{{Cite web |url=http://www.openfoam.com/features/mesh-motion.php |title=Dynamic mesh in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001519/http://www.openfoam.com/features/mesh-motion.php |dead-url=no }}</ref> * 通用物理模型 ** 流变模型(Rheological models)<ref>{{Cite web |url=http://www.openfoam.com/features/transport.php |title=Rheological models in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001608/http://www.openfoam.com/features/transport.php |dead-url=no }}</ref> ** 热力学模型及相关的数据库<ref>{{Cite web |url=http://www.openfoam.com/features/thermophysical.php |title=Thermophysical models in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001615/http://www.openfoam.com/features/thermophysical.php |dead-url=no }}</ref> ** 湍流模型<ref>{{Cite web |url=http://www.openfoam.com/features/turbulence.php |title=Turbulence models in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001259/http://www.openfoam.com/features/turbulence.php |dead-url=no }}</ref> ** 化学反应和动理学模型<ref>{{Cite web |url=http://www.openfoam.com/features/reaction-kinetics.php |title=Chemical reactions and kinetics models in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-08-07 |archive-url=https://web.archive.org/web/20120807152105/http://www.openfoam.com/features/reaction-kinetics.php |dead-url=no }}</ref> ** 拉格朗日粒子追踪模型<ref>{{Cite web |url=http://www.openfoam.com/features/lagrangian.php |title=Lagrangian particle tracking in OpenFOAM |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001448/http://www.openfoam.com/features/lagrangian.php |dead-url=no }}</ref> ** 热辐射传输模型 ** 单参照系和多参照系方法 利用便捷直观的高级语法和基础库提供的功能完成开发''应用''。通常应用可以归为两类: * 求解器:执行连续介质问题的求解计算 * 实用程序:用于准备网格、设置模拟样例、处理结果等 每个应用有其专注的功能:如应用''blockMesh''用于从用户提供的输入文件生成网格,而另一个应用''icoFoam'',则用来求解[[不可壓縮流|不可压]][[层流]]的[[Navier-Stokes方程]]。 最后,一些第三方软件包被用来提供并行化能力(即[[OpenMPI]])和进行图像后处理([[ParaView]])。 ==功能== OpenFOAM的功能含有<ref>{{Cite web |url=http://www.openfoam.com/features/ |title=OpenFOAM features |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723000840/http://www.openfoam.com/features/ |dead-url=no }}</ref>: [[File:Screenshot_OpenFOAM_smallPoolFire2D_ParaView_3.12.0.png|350px|thumb|[[甲烷]]在空气中燃烧的模拟。甲烷从底端喷出,同时被点燃。图形界面是[[ParaView]]。图中底色表示温度,箭头表示气流速度,箭头的颜色表示局部的氧气含量。]] * 基本的[[计算流体力学]]求解器 * 不可压流的[[计算流体力学|雷诺平均纳维-斯托克斯方程法(RANS)]]和[[计算流体力学|大涡流模拟法(LES)]]求解<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#incompressibleFlowSolvers |title=OpenFOAM incompressible flow solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#incompressibleFlowSolvers |dead-url=no }}</ref> * 可压流的RANS和LES求解<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#compressibleFlowSolvers |title=OpenFOAM Compressible flow solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#compressibleFlowSolvers |dead-url=no }}</ref> * 浮力流动求解器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#heatTransferSolvers |title=OpenFOAM buoyancy-driven flow solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#heatTransferSolvers |dead-url=no }}</ref> * [[计算流体力学|直接数值模拟(DNS)]] 和 LES * 多相流体求解器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#multiphaseFlowSolvers |title=Multiphase flow solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#multiphaseFlowSolvers |dead-url=no }}</ref> * 粒子跟踪求解器 * 燃烧问题求解器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#combustionSolvers |title=OpenFOAM solvers for combustion |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#combustionSolvers |dead-url=no }}</ref> * 耦合热传输求解器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#heatTransferSolvers |title=OpenFOAM solvers for conjugate heat transfer |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#heatTransferSolvers |dead-url=no }}</ref> * [[分子动力学]]求解器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#MDSolvers |title=OpenFOAM molecular dynamics solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#MDSolvers |dead-url=no }}</ref> * <ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#DSMCSolvers |title=OpenFOAM Direct Simulation Monte Carlo solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#DSMCSolvers |dead-url=no }}</ref> * [[电磁学]]求解器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#electromagneticsSolvers |title=OpenFOAM Electromagnetics solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#electromagneticsSolvers |dead-url=no }}</ref> * [[刚体动力学]]模拟器<ref>{{Cite web |url=http://www.openfoam.com/features/standard-solvers.php#stressAnalysisSolvers |title=OpenFOAM solid dynamics solvers |accessdate=2012-07-17 |archive-date=2012-07-23 |archive-url=https://web.archive.org/web/20120723001112/http://www.openfoam.com/features/standard-solvers.php#stressAnalysisSolvers |dead-url=no }}</ref> 除以上列举的标准求解器之外,由于OpenFOAM的语法,建立自定义的求解器也是容易的。 OpenFOAM实用程序被细分为: * 网格实用程序 ** 网格生成: 它们通过输入文件或几何描述文件(如)来自动生成计算用的网格(hex-dominant, snappyHexMesh) ** 网格格式转化:转化其他工具生成的网格到OpenFOAM格式 ** 网格处理:执行一些网格操作,如局部优化,区域定义等 * 并行处理工具:提供计算任务的分解、合并和重分发功能来实现并行计算 * 预处理工具:准备模拟样例 * 后处理工具:处理模拟结果,包含到OpenFOAM和[[ParaView]]的插件 * 表面处理工具 * 热物理工具 == 许可证 == OpenFOAM是自由软件和开源软件,在[[GNU通用公共许可证#GPLv3|GNU通用公共许可证版本3]]下发布。<ref>http://www.openfoam.org/licence.php {{Wayback|url=http://www.openfoam.org/licence.php |date=20120609045216 }} OpenFOAM Licensing Page</ref> == 优劣 == === 优点 === * 用户友好的偏微分方程描述语法 * 有非结构化多面体网格的处理能力 * 自动并行化OpenFOAM高级语言写成的应用 * 现成的涵盖宽领域的应用和模型 * 有由开发者提供的商业支持和培训 * 无许可证花费 === 缺点 === * 缺少集成的[[图形化用户界面|图形化用户界面(GUI)]](但有独立私有软件可选) * 开发文档缺乏足够的细节,学习曲线陡峭 * 文档缺乏维护,入门困难 == 分支和改编 == === 免费软件 === * '''blueCFD''' 是改编自'''OpenFlow'''的运行在 [[Windows]] 上的OpenFOAM[[交叉编译]]版本。该软件包同时也含有一些有用的额外函数和工具。blueCAPE出品。<ref>{{Cite web |url=http://joomla.bluecape.com.pt/ |title=blueCAPE's homepage |accessdate=2012-07-17 |archive-date=2012-04-25 |archive-url=https://web.archive.org/web/20120425080933/http://joomla.bluecape.com.pt/ |dead-url=no }}</ref> * '''FreeFOAM'''<ref>{{Cite web |url=http://freefoam.sourceforge.net/ |title=FreeFOAM Home Page |accessdate=2012-07-17 |archive-date=2012-06-17 |archive-url=https://web.archive.org/web/20120617035528/http://freefoam.sourceforge.net/ |dead-url=no }}</ref>为了把OpenFOAM从它对系统的依赖中解脱出来,使其安装更为便携和用户友好而建立的分支。其开发紧跟最新的OpenFOAM发布版,不附带额外的功能,使用[[CMake]]作为编译系统。 * '''OpenFlow''' 是一个OpenFOAM的[[Windows]]平台[[交叉编译]]的源码补丁。blueCFD中OpenFOAM的部分既是由它而来。Symscape出品<ref>{{Cite web |url=http://www.symscape.com/openfoam-2-0-x-on-windows-64-mpi |title=OpenFlow source code patch |accessdate=2012-07-17 |archive-date=2012-07-30 |archive-url=https://web.archive.org/web/20120730062846/http://www.symscape.com/openfoam-2-0-x-on-windows-64-mpi |dead-url=no }}</ref> * '''OpenFOAM-extend'''<ref>{{Cite web |url=http://www.extend-project.de/ |title=OpenFOAM-extend Project Home Page |accessdate=2012-07-17 |archive-date=2012-06-17 |archive-url=https://web.archive.org/web/20120617045402/http://www.extend-project.de/ |dead-url=no }}</ref>由Wikki有限公司维护<ref>[http://www.wikki.co.uk/ Wikki Ltd] {{Wayback|url=http://www.wikki.co.uk/ |date=20051207015925 }}.</ref>。该分支有''社区贡献''的大量内容,并且当中的绝大部分贡献可以装入到OpenFOAM的官方版本中,而只产生最低限度的影响。<ref>[http://openfoamwiki.net/index.php/Main_ContribSolvers Solvers] {{Wayback|url=http://openfoamwiki.net/index.php/Main_ContribSolvers |date=20120610053700 }}, [http://openfoamwiki.net/index.php/Main_ContribUtilities Utilities] {{Wayback|url=http://openfoamwiki.net/index.php/Main_ContribUtilities |date=20120610053825 }}, and [http://openfoamwiki.net/index.php/Main_ContribOther Other contributions] {{Wayback|url=http://openfoamwiki.net/index.php/Main_ContribOther |date=20120311113020 }}</ref>它的开发与官方版OpenFOAM是并列进行的,对最新版OpenFOAM的合并可能要等到一至两年后。 === 付费软件 === *'''Caedium''' 是'''[[Symscape]]'''出品的通用数值模拟环境。其RANS Flow的附加功能<ref>{{Cite web |url=http://www.symscape.com/product/rans |title=Caedium RANS Flow add-on |accessdate=2012-07-17 |archive-date=2012-07-02 |archive-url=https://web.archive.org/web/20120702125540/http://www.symscape.com/product/rans |dead-url=no }}</ref>提供了用于OpenFOAM的模型建立、解操作和后处理的图形用户界面。 *'''CastNet''' DHCAE Tools出品的私有建模和模拟环境。<ref>{{Cite web |url=http://www.dhcae-tools.com/ |title=DHCAE Tools homepage |accessdate=2012-07-17 |archive-date=2012-04-25 |archive-url=https://web.archive.org/web/20120425080932/http://www.dhcae-tools.com/ |dead-url=no }}</ref>其中包含一个OpenFOAM的图形界面前端。FOAM. *'''ICON FOAMpro CFD''' 由'''ICON Process & Consulting Ltd'''进行维护。<ref>{{Cite web |url=http://www.iconcfd.com/services/foampro |title=ICON FOAMpro Process |accessdate=2012-07-17 |archive-date=2012-04-25 |archive-url=https://web.archive.org/web/20120425064521/http://www.iconcfd.com/services/foampro |dead-url=no }}</ref>与[[大众汽车]]<ref>{{Cite web |url=http://papers.sae.org/2009-01-0333 |title=ICON VWG SAE paper |accessdate=2012-07-17 |archive-date=2012-04-23 |archive-url=https://web.archive.org/web/20120423214802/http://papers.sae.org/2009-01-0333 |dead-url=no }}</ref>和[[福特汽车]]<ref>{{Cite web |url=http://papers.sae.org/2011-01-0163 |title=ICON FORD SAE paper |accessdate=2012-07-17 |archive-date=2012-04-23 |archive-url=https://web.archive.org/web/20120423214813/http://papers.sae.org/2011-01-0163 |dead-url=no }}</ref>合作,主要围绕着汽车应用而开发。该分支既包含''社区贡献''的内容也包含''ICON专有''的开发。 == 替代软件 == === 开源软件和自由软件 === * Stanford University Unstructured (SU<sup>2</sup>)<ref>{{Cite web |url=http://su2.stanford.edu/ |title=SU<sup>2</sup> homepage |accessdate=2012-07-17 |archive-date=2016-10-19 |archive-url=https://web.archive.org/web/20161019142306/http://su2.stanford.edu/ |dead-url=no }}</ref> * [[Code Saturne]] (GPL) * FreeCFD<ref>{{Cite web |url=http://www.freecfd.com/ |title=FreeCFD homepage |accessdate=2012-07-17 |archive-date=2012-07-10 |archive-url=https://web.archive.org/web/20120710012449/http://www.freecfd.com/ |dead-url=no }}</ref> * [[Gerris|Gerris Flow Solver]]<ref>{{Cite web |url=http://gfs.sf.net/ |title=Gerris homepage |accessdate=2012-07-17 |archive-date=2019-10-19 |archive-url=https://web.archive.org/web/20191019014622/http://gfs.sourceforge.net/ |dead-url=no }}</ref> * OpenFVM<ref>{{Cite web |url=http://sourceforge.net/projects/openfvm/ |title=OpenFVM homepage |accessdate=2012-07-17 |archive-date=2016-07-29 |archive-url=https://web.archive.org/web/20160729211923/https://sourceforge.net/projects/openfvm/ |dead-url=no }}</ref> * CLAWPACK<ref>[depts.washington.edu/clawpack]</ref> === 私有软件 === * [[ANSYS]] CFX * [[ANSYS]] Fluent * [[Pumplinx]] * [[CD-adapco#STAR-CCM.2B|STAR-CCM+]] * [[KIVA (software)]] * [[RELAP5-3D]] * [[PowerFlow]] * [[FOAMpro]] == 参考文献 == {{reflist|3}} ==外部链接== === 官方资源 === * [http://www.openfoam.com Official OpenFOAM web site]{{Wayback|url=http://www.openfoam.com/ |date=20160922032819 }} * [http://www.openfoam.com/docs/ OpenFOAM official documentation]{{Wayback|url=http://www.openfoam.com/docs/ |date=20111130143849 }} * [http://www.openfoam.com/mantisbt/main_page.php OpenFOAM bug-reporting system]{{Wayback|url=http://www.openfoam.com/mantisbt/main_page.php |date=20110521014530 }} === 社区资源 === * [http://www.cfd-online.com/Forums/openfoam/ OpenFOAM Forum at CFD Online]{{Wayback|url=http://www.cfd-online.com/Forums/openfoam/ |date=20120718175629 }} * [http://openfoamwiki.net/index.php/Main_Page OpenFOAM wiki]{{Wayback|url=http://openfoamwiki.net/index.php/Main_Page |date=20071216045814 }} * [https://web.archive.org/web/20120718033629/http://foamcfd.org/ FOAM CFD web site], by one of the original developers of the code, who is not associated with OpenCFD. * [http://blog.sina.com.cn/openfoamresearch/ A Blog about OpenFOAM in Chinese]{{Wayback|url=http://blog.sina.com.cn/openfoamresearch/ |date=20120415074449 }} * [http://www.openfoam.cn/ OpenFOAM中文爱好者之家网站]{{Wayback|url=http://www.openfoam.cn/ |date=20120617201038 }} * [https://web.archive.org/web/20130530144043/http://www.wolfdynamics.com/training/training-with-openfoam%C2%AE.html 入门课程] {{CAE software}} [[Category:自由软件]] [[Category:计算流体力学]]
该页面使用的模板:
Template:CAE software
(
查看源代码
)
Template:Citation needed
(
查看源代码
)
Template:Cite web
(
查看源代码
)
Template:Infobox Software
(
查看源代码
)
Template:NoteTA
(
查看源代码
)
Template:Reflist
(
查看源代码
)
Template:Wayback
(
查看源代码
)
返回
OpenFOAM
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息