求助 把snappyHexMesh例题里的modle换了,网格划分都正常checkMesh也正常 为什么在paraview上显示不出来
-
@Ryo
inlet 和 outlet 边界条件需要在你的 STL 文件中指定。也就是说,你需要将inlet 和 outlet 面单独导出来。在 STL 文件中,inlet 和 outlet 需要是单独的solid,我给你看一个STL文件的示例:solid inlet facet normal 0 1 0 outer loop vertex 2.75 7.7 5.52 vertex 2.75 7.7 0 vertex 0 7.7 0 endloop endfacet facet normal 0 1 0 outer loop vertex 2.75 7.7 5.52 vertex 0 7.7 0 vertex 0 7.7 5.52 endloop endfacet endsolid inlet solid outlet facet normal 0 0 -1 outer loop vertex 2.75 -0.3 0 vertex 2.75 0 0 vertex 6.15 -0.3 0 endloop endfacet facet normal 0 0 -1 outer loop vertex 0 0 0 vertex 0 7.7 0 vertex 2.75 7.7 0 endloop endfacet endsolid outelt solid other facet normal -1 0 0 outer loop vertex 2.75 8 0 vertex 2.75 7.7 0 vertex 2.75 7.7 5.52 endloop endfacet facet normal -1 0 0 outer loop vertex 2.75 8 0 vertex 2.75 7.7 5.52 vertex 2.75 8 6.5 endloop endfacet facet normal -1 0 0 outer loop vertex 2.75 0 0 vertex 2.75 -0.3 0 vertex 2.75 0 5.52 endloop endfacet facet normal -1 0 0 outer loop vertex 2.75 7.7 5.52 vertex 2.75 0 5.52 vertex 2.75 -0.3 6.5 endloop endfacet facet normal -1 -0 0 outer loop vertex 2.75 8 6.5 vertex 2.75 7.7 5.52 vertex 2.75 -0.3 6.5 endloop endfacet facet normal -1 -0 0 outer loop vertex 2.75 0 5.52 vertex 2.75 -0.3 0 vertex 2.75 -0.3 6.5 endloop endfacet endsolid other
-
@xpqiu 感谢 回复!真的很感谢
学openfoam学的太纠结了。。感觉从建模到网格划分都一团糊 我把我想做的模拟说一下吧希望您能给点指导意见。。想用一个冲击波管发生冲击波然后从一个单一孔喷出,模拟喷出的气体观察在喷出口的气体,并不想模拟在管道内的流动。
所以在CAD建模的时候要把气体喷出后的空气区域也放在模型里吗,如果是这样的话inlet是管道的起始位置outlet是空气区域的尾部吗?
这个是前辈用fluent做出来的葱两个孔喷出的
现在做了一个有3mm长的管道和一个18mm半径20mm长的圆柱,圆柱用来表示从管道喷出的空气区域。
-
对,后的空气区域也要用CAD画出来,而且应该画得足够大以减少边界条件的影响。画网格的时候,空气区域中心部分与喷口相接的位置要画得很密,外围可以逐渐变稀。inlet 是管道起始位置,outlet可以是空气区域尾部,但是注意空气区域的圆柱面也可以用出口边界,因为那个圆柱面不是一个实体的壁面,所以不能用无滑移壁面边界条件。圆柱面具体是用出口边界更好还是slip边界更好,这个我没有经验,可能要试试才知道。但如果你的空气区域足够大,应该影响不大。
你说不需要模拟在管道内的流动,那还有一种选择是直接忽略管道部分,而用管道部分的尾部当作喷口。但是这样做的代价是你可能需要自己写一个边界条件,来模拟喷口的冲击波。
-
@xpqiu 感谢回复!
现在把inlet,outlet和本体分开转换成stl文件 然后snappyHexMesh了一下
圆柱是r=18mm h=20mm inlet尺寸是r=1.5mm,h=3mm这样够不够大?现在想按您说的把空气区域和喷口区域网格如何变的密集?该添加哪些代码。。 求指导一下
这个是我现在的snappyHexMeshDicFoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}castellatedMesh true; // make basic mesh ?
snap true; // decide to snap back to surface ?
addLayers true; // decide to add viscous layers ?geometry // Load in STL files here
{
inlet.stl {type triSurfaceMesh; name inlet;}
outlet.stl {type triSurfaceMesh; name outlet;}
wall.stl {type triSurfaceMesh; name wall;}
volume.stl {type triSurfaceMesh; name volume;}
refinementBox {type searchableBox; min (-0.03 -0.03 -0.03); max ( 0.03 0.3 0.3);}
};castellatedMeshControls
{
maxLocalCells 1000000; //max cells per CPU core
maxGlobalCells 2000000; //max cells to use before mesh deletion step
minRefinementCells 10; //was 0 - zero means no bad cells are allowed during refinement stages
maxLoadUnbalance 0.10;
nCellsBetweenLevels 1; // expansion factor between each high & low refinement zone// Explicit feature edge refinement // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command ( {file "inlet.eMesh"; level 2;} {file "outlet.eMesh"; level 2;} {file "wall.eMesh"; level 2;} ); // Surface based refinement // ~~~~~~~~~~~~~~~~~~~~~~~~ refinementSurfaces // Surface-wise min and max refinement level { inlet {level (0 0);}
outlet {level (0 0);}
wall {level (3 3);}
}resolveFeatureAngle 80; // Resolve sharp angles // Default 30 refinementRegions // In descending levels of fine-ness {volume {mode distance; levels ((0.0006 3) (0.002 2) (0.01 1));}} // was ((0.001 4) (0.003 3) (0.01 2)) locationInMesh (0.01 0 0); //to decide which side of mesh to keep ** allowFreeStandingZoneFaces true;
}
// Settings for the snapping.
snapControls
{
nSmoothPatch 3;
tolerance 4.0;
nSolveIter 30;
nRelaxIter 5;
nFeatureSnapIter 15; // default is 10// New settings from openfoam 2.2 onwards for SHMesh
implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract
explicitFeatureSnap true; // default is true
multiRegionFeatureSnap false; // deafault is false - detects features between multiple surfaces}
// Settings for the layer addition.
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName
{
relativeSizes false; // was true
layers
{
wall
{nSurfaceLayers 3;} // was 3
}expansionRatio 1.3; finalLayerThickness 0.00016; //was 0.00016 minThickness 0.00008; //was 0.00008 nGrow 0; // was 1 // Advanced settings featureAngle 80; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle. nRelaxIter 3; //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh. nSmoothSurfaceNormals 1; // Number of smoothing iterations of surface normals nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction nSmoothThickness 10; // Smooth layer thickness over surface patches maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large minMedianAxisAngle 130; // Angle used to pick up medial axis points nBufferCellsNoExtrude 0; // Create buffer region for new layer terminations nLayerIter 50; // Overall max number of layer addition iterations
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minFlatness 0.5;
minVol 1e-13;
minTetQuality 1e-9;
minArea -1;
minTwist 0.02;
minDeterminant 0.001;
minFaceWeight 0.02;
minVolRatio 0.01;
minTriangleTwist -1;// Advanced nSmoothScale 4; errorReduction 0.75;
}
// Advanced
debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;// ************************************************************************* //