interFoam自适应网格问题dynamicRefine在codeFixedValue边界计算过程中报错

麻烦哪位大佬遇到过类似的问题,帮忙解决一下,谢谢!
问题描述:
利用inter(DyM)Foam一个圆柱射流进入大空间:
image
通过blockMesh进行网格划分,利用codeFixedValue设置圆柱形液柱的入口面。
U边界:

    type            codedFixedValue;
    value           uniform (0 0 0);   
    name            liquidColumnVelocity;
    code            #{
        const scalar columnVelocity = 10;
        const scalar radiusLiquidColumn = 4e-4;
    const vectorField& Cf = patch().Cf();
        const scalar yc = 0.01;
        const scalar zc = 0.0;
    forAll(Cf,faceI)
        {
            const scalar deltay = Cf[faceI].y()-yc;
            const scalar deltaz = Cf[faceI].z()-zc;
            const scalar radius = sqrt(deltay*deltay+deltaz*deltaz);
            if(radius<=radiusLiquidColumn)
            {
                (*this)[faceI] = vector(columnVelocity,0,0);            
            }
        }
#};

alpha.water边界

    type            codedFixedValue;
    value           uniform 0;   
    name            liquidColumnAlpha1;
    code            #{
        const scalar radiusLiquidColumn= 4e-4;    
    const vectorField& Cf = patch().Cf();
        const scalar yc = 0.01;
        const scalar zc = 0.0;

    forAll(Cf,faceI)
        {
            const scalar deltay = Cf[faceI].y()-yc;
            const scalar deltaz = Cf[faceI].z()-zc;
            const scalar radius = sqrt(deltay*deltay+deltaz*deltaz);
            if(radius<=radiusLiquidColumn)
            {
                (*this)[faceI] = 1.0;
            }
        }
#};

报错描述
当不使用自适应网格时,算例正常计算;当采用自适应网格功能interDyMFoam,网格未加密前(未达到设置加密条件),正常计算;网格开始加密计算中断,报错如下:

Courant Number mean: 4.98466e-06 max: 0.00220318
Interface Courant Number mean: 0 max: 0
deltaT = 6.18034e-08
Time = 3.11186e-07

Selected 0 cells for refinement out of 384000.
Selected 0 split points out of a possible 0.
smoothSolver: Solving for alpha.water, Initial residual = 0.061072, Final residual = 2.16265e-15, No Iterations 2
Phase-1 volume fraction = 3.73802e-07 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 3.73802e-07 Min(alpha.water) = -8.38315e-28 Max(alpha.water) = 1
DICPCG: Solving for p_rgh, Initial residual = 0.109645, Final residual = 0.00458278, No Iterations 5
time step continuity errors : sum local = 8.25061e-11, global = 4.48406e-13, cumulative = 6.73588e-12
DICPCG: Solving for p_rgh, Initial residual = 0.0059725, Final residual = 0.000280082, No Iterations 19
time step continuity errors : sum local = 4.64407e-12, global = 1.03878e-12, cumulative = 7.77466e-12
DICPCG: Solving for p_rgh, Initial residual = 0.000280406, Final residual = 9.32371e-08, No Iterations 86
time step continuity errors : sum local = 1.54319e-15, global = 1.34038e-17, cumulative = 7.77467e-12
ExecutionTime = 38.03 s ClockTime = 46 s

Courant Number mean: 5.97925e-06 max: 0.0026174
Interface Courant Number mean: 8.02695e-08 max: 0.0026174
deltaT = 7.41181e-08
Time = 3.85304e-07

Selected 12 cells for refinement out of 384000.
Refined from 384000 to 384084 cells.
Selected 0 split points out of a possible 12.
DICPCG: Solving for pcorr, Initial residual = 1, Final residual = 8.07683e-06, No Iterations 124
time step continuity errors : sum local = 7.03583e-13, global = -1.22968e-15, cumulative = 7.77345e-12
smoothSolver: Solving for alpha.water, Initial residual = 0.00350774, Final residual = 8.77793e-10, No Iterations 1
Phase-1 volume fraction = 3.96963e-07 Min(alpha.water) = 0 Max(alpha.water) = 1
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 3.962e-07 Min(alpha.water) = -2.57151e-25 Max(alpha.water) = 1
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in “/lib64/libc.so.6”
#3 double Foam::sumProd(Foam::UList const&, Foam::UList const&) at ??:?
#4 Foam::PCG::solve(Foam::Field&, Foam::Field const&, unsigned char) const at ??:?
#5 Foam::fvMatrix::solveSegregated(Foam::dictionary const&) at ??:?
#6 Foam::fvMatrix::solve(Foam::dictionary const&) at ??:?
#7 Foam::fvMatrix::solve() at ??:?
#8 ? at ??:?
#9 __libc_start_main in “/lib64/libc.so.6”
#10 ? at ??:?
Floating point exception (core dumped)
请问论坛上的各位大佬怎么解决?万分感谢!

我之前用了一个比较麻烦的办法,画一层比较密的单层网格在边界上,用AMI边界连接它和剩余网格,然后,重新改写一下 dynamicRefine求解器,把边界上的这个单层网格加入protectCell里面,就可以运行了,效果是正常的。猜测可能是因为自适应加密用了八叉树存储网格,存储格式和一般格式不太一样,导致边界面上的信息不能被codeStream读取。

2 个赞

非常感谢!大佬!虽然您说的操作对目前的我操作稍显复炸,但至少知道原因了,哈哈哈啊哈哈哈