OpenFOAM可压缩管流边界条件设置



  • 新手入门,请教OpenFOAM可压缩管流边界条件设置
    进口条件:Ma=0.6 P=101325(静压) T=300K(静温)
    出口条件:P=101325(静压) T=300K(静温)
    壁面:noSlip
    使用的Foam:sonicFoam

    在设置的时候不知道应该选用什么样的边界条件和求解器才能达到想要的效果,使用进口固定值出口零梯度又会发散,残差很大

    P

    
    dimensions      [1 -1 -2 0 0 0 0];
    
    internalField   uniform 101325;
    
    boundaryField
    {
        inlet
        {
            type            fixedValue;
            value           uniform 101325;
        }
    
        outlet
        {
    	type            zeroGradient;
        }
    
        sym
        {
            type            symmetryPlane;
        }
    
        wall
        {
            type            zeroGradient;
        }
    }
    
    

    U

    dimensions      [0 1 -1 0 0 0 0];
    
    internalField   uniform (208.3 0 0);
    
    boundaryField
    {
        inlet
        {
            type            fixedValue;
            value           uniform (208.3 0 0);
        }
    
        outlet
        {
            type            zeroGradient;
        }
    
        sym
        {
            type            symmetryPlane;
        }
    
        wall
        {
            type            noSlip;
        }
    }
    
    

    T

    dimensions      [0 0 0 1 0 0 0];
    
    internalField   uniform 300;
    
    boundaryField
    {
        inlet
        {
            type            fixedValue;
            value           uniform 300;
        }
    
        outlet
        {
            type            zeroGradient;
        }
    
        sym
        {
            type            symmetryPlane;
        }
    
        wall
        {
            type            zeroGradient;
        }
    }
    
    

    thermophysicalProperties

    thermoType
    {
        type            hePsiThermo;
        mixture         pureMixture;
        transport       const;
        thermo          hConst;
        equationOfState perfectGas;
        specie          specie;
        energy          sensibleInternalEnergy;
    }
    
    mixture
    {
        specie
        {
            molWeight       28.9;
        }
        thermodynamics
        {
            Cp              2.5;
            Hf              0;
        }
        transport
        {
            mu              0;
            Pr              1;
        }
    }
    
    

    turbulenceProperties

    simulationType  laminar;
    

    controlDict

    application     sonicFoam;
    
    startFrom       startTime;
    
    startTime       0;
    
    stopAt          endTime;
    
    endTime         10;
    
    deltaT          5e-8;
    
    writeControl    runTime;
    
    writeInterval   1e-6;
    
    purgeWrite      0;
    
    writeFormat     ascii;
    
    writePrecision  6;
    
    writeCompression off;
    
    timeFormat      general;
    
    timePrecision   6;
    
    runTimeModifiable true;
    
    functions
    {
        libs            ("libfieldFunctionObjects.so");
    
        Ma
        {
            type            MachNo;
            executeControl  writeTime;
            writeControl    writeTime;
        }
    }
    

    fvSchemes

    ddtSchemes
    {
        default         Euler;
    }
    
    gradSchemes
    {
        default         Gauss linear;
    }
    
    divSchemes
    {
        default         none;
        div(phi,U)      Gauss upwind;
        div(phid,p)     Gauss limitedLinear 1;
        div(phi,e)      Gauss limitedLinear 1;
        div(phi,K)      Gauss limitedLinear 1;
        div(phiv,p)     Gauss limitedLinear 1;
        div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
    }
    
    laplacianSchemes
    {
        default         Gauss linear corrected;
    }
    
    interpolationSchemes
    {
        default         linear;
    }
    
    snGradSchemes
    {
        default         corrected;
    }
    

    fvSolution

    solvers
    {
        "p.*"
        {
            solver          smoothSolver;
            smoother        symGaussSeidel;
            tolerance       1e-06;
            relTol          0;
        }
    
        "(U|e).*"
        {
            $p;
            tolerance       1e-05;
            relTol          0;
        }
    
        "rho.*"
        {
            solver          PCG;
            preconditioner  DIC;
            tolerance       1e-05;
            relTol          0;
        }
    }
    
    PIMPLE
    {
        nOuterCorrectors 2;
        nCorrectors      1;
        nNonOrthogonalCorrectors 0;
    }
    

    终端

    Create time
    
    Create mesh for time = 0
    
    
    PIMPLE: No convergence criteria found
    
    
    PIMPLE: No corrector convergence criteria found
            Calclations will do 2 corrections
    
    Reading thermophysical properties
    
    Selecting thermodynamics package 
    {
        type            hePsiThermo;
        mixture         pureMixture;
        transport       const;
        thermo          hConst;
        equationOfState perfectGas;
        specie          specie;
        energy          sensibleInternalEnergy;
    }
    
    Reading field U
    
    Reading/calculating face flux field phi
    
    Creating turbulence model
    
    Selecting turbulence model type laminar
    Selecting laminar stress model Stokes
    Creating field kinetic energy K
    
    No MRF models present
    
    No finite volume options present
    
    Starting time loop
    
    Time = 1e-07
    
    Courant Number mean: 0.0179457 max: 1.04496
    diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
    PIMPLE: Iteration 1
    smoothSolver:  Solving for Ux, Initial residual = 5.30982e-06, Final residual = 5.30982e-06, No Iterations 0
    smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.0354675, No Iterations 1000
    smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 0.100472, No Iterations 1000
    smoothSolver:  Solving for e, Initial residual = 1, Final residual = 7.6181, No Iterations 1000
    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::sigFpe::sigHandler(int) at ??:?
    #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
    #3  Foam::symGaussSeidelSmoother::smooth(Foam::word const&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::Field<double> const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, unsigned char, int) at ??:?
    #4  Foam::symGaussSeidelSmoother::smooth(Foam::Field<double>&, Foam::Field<double> const&, unsigned char, int) const at ??:?
    #5  Foam::smoothSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
    #6  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
    #7  Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/home/jifeng/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/bin/sonicFoam"
    #8  Foam::fvMatrix<double>::solve() in "/home/jifeng/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/bin/sonicFoam"
    #9  ? in "/home/jifeng/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/bin/sonicFoam"
    #10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
    #11  ? in "/home/jifeng/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/bin/sonicFoam"
    
    


  • 替代文字



  • 速度方向对么,你的速度迭代了很多次,

    另外,你的mu是0,应该是壁面:slip

    Courant Number mean: 0.0179457 max: 1.04496
    同时减小你的时间步长



  • @东岳
    谢谢李老师,我检查了一下速度方向,是正确的,但mu是0是因为我参照的tutorials里面的给定方法,自己也不太清楚具体应该怎么修改,这个mu和之前算incom里面的nu是一个意思吗?
    我刚刚在自己电脑上重新设置了一下,修改该了一些边界条件,用的是rhoCentralFoam,现在没有发散并且正在计算了,时间步长我修改了,可以计算也没有发散
    P

    dimensions      [1 -1 -2 0 0 0 0];
    
    internalField   uniform 101325;
    
    boundaryField
    {
        inlet
        {
            type            fixedValue;
            value           uniform 101325;
        }
    
        outlet
        {
            type            zeroGradient;
            phi             phi;
            rho             rho;
            psi             thermo:psi;
            U               U;
            gamma           1.4;
            inletOutlet     false;
            correctSupercritical true;
            lInf            0;
            fieldInf        101325;
            value           uniform 101325;
        }
    
        sym
        {
            type            symmetryPlane;
        }
    
        wall
        {
            type            zeroGradient;
        }
    }
    

    U

    dimensions      [0 1 -1 0 0 0 0];
    
    internalField   uniform (208.3 0 0);
    
    boundaryField
    {
        inlet
        {
            type            fixedValue;
            value           uniform (208.3 0 0);
        }
    
        outlet
        {
            type           zeroGradient;
            inletValue     uniform (0 0 0);
            value          $internalField;
        }
    
        sym
        {
            type            symmetryPlane;
        }
    
        wall
        {
            type            noSlip;
        }
    

    T

    dimensions      [0 0 0 1 0 0 0];
    
    internalField   uniform 300;
    
    boundaryField
    {
        inlet
        {
            type            fixedValue;
            value           uniform 300;
        }
    
        outlet
        {
            type            zeroGradient;
        }
    
        sym
        {
            type            symmetryPlane;
        }
    
        wall
        {
            type            zeroGradient;
        }
    

    thermophysicalProperties

    thermoType
    {
        type            hePsiThermo;
        mixture         pureMixture;
        transport       const;
        thermo          hConst;
        equationOfState perfectGas;
        specie          specie;
        energy          sensibleInternalEnergy;
    }
    
    mixture // air at room temperature (293 K)
    {
        specie
        {
            molWeight   28.9;
        }
        thermodynamics
        {
            Cp          1005;
            Hf          0;
        }
        transport
        {
            mu          0;
            Pr          0.71;
        }
    }
    

    turbulenceProperties

    simulationType laminar;
    

    我下面想进行有粘可压计算,但我不知道0文件里面增加的alphat、k、nut、omega的初始条件和边界值具体应该给多少,请问李老师这个有什么可以参考的吗?



  • mu和nu就是粘度,

    0文件里面增加的alphat、k、nut、omega的初始条件和边界值具体应该给多少

    这个不好弄。k和omega都给固定值进口就可以,具体数值可以算一下:$k=1.5u'^2,\varepsilon=\frac{C_\mu^{0.75}k^{1.5}}{\kappa l},\kappa=0.4, \omega=\frac{k}{0.09\varepsilon}$,其中$l$为参考长度(自定义取值)



  • @东岳
    恩恩,好的,我按照老师的思路再来来设置一下,谢谢李老师



  • 变物性?



  • 不是的,后面我用komegaSST算了一下这个模型,吧压力求解器改成了PCG之后就收敛了,而且结果比较满意,希望对遇到同样问题的朋友也有参考价值


Log in to reply
 

CFD中文网 2016 - 2020 | 京ICP备15017992号-2