-
@李东岳 李老师,我看了一下您的代码和case,代码没问题,是case里nut边界条件的原因,您用的都是zeroGradient。zeroGradient在SA 里可能没问题,但在WA中是不行的,您改成这个试试。
inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } upperWall { type nutkWallFunction; value uniform 0; } lowerWall { type nutkWallFunction; value uniform 0; } frontAndBack { type empty; }
我把计算步延长至5000,标尺都一样。
SA:
WA zeroGradient:
这是WA改完后的结果:
另外,说一下一方程湍流模型。用的时候会发现有的case会非常不容易收敛,这个时候case里nuTilda的边界条件就要改。根据文献和网页,WA模型的nuTilda的壁面要设置为0,内部和进出口要改成3$\nu$到5$\nu$之间(所以我用的4$\nu$)。实际上,SA模型的nuTilda也要改,见网页。这是改完后的结果。
SA:
WA:
仔细看能发现两个模型是有差别的。还有就是nuTilda的边界条件对结果也有影响。踩过很多坑,只能说,一方程湍流模型的选择要谨慎,尤其有逆压梯度。
-
哈哈,不厉害不厉害。踩的坑多了,没用的经验就增加了, 大家都避坑
-
@wangfei9088 前段时间用SADDES算了一个case,瞬态还可以,时间平均基本还是瞬态(算了很久),不会是这个原因吧。还有就是近壁面计算的和WALE差别也很大,WALE比较符合物理结果。
-
@尚善若水 只能说你的case有可能是nut或nuTilda边界条件设置的原因,不全是,因为实际上一方程湍流模型的坑远不止这些。你用的是SADDES,那我就用SA举个例子。
这是OpenFOAM里自带的SA模型,李老师整理出来的公式。(摘自李老师的无痛苦NS方程):
笔记里这个模型公式没有任何问题,和OpenFOAM里的代码是一模一样的。
但是,实际上它只是Spalart Allmaras文献里的方程4,只适用于高雷诺数。对于低雷诺数或者更宽的适用范围,应该用方程(12)的。完整的低雷诺数SA模型的所有公式都写在附录里了。很遗憾,OpenFOAM原生代码把这个更详细的模型忽略了,只植入了简化的高雷诺数模型。
于是,你最不想看到的事情可能就发生了。OpenFOAM里SADES、SADDES和SAIDDES都是基于适用于高雷诺数的SA,那么,你的近壁计算大概率就是不准的了。
还有,OpenFOAM里植入与原始文献不符的湍流模型还有kOmega2006和kOmegaSST(包括kOmegaSSTSAS、kOmegaSSTDES、kOmegaSSTDDES和kOmegaSSTIDDES)。所以,用这些模型的时候都要留心。
-
@wangfei9088 确实如此👍
-
@李东岳 哈哈,好。
根据文献和网页,写一下SA湍流模型的公式,方便在OpenFOAM中植入。
$$
\frac{\partial \tilde \nu}{\partial t}+\nabla \cdot (\mathbf{U} \tilde \nu) = c_{b1}(1-f_{t2}) \tilde S \tilde \nu +\frac{1}{\sigma} \left[ \nabla \cdot ((\nu + \tilde \nu)\nabla \tilde \nu) +c_{b2} (\nabla \tilde \nu)^2) \right] - \left[ c_{w1} f_w - \frac{c_{b1}}{\kappa ^2} f_{t2} \right] \left[ \frac{\tilde \nu}{d} \right]^2 + f_{t1} \Delta \mathbf{U} ^2
$$$$
\nu_t = \tilde \nu f_{v1} ,
f_{v1} = \frac{\chi ^3}{\chi ^3 + c_{v1} ^3} ,
\chi = \frac{\nu_t} {\nu}
$$$$
\tilde S = \Omega + \frac {\tilde \nu} {\kappa ^2 d^2} f_{v2} ,
\Omega = \sqrt {2} |\mathbf{W}|,
\mathbf{W} = \frac{1}{2} (\nabla \mathbf{U} - \nabla \mathbf{U} ^T) ,
f_{v2} = 1-\frac{\chi}{1+\chi f_{v1}}
$$
说明:原文用的是$S$表示涡量,这里和网页保持一致,用的$\Omega$。$$
f_w = g \left[\frac {1+c_{w3}^6}{g^6+c_{w3}^6} \right]^{1/6}
$$$$
g = r + c_{w2} (r^6 - r) ,
r = min \left[\frac{\tilde \nu}{\tilde S \kappa ^2 d^2}, 10 \right]
$$$$
f_{t2} = c_{t3} exp(- c_{t4} \chi ^2)
$$$$
f_{t1} = c_{t1} g_t exp \left(- c_{t2} \frac{\omega_t ^2}{\Delta \mathbf{U} ^2}[d^2+g_t ^2 d_t^2] \right) ,
g_t = min \left(0.1, \frac{\Delta \mathbf{U}}{\omega_t \Delta x_t} \right)
$$$$
c_{b1} = 0.1355 ,
\sigma = 2/3 ,
c_{b2} = 0.622 ,
\kappa = 0.41 ,
c_{w1} = \frac{c_{b1}}{\kappa ^2} + \frac{1+c_{b2}}{\sigma}
$$$$
c_{w2} = 0.3 ,
c_{w3} = 2 ,
c_{v1} = 7.1 ,
c_{t1} = 1 ,
c_{t2} = 2 ,
c_{t3} = 1.2 ,
c_{t4} = 0.5
$$壁面边界条件:
$$
\tilde \nu_{wall} = 0 ,
\nu_{t,wall} = 0
$$far field边界条件:
注:方程有无最后一项,far field边界条件是不一样的,如下:
$$
0 \leq \tilde \nu_{farfield} < \frac{1}{10} \nu_{\infty} ,
0 \leq \nu_{t,farfield} < 0.27940 \times 10^{-6} \nu_{\infty}
$$$$
3\nu_{\infty} \leq \tilde \nu_{farfield} \leq 5 \nu_{\infty} ,
0.210438\nu_{\infty} \leq \nu_{t,farfield} \leq 1.294234 \nu_{\infty}
$$ -
$$
\frac{\p\alpha \rho \tilde{\nu}}{\p t} +\nabla\cdot \left( \alpha \rho \bfU \tilde{\nu} \right)- \nabla\cdot\left(\alpha \rho D_{\tilde{\nu}}\nabla \tilde{\nu} \right)
= \alpha\rho \frac{C_{b2}}{\sigma_{\nu_t}} |\nabla \tilde{\nu}|^2
+\alpha\rho C_{b1} \tilde{\nu}\tilde{S}
-\alpha\rho C_{w1} f_w\frac{\tilde{\nu}^2}{{y}^2}+S_{\tilde{\nu}}
$$$$
S_{\tilde{\nu}}=-\alpha\rho f_{t2}\tilde{\nu}\tilde{S}+\alpha\rho f_{t1}(\Delta\bfU)^2+\alpha\rho f_{t2}\frac{C_{b1}}{\kappa^2}\frac{\tilde{\nu}^2}{y^2}
$$我对比了一些,主要是多了个上面这个源项。所以OpenFOAM植入这个应该就是所谓的没有$f_{t2}$项与trip项的SA模型。但是这个$\Delta\bfU$还有后面的$\Delta x$怎么理解?
$\Delta\bfU$ is the difference between the velocity at the field point and that at the trip (on the wall)
-
-
A "trip" in the context of computational fluid dynamics (CFD) and the Spalart-Allmaras turbulence model refers to a turbulent trip. Specifically:
A turbulent trip is a device used to trigger a transition from laminar to turbulent flow in a fluid dynamics experiment or simulation. Fluids can flow in either a smooth, laminar state or a chaotic, turbulent state depending on conditions like velocity, viscosity, and surface roughness.
In CFD using the Spalart-Allmaras model, adding a "trip term" attempts to model the effects of an actual physical trip device that would be used in an experimental flow setup. This trip modeling triggers the transition to turbulence in the simulation.
So in the sentence you referenced, the "trip term" refers to an addition made to the Spalart-Allmaras equations that mimics the effect of a physical turbulent trip, forcing a transition from laminar to turbulent modeling. This trip modeling can be important to accurately replicating real experimental conditions in the CFD simulation.
-
A turbulent trip is a device...
厉害了各位老铁。我知道了。感觉这个trip应该不需要植入,如果没有trip的话。那对于没有trip的SA模型,就是
$$
\frac{\p\alpha \rho \tilde{\nu}}{\p t} +\nabla\cdot \left( \alpha \rho \bfU \tilde{\nu} \right)- \nabla\cdot\left(\alpha \rho D_{\tilde{\nu}}\nabla \tilde{\nu} \right)
= \alpha\rho \frac{C_{b2}}{\sigma_{\nu_t}} |\nabla \tilde{\nu}|^2
+\alpha\rho C_{b1} \tilde{\nu}\tilde{S}
-\alpha\rho C_{w1} f_w\frac{\tilde{\nu}^2}{{y}^2}+S_{\tilde{\nu}}
$$$$
S_{\tilde{\nu}}=-\alpha\rho f_{t2}\tilde{\nu}\tilde{S}
+\alpha\rho f_{t2}\frac{C_{b1}}{\kappa^2}\frac{\tilde{\nu}^2}{y^2}
$$只需要搞ft2就可以。要简单不少。那个ft1太长了。
-
没人试试SA么,那我还是把坑填上吧。
@xpqiu 在 Wray-Agarwal湍流模型 中说:
A "trip" in the context of
@李东岳 在 Wray-Agarwal湍流模型 中说:
只需要搞ft2就可以。要简单不少。那个ft1太长了。
对,我也这么理解的。
含$f_{t2}$两项,不含$f_{t1}$的SA模型,of10版本。mySpalartAllmaras里wmake,pitzDaily里simpleFoam。感兴趣的可以试试,已测试,没问题,供参考。mySpalartAllmarasTurbulenceModel.tar.xz
注:11楼和14楼的源项少了一个系数$C_{b1}$,应该是:
$$
S_{\tilde \nu} = -\alpha \rho C_{b1} f_{t2} \tilde \nu \tilde S + \alpha \rho \frac{C_{b1}}{\kappa ^2} f_{t2} \left[ \frac{\tilde \nu}{y} \right]^2
$$ -
-