@Gordonaero 不好意思,我之前的表达可能并不准确,这个方法的可压缩性并不是通过相变体现,而是通过一种基于经验的粘度修正来体现的。我用的这种方法确实本身是不可压缩,但是你问的这个方法流体力学上叫什么我很难给出名字,应该算是一系列方法的组合。它是认为气液两相之间无滑移,认为混合物的密度、粘性可以由两相质量加权平均得到,气液界面采用VOF方法捕捉,相变的计算是采用基于传质的空化模型(Schnerr-Sauer model, Zwart model等等,大多基于Rayleigh-Plesset方程)关于传热这块我不太懂哈,不过这种方法缺陷就是在压缩性方面,处理得比较粗糙~不知道对你算传热会不会很有影响
相关文献你可以看看这个
Roohi E, Zahiri A P, Passandideh-Fard M. Numerical simulation of cavitation around a two-dimensional hydrofoil using VOF method and LES turbulence model[J]. Applied Mathematical Modelling, 2013, 37(9): 6469-6488.
然后下面这篇是低温空化的,涉及到热效应,可以参考下~
Zhang S, Li X, Hu B, et al. Numerical investigation of attached cavitating flow in thermo-sensitive fluid with special emphasis on thermal effect and shedding dynamics[J]. International Journal of Hydrogen Energy, 2019, 44(5): 3170-3184.
lllwonderliquid
帖子
-
-
@东岳 好的,谢谢东岳前辈~
-
@东岳 东岳前辈,我模拟的时候有非常少量的网格出现负压,但是负得不多。我觉得是空化模型本身的原因,在当地压力小于饱和蒸气压时,空化模型激活,当地液体会大量蒸发,直至压力达到饱和蒸气压,因此,对负压起一个抑制作用,这其实也符合空化本身的物理。OpenFOAM对这方面已经有限制了? 通过什么手段limit的?是在离散格式那块强制限制的吗?求前辈指教~我再翻翻代码 我做的模拟本质上确实为不可压缩,流体的压缩性是通过气相与液相的相互传质体现的,对于独立的两相而言,不考虑压缩性。这是常温非热敏流体空化流模拟中的一种常见手段,是一种简化,模拟效果和实验有较好一致性。
-
@yfclark 是的,我在模拟里的做法是对计算域的出口边界指定绝对压力,从而全场的压力可以由出口边界的绝对压力计算得出 我拿非常高的绝压只是想举个例子,想说明算出负压应该不是压力修正算法本身的锅?
-
interPhaseChangeFoam对于空化shock wave无能为力,因为其实际上是个不可压缩求解器。空化中的shock wave实际上和水汽混合相声速的降低相关,水汽混合相声速可以低至几米每秒,导致很可能就超过,从而shock wave可以产生。。
关于空化shock wave的实验研究,推荐 Ganesh H, Mäkiharju S A, Ceccio S L. Bubbly shock propagation as a mechanism for sheet-to-cloud transition of partial cavities[J]. Journal of Fluid Mechanics, 2016, 802: 37-78.
关于其数值模拟,18年慕尼黑工大的这篇论文很好。。B. Budich, S.J. Schmidt, N.A. Adams, Numerical simulation and analysis of condensation shocks in cavitating flow, J. Fluid Mech., 838 (2018) 759-813.
感觉现在大家做空化模拟开始在逐渐转型 -
大家新年好 最近在回一篇空化数值模拟论文的审稿意见,有一个审稿意见让我十分困惑,关于压力修正算法的,还请各位大神不吝赐教。。
该意见如下:
Is a pressure-correction algorithm used? This methodology will inevitably result to negative pressures. Have the authors experienced such issues? what values have been produced by the CFD code and how do they overcome this?
困惑在于加粗的那句话 "This methodology will inevitably result to negative pressures"。在我的理解中,压力修正算法多用于不可压缩流动的求解,包括我做的工作也是不可压缩流动,按道理该算法中应该只涉及相对压力及压力梯度呀?为什么会有 inevitably result to negative pressures?对于一个不可压缩流动,如果把流场整体的压力调到非常高,流场中就应该不会出现负压呀?还是说我对 negative pressure的概念理解有误?查阅文献也并没有找到相关的描述。。小弟不做算法这一块,在算法方面接触还较少,还请各位大侠前辈指点 -
@一颗鸭蛋 可以邮件交流~ lzhforward@whu.edu.cn
-
东岳前辈,私以为这样才是对的,作为一名研究生,看到了周边太多的短平快...... 做的东西有没有意义有没有价值不管,是否正确不管,创新性也不追求,只追求发文章...... 感觉科研在很多人心里开始变味
-
@chaoscfd 你好,我后来的做法是将网格做到y+<1,然后不采用壁面函数,k方程壁面边界条件为kqRwallFuction, omega边界条件为omegaWallFuction, nut边界条件为nutkWallFunction,计算效果还不错。希望可以帮到你~
另外,我觉得将网格做到y+>30,然后指定壁面函数也是可以的 -
@东岳 东岳前辈,这样貌似没有用,还是之前的错误
-
今天在一个算例算完之后试图用fieldAverage工具计算UMean,发现openfoam4.x中提供的模板是把它全部写在了controlDict文件下的functions下面了。。由于我已经计算完毕,所以在system下建了一个fieldAverage文件,controlDict下用#includeFunc fieldAverage挂载,如下:
// Type of functionObject type fieldAverage; // Where to load it from (if not already in solver) libs ("libfieldFunctionObjects.so"); // Function object enabled flag enabled true; // When to output the average fields writeControl adjustableRunTime; writeInterval 0.001; // Fields to be averaged - runTime modifiable fields ( U { mean on; prime2Mean off; base time; window 20; // 当设定window为一正整数w时,输出的时均值是当前时间步以及其之前w-1步,这w步内Field的时均值 } );
而此时输入postProcess -func fieldAverage时会报这种错误(PS:采用#includeFunc挂载的方式即使边算边输出也会出现这个错误):
--> FOAM FATAL IO ERROR: wrong token type - expected word, found on line 18 the punctuation token '{' file: /home/dyfluid/tutorials/incompressible/pimpleFoam/pitzDaily/system/fieldAverage.fields at line 18. From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&) in file primitives/strings/word/wordIO.C at line 74. FOAM exiting
看上去是说U后面不应该是{ ,但事实上,openfoam给出的模板里这个地方就是这么写的,并且我把system下面的fieldAverage文件中的code复制到controlDict下面,边算边处理的话,完美运行。。但是如果再用postProcess -func fieldAverage的方式,这段程序不会被运行,原因是:
--> FOAM Warning : From function static bool Foam::functionObjectList::readFunctionObject(const Foam::string&, Foam::dictionary&, Foam::HashSet<>&, const Foam::word&) in file db/functionObjects/functionObjectList/functionObjectList.C at line 245 Cannot find functionObject file fieldAverage
那么,是否表明这个后处理工具不能在计算完成后运行?
如果可以,那应该怎么做呢。。
跪求大神指教! -
@youmengtian 感谢指点!
-
如何bound?搜了很久没搜到,求赐教
-
如题。。
看到openfoam对某些值在0~1之间的变量可以指定特定的01格式保持其在0~1间严格有界,比如vanLeer01,那对于值不在0~1区间的变量可以指定吗?
比如说想对k指定范围0~100。。 -
@wwzhao 非常感谢前辈的指点^-^
-
@东岳 前辈,貌似我改写的那几行在3.0之前的版本这么用可以编译成功T-T,看到别人在2.4.0这么用过
const volScalarField& alpha2= mesh_.lookupObject<volScalarField>("alpha.vapour");
-
参照@wwzhao 前辈的做法·,果然编译通过了,目前正在测试中,开心^-^。非常感谢!
其实还有问题想问两位前辈,对于一个刚接触openfoam代码改写的人,应该如何去慢慢掌握of中的代码结构、风格,以及各种类的用法?目前的我一打开Of中的某.C文件就有些懵逼。。 -
继续求救 最近试图对SST k-w模型做一些修改。。其中有几行代码是试图读入场中的一些变量以及transportProperties文件中设置的一些常量。这几行代码如下:
const volScalarField& alpha1= this->mesh_.lookupObject<volScalarField>("alpha.water"); const volScalarField& alpha2= this->mesh_.lookupObject<volScalarField>("alpha.vapour"); const dictionary& transportProperties= this->mesh_.lookupObject<IOdictionary>("transportProperties"); const dictionary& phase1= transportProperties.subDict("water"); const dictionary& phase2= transportProperties.subDict("vapour"); const dimensionedScalar& rho1 = phase1.lookup("rho"); const dimensionedScalar& rho2 = phase2.lookup("rho");
但是编译的时候却报了这个错误:
lnInclude/modkOmegaSSTBase.C:42:69: error: expected primary-expression before ‘>’ token const volScalarField alpha1= this->mesh_.lookupObject<volScalarField>("alpha.water"); ^ lnInclude/modkOmegaSSTBase.C:43:69: error: expected primary-expression before ‘>’ token const volScalarField alpha2= this->mesh_.lookupObject<volScalarField>("alpha.vapour"); ^ lnInclude/modkOmegaSSTBase.C:59:78: error: expected primary-expression before ‘>’ token const dictionary& transportProperties= this->mesh_.lookupObject<IOdictionary>("transportProperties"); ^ make: *** [Make/linux64GccDPInt32Opt/makeTurbModel.o] 错误 1
error: expected primary-expression before ‘>’ token
这些错误都发生在lookupObject函数上,是否是我这个函数的写法有问题?在网上搜也未得到解释方法,请问各位有碰到类似情况的吗?望各位大神不吝赐教 -
已解决。。在GitHub上找到了例子,照着做就ok..GitHub大法好
-
openfoam湍流模型的架构貌似和老版本很不一样?最近需要对openFOAM中的湍流模型做一些修改,于是先拿网上的一个修改kEpsilon模型的例子来练手。。将openFOAM4.1版本中的kEpsilon文件夹拷出,目前只对kEpsilon.H和kEpsilon.C文件的文件名和类名进行了修改,得到了DurbinV2F.H和DurbinV2F.C文件。编译的files文件和options文件如下:
filesV2F/DurbinV2F.C LIB = $(FOAM_USER_LIBBIN)/libaddedRASModels
options
EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ LIB_LIBS = \ -lfiniteVolume \ -lmeshTools
但是,编译器却返回:
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam4/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam4/src/finiteVolume/lnInclude -I/opt/openfoam4/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam4/src/OpenFOAM/lnInclude -I/opt/openfoam4/src/OSspecific/POSIX/lnInclude -fPIC -c V2F/DurbinV2F.C -o Make/linux64GccDPInt32Opt/V2F/DurbinV2F.o V2F/DurbinV2F.C:40:6: error: redefinition of ‘void Foam::RASModels::DurbinV2F<BasicTurbulenceModel>::correctNut()’ void DurbinV2F<BasicTurbulenceModel>::correctNut() ^ In file included from V2F/DurbinV2F.H:212:0, from V2F/DurbinV2F.C:26: V2F/DurbinV2F.C:40:6: error: ‘virtual void Foam::RASModels::DurbinV2F<BasicTurbulenceModel>::correctNut()’ previously declared here void DurbinV2F<BasicTurbulenceModel>::correctNut()
等等 告诉我 redefinition 了。
失败后我想看看kEpsilon原本对应的Make文件夹。。但是奇怪的是发现turbulenceModels这个文件夹下面的files文件里并没有kEpsilon.C,包括常见的RNG、SSTkOmega等也没有,翻了其他文件夹下的files也没发现,老版本的openfoam里turbulenceModels文件夹下面的files是指定了kEpsilon.C的。这就非常疑惑了,新版本openfoam究竟是在哪里编译了这些湍流模型
另外,新版本openfoam中添加湍流模型应该怎么做呢
求各位大神解惑。。 -
@东岳 好的,多谢东岳前辈的意见^_^
-
@东岳
感谢东岳前辈的回答。这个地方确实有网格过渡不好的问题,在这里我生成网格的时候主要考虑的是近壁面的网格过渡,导致该处交界点两个网格大小差异较大,是否可能是这个原因? -
东岳前辈好,湍流、物性、进出口条件我都已经检查并尝试过不同组合了,如果除去上述我提出的疑虑外,离散格式确实是我在怀疑的一个点,我的所有对流项均用的是vanleer格式,是否会有问题?
-
大家好,最近算了一个水翼的流场,采用PimpleFoam求解器,使用ICEM生成网格,质量在0.8以上,计算域和网格图如下:
进口速度取5.4m/s,Re=5.4*10^5,出口大气压,翼型攻角10度,计算水的不可压缩流动,但是在算例相关设置基本妥当之后,算出的流场有一些问题。。。
下面是Q=50000等值面图:
翼型下面的流场应当较为平顺才对,不应当出现这么大的Q值。
把我导请来分析了一下,我导不懂OpenFOAM,但是对CFD很精通,他认为可能是网格转换的问题,因为我这里网格转换了两次,先从ICEM转换成msh,再从msh转化成OpenFOAM格式,可能两个网格转换器容差不同,导致最后转化出的网格产生畸变甚至负体积,使计算产生问题。
想问一下大家,平时用的OpenFOAM网格是怎么生成的? 有没有遇到过和我相似的问题? -
我的算例是在计算中输出的,没什么问题,你可以试试。。
第二个问题也是我想问的,OpenFOAM的sst k-w模型是否会自动识别用哪种模式?感觉此处需要@一些大神 ^_^ -
最近我也在用SST k-w模型计算翼型周围的流场,开始用y+大于30,但是我有一部分网格y+会小于30,算出来升力并不能收敛。。而是处于周期性振荡情况。看到researchGate 上面说openfoam里面的sst k-w模型有两种模式?https://www.researchgate.net/post/Should_the_RANS_model_kOmegaSST_be_fully_resolved_at_low_Re-number_Is_it_possible_to_use_it_with_a_wall_function
一种,是低雷诺数模型模式,y+要求在0~5,另一种,是高雷诺数模型模式,y+在30~300;用的边界条件不一样。
但是,原本的sst k-w模型应该是一种低雷诺数模型,应当对边界层求解,高雷诺数模式有人试过吗?是否靠谱?
二相流的y+不能计算吗。。我算的空化,直接在controlDict里设置yplus就可以输出呀。。 -
问题貌似已成功解决。。捣鼓一下午,先在icem Global Mesh Parameters 里设置periodicity,然后转化到openfoam网格,使用cyclic边界条件,发现单核运行已经可以了;但是并行计算出现了问题,不能计算。于是在decomposeParDict文件中使用preservePatches工具,使对应的两个周期面在执行decomposePar时可以被分在一个域,设置完后,计算畅通无阻
-
@东岳icem,数量200多万,不过问题貌似已成功解决 谢谢东岳前辈,捣鼓了一下午,正准备在下面分享一下我的经验
-
@东岳 openfoam显示不是完全吻合,用cyclic会出问题,加大tolerance也不管用,反而tolerance调得越大,显示的不匹配度越高
-
大家好。。最近在计算一个水翼的流场。。此前设置的计算域如下图所示,计算起来没问题;但这两天认为计算域的侧面不应是symmetry堆成边界条件,而应该设成周期性会好一些。然后在算例文件中用cyclicAMI设置周期性边界条件后就出问题了,两条边的网格吻合应该没问题,但是一算就挂。。下面贴出boundary文件和Log,大家知道这是什么原因吗?
boundary
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 6 ( INLET { type patch; nFaces 7076; startFace 8338533; } OUTLET { type patch; nFaces 22156; startFace 8345609; } TOPANDDOWN { type wall; inGroups 1(wall); nFaces 36424; startFace 8367765; } WING { type wall; inGroups 1(wall); nFaces 9744; startFace 8404189; } FRONT { type cyclicAMI; inGroups 1(cyclicAMI); nFaces 24139; startFace 8413933; matchTolerance 0.001; transform translational; separationVector (0 0 -0.102); neighbourPatch BACK; } BACK { type cyclicAMI; inGroups 1(cyclicAMI); nFaces 24139; startFace 8438072; matchTolerance 0.001; transform translational; separationVector (0 0 0.102); neighbourPatch FRONT; } ) // ************************************************************************* //
log
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 4.1 Exec : simpleFoam Date : Sep 13 2018 Time : 11:43:26 Host : "Lzh_HP_Z420_Workstation" PID : 13508 Case : /home/lzh/20180824Waveydro/SST nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 SIMPLE: convergence criteria field p tolerance 1e-06 field U tolerance 1e-06 field "(k|epsilon|omega|f|v2)" tolerance 1e-06 Reading field p AMI: Creating addressing and weights between 24139 source faces and 24139 target faces AMI: Patch source sum(weights) min/max/average = 0, 1, 0.998589 AMI: Patch target sum(weights) min/max/average = 0, 1, 0.997104 Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting turbulence model type RAS Selecting RAS turbulence model kOmegaSST Selecting patchDistMethod meshWave bounding k, min: 0 max: 0.0068 average: 0.0068 bounding omega, min: 0 max: 6.668 average: 6.668 kOmegaSSTCoeffs { alphaK1 0.85; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.856; gamma1 0.555556; gamma2 0.44; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; b1 1; c1 10; F3 false; } No MRF models present No finite volume options present Starting time loop surfaceRegion flowRatePatch: total faces = 22156 total area = 0.0306 Time = 1 smoothSolver: Solving for Ux, Initial residual = 0.999998, Final residual = 0.0462183, No Iterations 3 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.0664053, No Iterations 3 smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 0.0408965, No Iterations 4 #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:? #4 ? at ??:? #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:? #6 ? at simpleFoam.C:? #7 ? at ??:? #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 ? at ??:?
-
缅怀。。作为CFD萌新,已经无数次地看过这位老教授的名字
-
同有这个问题:crying: 困扰了好几天了都.
大家好,我最近在计算一个翼型空化流动算例,用的是interphaseChangeFoam求解器,用fieldAverage函数计算得出了一个时均速度场 UMean 文件,可是当我试图用singleGraph工具提取一条线上的Umean, 却发现会出现以下错误?是不是因为 interPhaseChangeFoam中没有定义UMean场?如果是这样的话,那该怎样才能对UMean这个场进行操作呢:crying:
这是我用singleGraph时输入的命令:
这是错误提示:
-
感觉有人手把手带着学OPenfoam是每个openfoam初学者的梦想。。所以最近国内有没有相关机构或个人组织培训?:big_mouth:
-
嗯。。可我目前算的是稳态,不用MRF的话怎么处理内部的旋转部件呢:surprised:
-
嗯。。因为网格划分时把动静部件分开划分,然后合并的时候有交接面,所以用了AMI。。然后我是采用多重参考系定义速度。。难道它们之间是有矛盾的?:big_mouth:
-
嗯嗯:crying: 我看到CFD-online上一些前辈们也是这样说,然后我就懵圈了,完全不知道应该怎样去debug,不知道应该遵循一个怎样的流程或原则。。:crying:
-
大家好,最近在做旋转机械内流场的计算工作,使用了AMI动静交接面,采用MRF坐标系,可是当我开始计算时,却出现了以下错误提示。。。觉得很可能是边界条件设置有问题。。贴一下边界条件设置文件,如下。求大神指教!
lizehao@lizehao-Z97-HD3:~/openFoam/run/tubulence_model_test_on_centrifugal_pump/mesh5/merge_grid$ simpleFoam |tee simpleFoam.log /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 4.1 Exec : simpleFoam Date : Dec 08 2017 Time : 11:09:02 Host : "lizehao-Z97-HD3" PID : 30537 Case : /home/lizehao/openFoam/run/tubulence_model_test_on_centrifugal_pump/mesh5/merge_grid nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 SIMPLE: convergence criteria field p tolerance 1e-05 field U tolerance 1e-05 field k tolerance 1e-05 field epsilon tolerance 1e-05 field nut tolerance 1e-05 Reading field p Reading field U Reading/calculating face flux field phi AMI: Creating addressing and weights between 18792 source faces and 2424 target faces AMI: Patch source sum(weights) min/max/average = 0.992729, 1.00082, 0.999897 AMI: Patch target sum(weights) min/max/average = 0, 1.00061, 0.580281 AMI: Creating addressing and weights between 7722 source faces and 3861 target faces AMI: Patch source sum(weights) min/max/average = 0.0916406, 1, 0.994738 AMI: Patch target sum(weights) min/max/average = 0, 1, 0.877149 AMI: Creating addressing and weights between 7722 source faces and 3861 target faces AMI: Patch source sum(weights) min/max/average = 0.0916406, 1, 0.994738 AMI: Patch target sum(weights) min/max/average = 0, 1, 0.877149 Selecting incompressible transport model Newtonian Selecting turbulence model type RAS Selecting RAS turbulence model kEpsilon kEpsilonCoeffs { Cmu 0.09; C1 1.44; C2 1.92; C3 -0.33; sigmak 1; sigmaEps 1.3; } Creating MRF zone list from MRFProperties creating MRF zone: MRF1 No finite volume options present Starting time loop Time = 1 smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.0389849, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.0580972, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 0.0935053, No Iterations 1 #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:? #4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:? #5 ? at ??:? #6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #7 ? at ??:?
U文件,进口fixedValue,出口zeroGradient,壁面noslip,交接面cyclicAMI
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (2.744 0 0); boundaryField { wall1_runner { type noSlip; } wall2_runner { type noSlip; } wall3_runner { type noSlip; } wall4_runner { type noSlip; } interface_runner { type cyclicAMI; value uniform (2.744 0 0); } interface1_runner { type cyclicAMI; value uniform (2.744 0 0); } interface2_runner { type cyclicAMI; value uniform (2.744 0 0); } wall2_suction { type noSlip; } outflow_suction { type noSlip; } wall1_suction { type noSlip; } inlet { type fixedValue; value uniform (2.744 0 0); } interFace1_suction { type cyclicAMI; value uniform (2.744 0 0); } interFace2_suction { type cyclicAMI; value uniform (2.744 0 0); } wall1_volute { type noSlip; } interface_volute { type cyclicAMI; value uniform (2.744 0 0); } wall2_volute { type noSlip; } outlet_volute { type zeroGradient; } }
P文件,进口及壁面zeroGradient,出口fixedValue,交接面cyclicAMI
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { wall1_runner { type zeroGradient; } wall2_runner { type zeroGradient; } wall3_runner { type zeroGradient; } wall4_runner { type zeroGradient; } interface_runner { type cyclicAMI; value uniform 0; } interface1_runner { type cyclicAMI; value uniform 0; } interface2_runner { type cyclicAMI; value uniform 0; } wall2_suction { type zeroGradient; } outflow_suction { type zeroGradient; } wall1_suction { type zeroGradient; } inlet { type zeroGradient; } interFace1_suction { type cyclicAMI; value uniform 0; } interFace2_suction { type cyclicAMI; value uniform 0; } wall1_volute { type zeroGradient; } interface_volute { type cyclicAMI; value uniform 0; } wall2_volute { type zeroGradient; } outlet_volute { type fixedValue; value uniform 0; } }
k文件,进口fixedValue,出口inletoutlet,壁面kqRWallFunction,交接面cyclicAMI
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.01; boundaryField { wall1_runner { type kqRWallFunction; value uniform 0.01; } wall2_runner { type kqRWallFunction; value uniform 0.01; } wall3_runner { type kqRWallFunction; value uniform 0.01; } wall4_runner { type kqRWallFunction; value uniform 0.01; } interface_runner { type cyclicAMI; value $internalField; } interface1_runner { type cyclicAMI; value $internalField; } interface2_runner { type cyclicAMI; value $internalField; } wall2_suction { type kqRWallFunction; value uniform 0.01; } outflow_suction { type kqRWallFunction; value uniform 0.01; } wall1_suction { type kqRWallFunction; value uniform 0.01; } inlet { type fixedValue; value uniform 0.01; } interFace1_suction { type cyclicAMI; value $internalField; } interFace2_suction { type cyclicAMI; value $internalField; } wall1_volute { type kqRWallFunction; value uniform 0.01; } interface_volute { type cyclicAMI; value $internalField; } wall2_volute { type kqRWallFunction; value uniform 0.01; } outlet_volute { type inletOutlet; inletValue $internalField; value $internalField; } }
epsilon文件,进口fixedValue,出口inletoutlet,壁面epsilonWallFunction,交接面cyclicAMI
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -3 0 0 0 0]; internalField uniform 0.0095; boundaryField { wall1_runner { type epsilonWallFunction; value uniform 0.0095; } wall2_runner { type epsilonWallFunction; value uniform 0.0095; } wall3_runner { type epsilonWallFunction; value uniform 0.0095; } wall4_runner { type epsilonWallFunction; value uniform 0.0095; } interface_runner { type cyclicAMI; value $internalField; } interface1_runner { type cyclicAMI; value $internalField; } interface2_runner { type cyclicAMI; value $internalField; } wall2_suction { type epsilonWallFunction; value uniform 0.0095; } outflow_suction { type epsilonWallFunction; value uniform 0.0095; } wall1_suction { type epsilonWallFunction; value uniform 0.0095; } inlet { type fixedValue; value uniform 0.0095; } interFace1_suction { type cyclicAMI; value $internalField; } interFace2_suction { type cyclicAMI; value $internalField; } wall1_volute { type epsilonWallFunction; value uniform 0.0095; } interface_volute { type cyclicAMI; value $internalField; } wall2_volute { type epsilonWallFunction; value uniform 0.0095; } outlet_volute { type inletOutlet; inletValue $internalField; value $internalField; } }
-
好的,我试试
-
大家好,我最近将一套网格导入了OpenFoam,但是却很尴尬地发现OpenFoan的fluentMeshToFoam工具居然直接把原网格中的两个patch合并成了一个。。而这两个patch所要定义的边界条件是不一样的。。求问Openfoam中有没有相关工具可以将这个合并了的patch重新切分成原先的两个patch?
-
大家好,最近阅读MRF的源代码时碰到了一些问题,其在旋转区域的处理时有一个给旋转坐标系内部的点加入科里奥利力的函数,但是貌似加得不对?按理论来说,如果以旋转坐标系作为参考系,应该在每一点加上科里奥利力和离心力,其数学式如下:
可是该程序中仅仅加入了上式中科里奥利力的一半,即w*v,并且没有加入离心力,这段代码如下:void Foam::MRFZone::addCoriolis ( const volVectorField& U, volVectorField& ddtU ) const { if (cellZoneID_ == -1) { return; } const labelList& cells = mesh_.cellZones()[cellZoneID_]; vectorField& ddtUc = ddtU.primitiveFieldRef(); const vectorField& Uc = U; const vector Omega = this->Omega(); forAll(cells, i) { label celli = cells[i]; ddtUc[celli] += (Omega ^ Uc[celli]); } }
网上也有人说其可能有问题,并将这段程序加以修改:
void Foam::MRFZone::addCoriolis ( const volVectorField& U, volVectorField& ddtU ) const { if (cellZoneID_ == -1) { return; } const labelList& cells = mesh_.cellZones()[cellZoneID_]; vectorField& ddtUc = ddtU.primitiveFieldRef(); const vectorField& Uc = U; const vector Omega = this->Omega(); forAll(cells, i) { label celli = cells[i]; ddtUc[celli] += (2.0*Omega ^ Uc[celli])+Omega ^ (Omega ^ (mesh_.C() - origin_)); } }
即改成了公式中的表达形式,附上其网址:http://waynezw0618.blog.163.com/blog/static/9228640920083235430877/ 那么该程序的编写是否真的有误?还是说是我对MRF思想理解出了偏差?
-
@李东岳 可是在边界条件的设定中,桨叶和外面的边壁的设置是完全一样的啊?从paraview的显示来看,桨叶和外边壁均是与MRF1坐标系相对静止的..
rotor { type noSlip; } stator { type noSlip; }
-
最近玩了一下simpleFoam算例文件夹下面的MixVessel 2D算例,该算例的模型是搅拌器,网格文件中把整个流场都设置成了1个cellzone(rotor),并且在MRFProperties文件中设置了1个相对坐标系(MRF1),我的理解是该坐标系以(0,0,0)为中心,以沿着z轴看是顺时针的方向以104.72rad/s的角速度旋转。
在边界条件设置中,我理解的0/U文件中的相关设置含义是:整个流场和内外的搅拌叶片均随坐标系一起运动,这就很让人困惑了...这是否与实际的搅拌器相悖?还是说我对边界条件的理解有误?
附上MRFProperties文件、0/U文件及paraFoam中显示的搅拌器模型图及计算完毕后的流场矢量图:
MRFProperties:/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object MRFProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // MRF1 { cellZone rotor; active yes; // Fixed patches (by default they 'move' with the MRF zone) nonRotatingPatches (); origin (0 0 0); axis (0 0 1); omega 104.72; } // ************************************************************************* //
0/U:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { rotor { type noSlip; } stator { type noSlip; } front { type empty; } back { type empty; } } // ************************************************************************* //
搅拌器模型图:
流场矢量图:
-
@夜阑烟寒 http://blog.sina.com.cn/s/blog_5fdfa7e60100frhf.html
可以看看这个,里面写了no和yes的含义,和我们平时的理解是相反的
-
大家好,最近在阅读openFoam 4.1版本tutorials/incompressible/SRFSimpleFoam/mixer 算例,在读到设定边界条件的0/Urel文件时有个地方一直百思不得其解...附上Urel文件的代码:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object Urel; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 -10); boundaryField { inlet { type SRFVelocity; inletValue uniform (0 0 -10); relative no; value uniform (0 0 0); } outlet { type pressureInletOutletVelocity; value $internalField; } innerWall { type noSlip; } outerWall { type SRFVelocity; inletValue uniform (0 0 0); relative no; value uniform (0 0 0); } cyclic_half0 { type cyclic; } cyclic_half1 { type cyclic; } } // ************************************************************************* //
中的这几行:
inlet { type SRFVelocity; inletValue uniform (0 0 -10); relative no; value uniform (0 0 0); }
对于进口速度,已经设置了其速度为 uniform (0,0,-10),那为什么下面还需要写一行 value uniform (0,0,0)?这一项代码有什么含义?想不通:joking:
-
@李东岳 谢谢东岳前辈!:cheeky:
-
@李东岳 那显性离散的不需要加fvc::吗:surprised: ,经常看到有些量加有些量却不加:crying:
-
大家好,我最近在阅读openfoam4.1中的k-epsilon湍流模型程序。。在读到epsilon方程和k方程时有些小困惑,以epsilon方程为例,对于扩散项和耗散项,程序中将其分为三项来写,如下所示:
tmp<fvScalarMatrix> epsEqn ( fvm::ddt(alpha, rho, epsilon_) + fvm::div(alphaRhoPhi, epsilon_) - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_) == C1_*alpha()*rho()*G*epsilon_()/k_() - fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha()*rho()*divU, epsilon_) - fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_) + epsilonSource() + fvOptions(alpha, rho, epsilon_) );
中的这三项:
C1_*alpha()*rho()*G*epsilon_()/k_() - fvm::SuSp(((2.0/3.0)*C1_ + C3_)*alpha()*rho()*divU, epsilon_) - fvm::Sp(C2_*alpha()*rho()*epsilon_()/k_(), epsilon_)
为什么这三项需要使用不同的差分格式?为什么第一项不需要fvm::,第二项使用fvm::SuSp而第三项却使用fvm::Sp?
-
@李东岳 感谢东岳前辈的指点,恍然大悟:cheeky:
压力修正算法不可避免地导致负压?
压力修正算法不可避免地导致负压?
压力修正算法不可避免地导致负压?
压力修正算法不可避免地导致负压?
interPhaseChangeFoam能否求解出空泡溃灭时的压力波
压力修正算法不可避免地导致负压?
openfoam新版本湍流模型编译
博士毕业那年我才发了第一篇SCI
关于OpenFOAM中K-Omega SST模型使用壁面函数时的Y+问题
OPENFOAM中有些后处理工具是否只能在计算时运行,计算完毕后无法运行?
OPENFOAM中有些后处理工具是否只能在计算时运行,计算完毕后无法运行?
openfoam的fvScheme中是否可以给某个变量指定范围?
openfoam的fvScheme中是否可以给某个变量指定范围?
openfoam的fvScheme中是否可以给某个变量指定范围?
openfoam新版本湍流模型编译
openfoam新版本湍流模型编译
openfoam新版本湍流模型编译
openfoam新版本湍流模型编译
openfoam新版本湍流模型编译
openfoam新版本湍流模型编译
第三方软件生成的网格导成msh格式,再通过fluent3DMeshToFoam导入OpenFOAM是否会出问题?
第三方软件生成的网格导成msh格式,再通过fluent3DMeshToFoam导入OpenFOAM是否会出问题?
第三方软件生成的网格导成msh格式,再通过fluent3DMeshToFoam导入OpenFOAM是否会出问题?
第三方软件生成的网格导成msh格式,再通过fluent3DMeshToFoam导入OpenFOAM是否会出问题?
关于OpenFOAM中K-Omega SST模型使用壁面函数时的Y+问题
关于OpenFOAM中K-Omega SST模型使用壁面函数时的Y+问题
cyclicAMI一算就挂。。
cyclicAMI一算就挂。。
cyclicAMI一算就挂。。
cyclicAMI一算就挂。。
向CFD之父致敬,Brain Spalding
想在程序中调用UMean这个值,应该如何实现?
最近国内有没有组织OpenFOam的培训?
对旋转机械进行计算时的错误提示
对旋转机械进行计算时的错误提示
对旋转机械进行计算时的错误提示
对旋转机械进行计算时的错误提示
OpenFoam能否将一个patch切分?
OpenFoam能否将一个patch切分?
MRF源代码的问题
对MRF MixVessel 2D算例的疑问
对MRF MixVessel 2D算例的疑问
SRFSimpleFoam里边界条件的设置?
对于openfoam旋转坐标系边界条件设置的疑问
小白对于openfoam k-epsilon湍流模型程序编写的困惑
小白对于openfoam k-epsilon湍流模型程序编写的困惑
小白对于openfoam k-epsilon湍流模型程序编写的困惑
simpleFoam中的 rAtU