如何给定入口脉动速度?
-
用coded可以实现啊?你应该知道的吧?如果是随机数的话,看这个:http://www.cfd-china.com/topic/1393/生成random随机数-of中该怎样实现
另外,后面那个
是什么? -
造福来者,代码贴到下方,主要参考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; }
-
老师您好,请问你这种入口脉动速度的给定是通过能量谱导出的吗,最近我在复现文献,但是对文献给出的能量谱怎么得到脉动速度不太懂
2018年4月5日 14:09
7/14
2023年4月7日 08:51