壁面湍流LES,如何设置一个随机力源项(numerical trip)诱导湍流
-
The source term is to be applied similarly to a trip-wire in a physical experiment, i.e. in a thin strip of cells close to the wall The numerical trip adds randomised fluctuations to the velocity in the momentum equation in the defined region, which acts to trip the boundary layer from laminar to turbulent.
请教各位大佬,在OpenFOAM如何实现:在近壁面特定区域的cellZone网格上,增加一个随机脉动的源项,脉动的强度与为自由流速成比例,比如10%
-
@学流体的小明 感谢大佬。
我用的是ESI版本,找到这个codeSource的介绍了。
https://doc.openfoam.com/2306/tools/processing/numerics/fvoptions/sources/rtm/coded/
但还没搞懂这个随机量怎么生成和添加 -
代码方面你照猫画虎就行呀,它这个是给scalar场添加源项,你给速度场U添加就行了,该变的地方变一变。我用的可能和这个不一样。
codedSource { type coded; selectionMode all; fields (h); //对哪一个场添加源项,你用 U name sourceTime; //名字随便起一个 codeAddSup #{ const Time& time = mesh().time(); //获取时间 const scalarField& V = mesh_.V(); //获取网格的体积 scalarField& heSource = eqn.source(); //获取h的方程的源项的引用,之后在这个scalarField上面加上具体的量就可以了 // Start time const scalar startTime = 2.0; // Retrieve the x component of the cell centres const scalarField& cellx = mesh_.C().component(0);//获取网格的x坐标 // Only apply when we have reached the start time if (time.value() > startTime) { // Apply the source forAll(cellx, i) { // cell volume specific source heSource[i] += 1e5*sin(200*cellx[i])*V[i]; //forAll所有网格的循环,加上这个源项 }; } #}; }