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是因为我参照的tutorials里面的给定方法,自己也不太清楚具体应该怎么修改,这个mu和之前算incom里面的nu是一个意思吗?
我刚刚在自己电脑上重新设置了一下,修改该了一些边界条件,用的是rhoCentralFoam,现在没有发散并且正在计算了,时间步长我修改了,可以计算也没有发散
Pdimensions [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的初始条件和边界值具体应该给多少,请问李老师这个有什么可以参考的吗?