如何给定入口脉动速度?
-
如题,想做一个LES模拟mixing layer的算例,现在想给定入口脉动速度,如下
其中,ur是与时空有关的[-1,1]的随机数。求指教~请问这种随机脉动在of怎么实现呢
-
用coded可以实现啊?你应该知道的吧?如果是随机数的话,看这个:http://www.cfd-china.com/topic/1393/生成random随机数-of中该怎样实现
另外,后面那个$\delta_\omega$是什么?
-
@东岳 多谢前辈,已经搞定
-
@东岳 另外,还想请教一下前辈,我在nasa的网站上下了个他画的mixinglayer的网格,不太清楚这种扩散正交网格可以用icem画出来不?
-
印象中我没有这么玩过,目前我这个电脑上没有ICEM无法测试,要不你试试? @CFD网格讲师
-
@东岳 前辈,我又搞定啦😂
-
-
造福来者,代码贴到下方,主要参考turbulentInlet这个边界,我的目的是每个时间步产生不同的脉动,所以种子用的是时间~
INLET { type codedFixedValue; redirectType rampedFixedValue; code #{ const fvPatch& boundaryPatch = this->patch(); vectorField U = boundaryPatch.Cf(); vectorField u = boundaryPatch.Cf(); scalar Uave = 9.65; scalar dU = 12.3; scalar deltaW = 0.0002; scalar C0 = 0.1; label index = this->db().time().timeIndex(); Random perturbation(index); forAll(boundaryPatch, faceI) { vector deviation ( 1.0 - 2.0*perturbation.scalar01(), 1.0 - 2.0*perturbation.scalar01(), 1.0 - 2.0*perturbation.scalar01() ); //Info << "random: " << deviation << endl; scalar y = boundaryPatch.Cf()[faceI].y(); U[faceI] = vector(Uave + dU*tanh(2*y/deltaW)/2, 0, 0); u[faceI] = C0*dU*deviation*exp(-sqr(y)/(2*deltaW)); } operator==(U+u); #}; codeInclude #{ #include "Random.H" #}; value $internalField; }