OpenFOAM 中边界条件的设定【转载】
转载自:http://blog.sina.com.cn/s/blog_a0b4201d0102v7jt.html
用习惯了FLUENT的操作界面,再使用OpenFOAM就会觉得非常繁琐。遇到的第一个问题就是边界条件的设定。在FLUENT中,例如给定了一个进口边界(质量或者压力或者速度)和一个出口边界(一般是压力),并在进口处设定湍流强度就可以了,不必关心这三个量在求解的各个方程中的分配。而在OpenFOAM中,这个问题就要显得复杂的多,以k-epsl模型求解可压缩流为例为例,要求解质量守恒方程,动量守恒方程和能量守恒方程,湍动能方程以及耗散率方程,分别对应P方程,U方程,T方程,k方程和epsl方程,其中U方程是矢量方程,包含三个标量方程。在求解之前要为每个方程指定边界条件。现在的问题就是:只知道压力进口条件和压力出口回流条件,以及进出口都是室温条件,也就是说只能显式的给定P方程的进口条件和出口回流条件,T方程的进口和出口条件,而U方程的边界条件需要由已知的P方程和T方程的边界条件间接的得到。对于这个问题,OpenFOAM提供了各种各样的边界条件给定方式,多的足够让你眼花缭乱,所以非常有必要深入的扒一扒。先从OpenFOAM在tutorial中给出的例子入手。
以rhoSimplecFoam中的squareBend为例,给出了alphat,epsilon, k, mut, p, T, U
等7个量的初始条件,当然也包括了边界条件。其中alphat指的是turbulence thermal
diffusivity, 例子中给定的壁面边界是
compressible::alphatWallFunction;
进口边界是calculated, value uniform
0;
出口边界是 calculated, value uniform
0; epsilon指的是turbulence
kinetic
energy dissipation
rate, k指的是turbulence
kinetic energy,mut指的是turbulence
viscosity,同时alphat, epsilon, k, mut
这个几个参数都是要给定壁面条件模型的。像其他的tutorial例子中给出的也都是速度进口边界条件,跟我的算例所需要的压力进口边界条件不太吻合。
好在OpenFoam给出了各种不同类型的边界条件类型供大家挑选使用,(当然是在不行就只能自己写了,这才是OF最强大的的地方嘛)。具体的不同内容可以查询页面:
http://openfoam.org/docs/cpp/
最终我选择的边界条件是:
U |
p |
T |
|
inlet |
pressureInletVelocity |
totalPressure |
inletOutlet |
outlet |
inletOutlet |
totalPressure |
inletOutlet |
wall |
fixedValue |
zeroGradient |
zeroGradient |
k |
Epsilon |
mut |
alpha |
inletOutlet |
inletOutlet |
calculated |
calculated |
inletOutlet |
inletOutlet |
calculated |
calculated |
wallFunction |
wallFunction |
wallFunction |
wallFunction |
历经千辛万苦终于能够无报错运行啦
下面是openFoam给出的根据各种进出口条件分类的边界条件:
inlet
boundary
conditions:
turbulentInletFvPatchField<
Type >: This boundary condition generates a
fluctuating inlet condition by adding a random component to a
reference (mean) field.
surfaceNormalFixedValueFvPatchVectorField:This
boundary condition provides a surface-normal vector boundary
condition by its magnitude
outletMappedUniformInletFvPatchField<
Type >:This
boundary conditon averages the field over the "outlet" patch
specified by name "outletPatchName" and applies this as the uniform
value of the field over this patch
outletInletFvPatchField< Type
>:This
boundary condition provides a generic inflow condition, with
specified outflow for the case of return flow
freestreamFvPatchField< Type
>:This
boundary condition provides a free-stream condition. It is a
'mixed' condition derived from the inletOutlet condition, whereby
the mode of operation switches between fixed (free stream) value
and zero gradient based on the sign of the flux
压力进口条件:
1:
fixedPressureCompressibleDensityFvPatchScalarField: This boundary
condition calculates a (liquid) compressible density as a function
of pressure and fluid properties (这是属于密度进口条件)
2:
uniformTotalPressureFvPatchScalarField: This boundary condition
provides a time-varying form of the uniform total pressure boundary
condition
3:
totalPressureFvPatchScalarField: This boundary condition provides a
total pressure condition. Four variants are possible:
4:freestreamPressureFvPatchScalarField:This
boundary condition provides a free-stream condition for pressure.
It is a zero-gradient condition that constrains the flux across the
patch based on the free-stream velocity.
速度进口条件:
1:
flowRateInletVelocityFvPatchVectorField: This boundary condition
provides a velocity boundary condition, derived from the flux
(volumetric or mass-based), whose direction is assumed to be normal
to the patch.
2:atmBoundaryLayerInletVelocityFvPatchVectorField:This
boundary condition specifies a velocity inlet profile appropriate
for atmospheric boundary layers (ABL). The profile is derived from
the friction velocity, flow direction and the direction of the
parabolic co-ordinate z.
3:
pressureNormalInletOutletVelocityFvPatchVectorField: This velocity
inlet/outlet boundary condition is applied to patches where the
pressure is specified. A zero-gradient condition is applied for
outflow (as defined by the flux); for inflow, the velocity is
obtained from the flux with a direction normal to the patch
faces.
4:pressureInletVelocityFvPatchVectorField:
This velocity inlet boundary
condition is applied to patches where the pressure is specified.
The inflow velocity is obtained from the flux with a direction
normal to the patch faces
5: pressureInletUniformVelocityFvPatchVectorField:
This velocity inlet boundary
condition is applied to patches where the pressure is specified.
The uniform inflow velocity is obtained by averaging the flux over
the patch, and then applying it in the direction normal to the
patch faces
6:pressureInletOutletParSlipVelocityFvPatchVectorField:
This velocity inlet/outlet
boundary condition for pressure boundary where the pressure is
specified. A zero-gradient is applied for outflow (as defined by
the flux); for inflow, the velocity is obtained from the flux with
the specified inlet direction.
7: pressureDirectedInletVelocityFvPatchVectorField:
This velocity inlet boundary
condition is applied to patches where the pressure is specified.
The inflow velocity is obtained from the flux with the specified
inlet direction" direction.
8:pressureDirectedInletOutletVelocityFvPatchVectorField:
This velocity inlet/outlet
boundary condition is applied to pressure boundaries where the
pressure is specified. A zero-gradient condtion is applied for
outflow (as defined by the flux); for inflow, the velocity is
obtained from the flux with the specified inlet
direction.
9: flowRateInletVelocityFvPatchVectorField:
This boundary condition provides
a velocity boundary condition, derived from the flux (volumetric or
mass-based), whose direction is assumed to be normal to the
patch.
温度进口条件:
1: totalTemperatureFvPatchScalarField:
This boundary condition provides
a total temperature condition.
耗散率进口条件:epsilon进口条件:
1:
turbulentMixingLengthDissipationRateInletFvPatchScalarField:This
boundary condition provides a turbulence dissipation, $\epsilon$
(epsilon) inlet condition based on a specified mixing
length
2:
atmBoundaryLayerInletEpsilonFvPatchScalarField: This boundary
condition specifies an inlet value for the turbulence dissipation,
$\epsilon$ (epsilon), appropriate for atmospheric boundary layers
(ABL), and designed to be used in conjunction with the
ABLInletVelocity inlet velocity boundary condition.
3:
湍动能进口条件:
1:
turbulentIntensityKineticEnergyInletFvPatchScalarField: This
boundary condition provides a turbulent kinetic energy condition,
based on user-supplied turbulence intensity, defined as a fraction
of the mean velocity:
outlet boundary condition出口边界条件:
freestreamFvPatchField< Type
>:This
boundary condition provides a free-stream condition. It is a
'mixed' condition derived from the inletOutlet condition, whereby
the mode of operation switches between fixed (free stream) value
and zero gradient based on the sign of the flux.
inletOutletFvPatchField< Type
>:This
boundary condition provides a generic outflow condition, with
specified inflow for the case of return flow.
uniformInletOutletFvPatchField<
Type >:Variant
of inletOutlet boundary condition with uniform
inletValue.
速度出口条件:
fixedNormalInletOutletVelocityFvPatchVectorField:
This velocity inlet/outlet boundary condition combines a fixed
normal component obtained from the "normalVelocity" patchField
supplied with a fixed or zero-gradiented tangential component
depending on the direction of the flow and the setting of
"fixTangentialInflow"
fluxCorrectedVelocityFvPatchVectorField:
This boundary condition provides
a velocity outlet boundary condition for patches where the pressure
is specified. The outflow velocity is obtained by "zeroGradient"
and then corrected from the flux:
pressureDirectedInletOutletVelocityFvPatchVectorField:This
velocity inlet/outlet boundary condition is applied to pressure
boundaries where the pressure is specified. A zero-gradient
condtion is applied for outflow (as defined by the flux); for
inflow, the velocity is obtained from the flux with the specified
inlet direction.
pressureInletOutletVelocityFvPatchVectorField:This
velocity inlet/outlet boundary condition is applied to pressure
boundaries where the pressure is specified. A zero-gradient
condition is applied for outflow (as defined by the flux); for
inflow, the velocity is obtained from the patch-face normal
component of the internal-cell value
pressureNormalInletOutletVelocityFvPatchVectorField:This
velocity inlet/outlet boundary condition is applied to patches
where the pressure is specified. A zero-gradient condition is
applied for outflow (as defined by the flux); for inflow, the
velocity is obtained from the flux with a direction normal to the
patch faces.
压力出口条件:
uniformTotalPressureFvPatchScalarField:This
boundary condition provides a time-varying form of the uniform
total pressure boundary condition.
totalPressureFvPatchScalarField:This
boundary condition provides a total pressure condition. Four
variants are possible
温度出口条件:
inletOutletTotalTemperatureFvPatchScalarField:This
boundary condition provides an outflow condition for total
temperature for use with supersonic cases, where a user-specified
value is applied in the case of reverse flow
totalTemperatureFvPatchScalarField:This
boundary condition provides a total temperature
condition.
一般性的边界条件: generic boundary
conditions:http://foam.sourceforge.net/docs/cpp/a10590.html
calculatedFvPatchField< Type
>:This
boundary condition is not designed to be evaluated; it is assmued
that the value is assigned via field assignment, and not via a call
to e.g. updateCoeffs or evaluate.
directionMixedFvPatchField<
Type >:Base
class for direction-mixed boundary conditions
fixedGradientFvPatchField<
Type >:This
boundary condition supplies a fixed gradient condition, such that
the patch values are calculated using
fixedValueFvPatchField< Type
>:
This boundary condition supplies
a fixed value constraint, and is the base class for a number of
other boundary conditions.
zeroGradientFvPatchField<
Type >:This
boundary condition applies a zero-gradient condition from the patch
internal field onto the patch faces.
oscillatingFixedValueFvPatchField<
Type >:This
boundary condition provides an oscillating condition in terms of
amplitude and frequency.
uniformFixedGradientFvPatchField<
Type >:This
boundary condition provides a uniform fixed gradient
condition.
uniformFixedValueFvPatchField<
Type >:This
boundary condition provides a uniform fixed value
condition
OpenFOAM 中边界条件的设定【转载】的更多相关文章
- OpenFOAM 中的边界条件(一)【转载】
链接:http://xiaopingqiu.github.io/2016/04/02/Boundary-conditions-in-OpenFOAM1/ 本系列解读 OpenFOAM 中边界条件的实现 ...
- OpenFOAM 中的边界条件(二)【转载】
转载链接:http://xiaopingqiu.github.io/2016/04/02/Boundary-conditions-in-OpenFOAM2/ 本篇在上一篇的基础上来解读 OpenFOA ...
- 根据数据文件自定义边界条件timeVaryingUniformFixedValue【转载】
转载自:http://blog.sina.com.cn/s/blog_e256415d0101nf9j.html 在OpenFOAM中,可以创建数据文件,自定义边界条件. 下面的例子读取outletP ...
- 深度学习---1cycle策略:实践中的学习率设定应该是先增再降
深度学习---1cycle策略:实践中的学习率设定应该是先增再降 本文转载自机器之心Pro,以作为该段时间的学习记录 深度模型中的学习率及其相关参数是最重要也是最难控制的超参数,本文将介绍 Lesli ...
- spring中context:property-placeholder/元素 转载
spring中context:property-placeholder/元素 转载 1.有些参数在某些阶段中是常量 比如 :a.在开发阶段我们连接数据库时的连接url,username,passwo ...
- SqlServer中的merge操作(转载)
SqlServer中的merge操作(转载) 今天在一个存储过程中看见了merge这个关键字,第一个想法是,这个是配置管理中的概念吗,把相邻两次的更改合并到一起.后来在technet上搜索发现别有 ...
- OpenFOAM 中 c++ 基础
文件布置 在 OpenFOAM 中,所有代码都以注释段开头,使用有限体积的 CFD 类型文件都包括以下头文件 #include "fvCFD.H" 在此头文件种,仅包含类或函数的定 ...
- 在OpenFOAM中做用户自定义库——编译library【转载】
转载自:http://openfoam.blog.sohu.com/22041538.html OpenFOAM自己提供的标准类都是以库的形式提供的,并且利用头文件给出了库的应用接口.这样一来,用户的 ...
- OpenFOAM中的基本变量快速认知【转载】
转载自:http://blog.sina.com.cn/s/blog_a0b4201d0102vsf9.html label 实际上就是整型数据的变体,int,OF对它进行了包装,以适应32或64位系 ...
随机推荐
- 如何设置MySql Server远程访问(Debian Linux)
1. 登录Mysql Server: $mysql -u root -p 2. 检查网络,Server是否允许远程连接: mysql> show variables like '%skip_ne ...
- 如何通过wlst部署应用程序到weblogic12c上
适用版本 Oracle WebLogic Server - Version 10.3 and laterInformation in this document applies to any plat ...
- DbTemplate
package com.me.dbComponent; import java.sql.Connection; import java.sql.PreparedStatement; import ja ...
- Linux下制作静态库 & 动态库
静态库 1.将.c生成.o文件 gcc-cadd.c-o add.o 2.使用ar工具制作静态库 ar rcs lib库名.a add.o sub.o div.o 3.编译静态库到可执行文件中 gcc ...
- Linux命令——getent
简介 getent命令帮助用户administrative databases中查找相关信息.administrative databases包括: passwd – can be used to c ...
- Visual Studio C# 利用git和github协同开发时产生冲突的解决办
Visual Studio C# 利用git和Github协同开发时产生冲突的解决办法 前言:在前两天的助教作业中,发现了自己没有办法解决在用vs开发C#的窗体项目的过程中产生的冲突问题,在查阅了资料 ...
- PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted 错误
php运行一段时间后,部分页面打不开,查看nginx日志里面一直在报PHP message: PHP Fatal error: Allowed memory size of 134217728 by ...
- 开源框架---tensorflow c++ API中./configure步骤细节
u@u160406:~/tf1.13/tensorflow$ git checkout r1.13 分支 r1.13 设置为跟踪来自 origin 的远程分支 r1.13.切换到一个新分支 'r1.1 ...
- RxJava 以及 Android 中的通用线程解决方案、并发与线程安全
关于RxJava如今是熟到发紫了,所以对于它底层的动作机制的了解是迫在眉睫了,费话不多说,直接开始. 这里还是以之前获取个人github仓库列表为例,用retrofit+rxjava,也是实际项目中用 ...
- Spring Boot源码探索——自动配置的内部实现
前面写了两篇文章 <Spring Boot自动配置的魔法是怎么实现的>和 <Spring Boot起步依赖:定制starter>,分别分析了Spring Boot的自动配置和起 ...