速度出口边界条件有问题,改成防止回流的边界条件就可以。
一朵苍凉 发布的最新帖子
-
使用overInterDyMFoam计算均匀来流的圆柱入水问题
参照一篇论文在做圆柱入水问题,该论文是基于star CCM+计算了均匀风和流速下,圆柱垂直入水问题。想学着使用OpenFOAM复现一下。
网格是基于snappyHexMesh和blockMesh生成的,几何比较简单,网格如下图所示。使用KOmegaSST湍流模型进行计算,近壁面处理使用全壁面函数。发现CN的时间离散格式不支持MULES方法的SubCycles,所以将时间离散格式又改成了Euler,对流项的离散格式除了湍流相关物理量使用upwind格式,其余都使用二阶格式。扩散项使用中心差分格式,oversetInterpolation使用inverseDistance。fvSchemes和fvSolution的设置贴于下方。现在的问题是静水计算没有问题。之前做的其他使用overInterDyMFoam和波浪入射条件的也都没啥问题。因为均匀来流的问题和DTCHull计算船舶阻力的问题很相似,所以边界条件是参照DTCHull算例进行设置的,按照我的理解应该是没有问题的。但是加上来流之后计算就几乎是一提交就崩溃退出。麻烦各位前辈帮忙分析一下原因和解决方法。防沉,手动艾特一下大佬~ @队长别开枪 , @wwzhao
网格布置
初边值条件FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object alpha; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { #includeEtc "caseDicts/setConstraintTypes"//为基类型提供自动的边界条件,oversetPatch和sides inlet { type fixedValue; //提供一个固定值约束 value $internalField; } outlet { type variableHeightFlowRate;//提供基于局部流动条件的相分数条件,其中值被限制在用户定义的下限和上限之间。 lowerBound 0; upperBound 1; value $internalField; } stationaryWalls { type zeroGradient; //从边界面内部场向边界面应用零梯度边界条件 } atmosphere { type inletOutlet;//提供一般流出条件,在有回流的情况下具有指定的流入量 inletValue uniform 0; value uniform 0; } floatingObject { type zeroGradient; //从边界面内部场向边界面应用零梯度边界条件 } } FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { #includeEtc "caseDicts/setConstraintTypes"//为oversetPatch和sides指定默认基类型,这里是oversetPatch和sides inlet { type fixedFluxPressure; value $internalField; } outlet { type zeroGradient; } stationaryWalls { type fixedFluxPressure; value $internalField; } atmosphere { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } floatingObject { type fixedFluxPressure; value $internalField; } } FoamFile { version 2.0; format ascii; class pointVectorField; object pointDisplacement; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; internalField uniform (0 0 0); boundaryField { #includeEtc "caseDicts/setConstraintTypes"//为基类型提供默认边界条件,oversetPatch和sides inlet { type fixedValue; value uniform (0 0 0); } outlet { type fixedValue; value uniform (0 0 0); } stationaryWalls { type fixedValue; value uniform (0 0 0); } atmosphere { type fixedValue; value uniform (0 0 0); } floatingObject { type calculated; value uniform (0 0 0); } oversetPatch { patchType overset; type zeroGradient; } sides { patchType overset; type zeroGradient; } } FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Umean 1.525; mUmean -1.525; dimensions [0 1 -1 0 0 0 0]; internalField uniform ($mUmean 0 0); boundaryField { #includeEtc "caseDicts/setConstraintTypes"//为基类型提供自动的边界条件,主要指oversetPatch和sides inlet { type fixedValue; value $internalField; } outlet { type outletPhaseMeanVelocity; alpha alpha.water; Umean $Umean; value $internalField; } stationaryWalls { type fixedValue; value uniform (0 0 0); } atmosphere { type pressureInletOutletVelocity; tangentialVelocity $internalField; value uniform (0 0 0); } floatingObject { type movingWallVelocity; value uniform (0 0 0); } } FoamFile { version 2.0; format ascii; class volScalarField; object zoneID; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { #includeEtc "caseDicts/setConstraintTypes"//为基类型提供自动的边界条件 inlet { type zeroGradient; } outlet { type zeroGradient; } stationaryWalls { type zeroGradient; } atmosphere { type zeroGradient; } floatingObject { type zeroGradient; } }
运动属性定义
FoamFile { version 2.0; format ascii; class dictionary; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // motionSolverLibs (sixDoFRigidBodyMotion); dynamicFvMesh dynamicOversetFvMesh; solver sixDoFRigidBodyMotion; solver { type Newmark; } sixDoFRigidBodyMotionCoeffs { patches (floatingObject); innerDistance 100.0; outerDistance 101.0; centreOfMass (0 0 0.1); velocity (0 0 -6.1);//下落速度 // Density of the solid rhoSolid 898.38; D 0.05; L 0.2; // Cuboid mass mass 0.3528; // 关于质心的物体转动惯量 momentOfInertia (0.00123 0.00123 1.1025e-4); rhoInf 1; report on; accelerationRelaxation 0.5; accelerationDamping 1.0; solver { type Newmark; } constraints { } restraints { } }
离散格式和求解设置
FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { //default CrankNicolson 0.5; default Euler; } gradSchemes { //default cellLimited Gauss linear 1; default cellLimited Gauss linear 0.5; grad(U) cellLimited Gauss linear 1; //grad(k) cellLimited Gauss linear 1; //grad(omega) cellLimited Gauss linear 1; grad(yPsi) cellLimited Gauss linear 1.0; } divSchemes { default none; div(rhoPhi,U) Gauss linearUpwind grad(U); div(U) Gauss linear; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; //div(phi,k) Gauss linearUpwind default; //div(phi,omega) Gauss linearUpwind default; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; } laplacianSchemes { default Gauss linear limited 0.5; } interpolationSchemes { default linear; } snGradSchemes { default limited 0.5; } oversetInterpolation { //method cellVolumeWeight;//一阶精度 method inverseDistance;//二阶精度 } /* oversetInterpolationRequired { //omega; //k; //nut; } */ oversetInterpolationSuppressed { grad(p_rgh); surfaceIntegrate(phiHbyA); } fluxRequired { default no; p_rgh; pcorr; alpha.water; } wallDist//湍流近壁面距离计算 { //method meshWave; method Poisson; } FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "cellDisplacement.*" { solver PCG; preconditioner DIC; tolerance 1e-06; relTol 0; maxIter 100; } "alpha.water.*" { nAlphaCorr 3; nAlphaSubCycles 2; cAlpha 1; icAlpha 0; MULESCorr yes; nLimiterIter 5; alphaApplyPrevCorr no; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; } "pcorr.*" { solver PCG; preconditioner DIC; tolerance 1e-9; relTol 0; } p_rgh { solver PBiCGStab; preconditioner DILU; tolerance 1e-9; relTol 0.01;//松迭代 } p_rghFinal//使用PISO和PIMPLE的时候需要定义最后一个压力修正步 { $p_rgh; relTol 0; } yPsi { solver PBiCGStab; preconditioner DILU; tolerance 1e-6; relTol 0.0; } "(U|k|omega|epsilon).*" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-08; relTol 0; } } PIMPLE { momentumPredictor yes; nOuterCorrectors 5; nCorrectors 2; nNonOrthogonalCorrectors 1; ddtCorr yes; correctPhi no; checkMeshCourantNo yes; //D no moveMeshOuterCorrectors no; turbOnFinalIterOnly no; oversetAdjustPhi no; } relaxationFactors { fields { } equations { ".*" 1; } } cache {}
-
RE: 讨论下与openfoam匹配的画网格软件
@队长别开枪 您好,我在OF8中编译了ccm26ToFoam,想模拟波物相互作用,转化后的网格checkMesh也是ok的,转化之后的网格我放到OF v1912里面进行计算的(还没编译ccmToFoam),但是相同的设置用OpenFOAM自带的sHM划分的网格可以计算,ccm26ToFoam转化的网格却在0.02s就突然发散了。想问一下有什么解决办法吗?
-
RE: OpenFOAM动网格疑问,求助:想求解两个浮体的六自由度运动
不好意思,我来歪个楼
老师好,
我的问题不是双浮体,是一个浮体上的两个部分,如下图所示,因为想关注月池部分的受力,所以在划分边界面的时候,将船体边界面划分为hull和moonpool两个部分,方便在functionObject中分别监测这两个边界面的受力。但是问题来了,由于释放了两个自由度,现在不知道该怎么定义这本属于一个浮体上的两个边界面的运动属性了。想请问一下这种情况可以定义吗,还是干脆固定自由度得了....... -
RE: 以DTCHullWave算例为例 ,使用dynamicmeshDict计算船舶波浪增阻,这里参数的意义是我所标注的这个意思吗?
@souliam 这个centerofmass是质心,orientation应该是旋转中心吧,一般可以默认旋转中心在质心处(个人理解)。
-
RE: 以DTCHullWave算例为例 ,使用dynamicmeshDict计算船舶波浪增阻,这里参数的意义是我所标注的这个意思吗?
@souliam 看起来你释放了一个平动和三个转动,不确定你的惯性矩等几何参数设置是否正确。为什么浮体网格表面看起来那么稀?
-
RE: 以DTCHullWave算例为例 ,使用dynamicmeshDict计算船舶波浪增阻,这里参数的意义是我所标注的这个意思吗?
@souliam
运行很快崩溃的话,可能是存在非常致命的问题。首先确保网格是mesh ok的,然后确保物体的几何属性例如质量惯性矩这些都没问题,如果还是很快crash的话,可以适当增大pimple求解的外循环次数。 -
RE: interFoam求解器计算出的摩擦阻力被低估
@cresendo 嗯呐,回头试试,你把湍流粘度比调大之后,nut的边界条件就可以不使用粗糙度边界条件了吧?我现在觉得DTCHull的nut边界条件使用粗糙度边界条件可能是为了在一定程度上修正粘性阻力被低估的问题......
-
RE: interFoam求解器计算出的摩擦阻力被低估
@李东岳 谢谢前辈回复,star ccm+为了程序的鲁棒性,很多参数都有默认设置,所以没有保证完全一致,但是基本上差不多。