# 一个非常简单的鼓泡床face momentum算法测试+MULES

• 流场整体数据都差不多，就是下面部分网格的速度矢量反了。

• 测试了下直接求解alpha方程，简单算例下看起来结果完全一样

MULES的log，最后相分数是0.00850027:

Courant Number mean: 0.00800555 max: 0.0306176
Max Ur Courant Number = 0.072456
Time = 20

PIMPLE: iteration 1
MULES: Solving for alpha.air
MULES: Solving for alpha.air
alpha.air volume fraction = 0.00850027  Min(alpha.air) = 4.87983e-12  Max(alpha.air) = 0.5
Constructing face momentum equations
Constructing face momentum equations
GAMG:  Solving for p_rgh, Initial residual = 7.45381e-10, Final residual = 7.45381e-10, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 8.32869e-10, Final residual = 8.32869e-10, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 8.57256e-10, Final residual = 8.57256e-10, No Iterations 0
DILUPBiCGStab:  Solving for epsilon.air, Initial residual = 1.0517e-09, Final residual = 2.2197e-11, No Iterations 1
DILUPBiCGStab:  Solving for k.air, Initial residual = 1.20173e-09, Final residual = 3.23306e-11, No Iterations 1
DILUPBiCGStab:  Solving for epsilon.water, Initial residual = 1.27695e-09, Final residual = 8.86065e-12, No Iterations 1
DILUPBiCGStab:  Solving for k.water, Initial residual = 1.1219e-09, Final residual = 1.42201e-11, No Iterations 1
ExecutionTime = 50.19 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

End


求解方程的log，最后相分数是0.00849429：

Courant Number mean: 0.00800418 max: 0.0305133
Max Ur Courant Number = 0.072237
Time = 20

PIMPLE: iteration 1
diagonal:  Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0
alpha.air volume fraction = 0.00849429  Min(alpha.air) = -4.17752e-11  Max(alpha.air) = 0.5
Constructing face momentum equations
Constructing face momentum equations
GAMG:  Solving for p_rgh, Initial residual = 7.99935e-10, Final residual = 7.99935e-10, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 9.18566e-10, Final residual = 9.18566e-10, No Iterations 0
GAMG:  Solving for p_rgh, Initial residual = 9.54526e-10, Final residual = 9.54526e-10, No Iterations 0
DILUPBiCGStab:  Solving for epsilon.air, Initial residual = 8.57302e-10, Final residual = 8.57302e-10, No Iterations 0
DILUPBiCGStab:  Solving for k.air, Initial residual = 9.47766e-10, Final residual = 9.47766e-10, No Iterations 0
DILUPBiCGStab:  Solving for epsilon.water, Initial residual = 7.76961e-10, Final residual = 7.76961e-10, No Iterations 0
DILUPBiCGStab:  Solving for k.water, Initial residual = 8.9345e-10, Final residual = 8.9345e-10, No Iterations 0
ExecutionTime = 70.7 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

End



• 测试TVD（黑线）和迎风（红线）格式的区别，在目前的算例下，迎风略为耗散。型线二者差不多。

• OpenFOAM里面实际求解的方程是基于：

\frac{\partial \alpha_1}{\partial t}+ \nabla \cdot (\alpha_1 \mathbf{U})=\alpha_1 \alpha_2 \mathrm{dgdt}+\alpha_1 \nabla \cdot \mathbf{U}

目的是为了有界，基于我的不可压缩算例，测试一下直接求解相方程:

\frac{\partial \alpha_1}{\partial t}+ \nabla \cdot (\alpha_1 \mathbf{U}_\mathrm{d})=0

同时增加了点气量，看起来也是无区别

• 很多人讨论MULES，但是现在大家都不知道怎么回事，岳哥是不是分析分析这个MULES作用大么？很神奇的样子。

• @赵一铭
这个MULES是用于保证alpha低耗散+有界的，目前我在测试这个作用大不大。我的算法要去掉MULES，顺便做做测试。

刚求解一个一维两相流算例，一个采用GAMG求解，一个采用PCG。网格很少，500个。下面是log：

Time = 70

PIMPLE: iteration 1
MULES: Solving for alpha.air
MULES: Solving for alpha.air
alpha.air volume fraction = 0.9999999999999999  Min(alpha.air) = 0.9999999999999938  Max(alpha.air) = 1
Constructing momentum equations
DICPCG:  Solving for p_rgh, Initial residual = 0.7001341621875685, Final residual = 3.246057367678102e-14, No Iterations 1
DICPCG:  Solving for p_rgh, Initial residual = 0.157648897023736, Final residual = 2.705464757640693e-14, No Iterations 1
DICPCG:  Solving for p_rgh, Initial residual = 0.6904853890921069, Final residual = 2.428959127445399e-14, No Iterations 1
ExecutionTime = 9.76 s

fieldAverage fieldAverage1 write:
Calculating averages

Writing average fields

End


上面是PCG，一步收敛

Time = 7.6

PIMPLE: iteration 1
MULES: Solving for alpha.air
MULES: Solving for alpha.air
alpha.air volume fraction = 0.1520555867849422  Min(alpha.air) = 2.326855486356723e-92  Max(alpha.air) = 1
Constructing momentum equations
GAMG:  Solving for p_rgh, Initial residual = 0.9994307238357184, Final residual = 0.0008779296549588346, No Iterations 1000
GAMG:  Solving for p_rgh, Initial residual = 0.9994319366641714, Final residual = 0.0007083339635828074, No Iterations 1000
GAMG:  Solving for p_rgh, Initial residual = 0.9994305521571339, Final residual = 0.0007359406882024251, No Iterations 1000
ExecutionTime = 7.41 s


上面是GAMG，每次都需要1000步收敛。

注意：两个求解的结果都一样。

• 一个非常典型的震荡，明天测试插值到面上处理力会不会消除震荡。
太晚了回家做饭去，明天再描述。

• 我的一生，都在和震荡作斗争。