shm对于blockMesh和gmsh生成的背景网格计算时长不同



  • 遇到一个很奇怪的事情。我用gmsh画了一个背景网格,然后gmshToFoam转成OF网格,用shm添加边界层,处理时间很快,就40秒。
    但是如果我用blockMesh生成差不多的背景网格(计算域大小,最小网格尺寸一致),用相同的shm文件控制,添加边界层,处理时间慢的多,用了300秒。
    两种差不多的网格,只是生成方法不同,为何shm处理计算有这么大的差异。
    想不明白



  • 目前发现可能跟边界层法向上计算域网格数量有关。。我用blockMesh在高度方向上的网格比gmsh密一些。。我在blockMesh上改稀疏之后,shm时间变少了一些了



  • 还是不太对,时间差的太多了,gmsh的网格能3秒就画好,blockMesh的网格总量还少一些,要用30s。太奇怪了



  • blockMesh生成的背景网格用snappyHexMesh添加边界层的信息如下,用时30s

    Create time
    
    Create mesh for time = 0
    
    Read mesh in = 0.24 s
    Using #calc at line 24 in file "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/system/snappyHexMeshDict"
    Using #codeStream with "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_144513f76453493486a3a7dac85dde895435431d.so"
    Could not load "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_144513f76453493486a3a7dac85dde895435431d.so"
    /home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_144513f76453493486a3a7dac85dde895435431d.so: cannot open shared object file: No such file or directory
    Creating new library in "dynamicCode/_144513f76453493486a3a7dac85dde895435431d/platforms/linux64GccDPInt32Opt/lib/libcodeStream_144513f76453493486a3a7dac85dde895435431d.so"
    Invoking wmake libso /home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/dynamicCode/_144513f76453493486a3a7dac85dde895435431d
    wmake libso /home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/dynamicCode/_144513f76453493486a3a7dac85dde895435431d
        ln: ./lnInclude
        dep: codeStreamTemplate.C
        Ctoo: codeStreamTemplate.C
        ld: /home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/dynamicCode/_144513f76453493486a3a7dac85dde895435431d/../platforms/linux64GccDPInt32Opt/lib/libcodeStream_144513f76453493486a3a7dac85dde895435431d.so
    
    Overall mesh bounding box  : (0 0 0) (192 1 90)
    Relative tolerance         : 1e-06
    Absolute matching distance : 0.00021205
    
    Reading refinement surfaces.
    --> FOAM Warning : 
        From function Foam::refinementSurfaces::refinementSurfaces(const Foam::searchableSurfaces&, const Foam::dictionary&, Foam::label, bool)
        in file refinementSurfaces/refinementSurfaces.C at line 418
        Reading "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/system/snappyHexMeshDict.castellatedMeshControls.refinementSurfaces"
        Not all entries in refinementSurfaces dictionary were used. The following entries were not used : 1(roof)
    Read refinement surfaces in = 0 s
    
    Reading refinement shells.
    Read refinement shells in = 0 s
    
    Setting refinement level of surface to be consistent with shells.
    Checked shell refinement in = 0 s
    
    Reading features.
    Read features in = 0 s
    
    
    Determining initial surface intersections
    -----------------------------------------
    
    Edge intersection testing:
        Number of edges             : 246036
        Number of edges to retest   : 0
        Number of intersected edges : 0
    Edge intersection testing:
        Number of edges             : 246036
        Number of edges to retest   : 246036
        Number of intersected edges : 0
    Calculated surface intersections in = 0.16 s
    
    Initial mesh : cells:61380  faces:246036  points:123794
    Cells per refinement level:
        0	61380
    
    Adding patches for surface regions
    ----------------------------------
    
    Patch Type                Region                        
    ----- ----                ------                        
    Added patches in = 0 s
    
    Edge intersection testing:
        Number of edges             : 246036
        Number of edges to retest   : 0
        Number of intersected edges : 0
    Selecting decompositionMethod none [1]
    Layer thickness specified as first layer and expansion ratio.
    
    Shrinking and layer addition phase
    ----------------------------------
    
    Using mesh parameters 
    {
        maxNonOrtho     65;
        maxBoundarySkewness 20;
        maxInternalSkewness 4;
        maxConcave      80;
        minVol          1e-13;
        minTetQuality   1e-15;
        minArea         -1;
        minTwist        0.02;
        minDeterminant  0.001;
        minFaceWeight   0.02;
        minVolRatio     0.01;
        minTriangleTwist -1;
        nSmoothScale    4;
        errorReduction  0.75;
    }
    
    
    
    Merging all faces of a cell
    ---------------------------
        - which are on the same patch
        - which make an angle < 120 degrees (cos:-0.5)
        - as long as the resulting face doesn't become concave by more than 90 degrees
          (0=straight, 180=fully concave)
    
    Merging 0 sets of faces.
    
    No faces merged ...
    
    Merging all points on surface that
    - are used by only two boundary faces and
    - make an angle with a cosine of more than -0.5.
    
    No straight edges simplified and no points removed ...
    
    Checking mesh manifoldness ...
    
    Checking initial mesh ...
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
    Duplicating 0 points on faceZones of type boundary
    
    Handling points with inconsistent layer specification ...
    dupNonManifoldPoints : Found : 0 non-manifold points (out of 123794)
    
    Adding in total 0 inter-processor patches to handle extrusion of non-manifold processor boundaries.
    
    Handling points with inconsistent layer specification ...
    
    Handling non-manifold points ...
    
    Checking patch manifoldness ...
    Outside of local patch is multiply connected across edges or points at 0 points.
    Set displacement to zero for all 0 non-manifold points
    
    Handling feature edges (angle < 120) ...
    Set displacement to zero for points on 0 feature edges
    
    Handling cells with warped patch faces ...
    Set displacement to zero on 0 warped faces since layer would be > 0.5 of the size of the bounding box.
    
    patch faces    layers avg thickness[m]
                         near-wall overall
    ----- -----    ------ --------- -------
    down 330      10     0.0298    0.544   
    
    Selecting externalDisplacementMeshMover displacementMedialAxis
    displacementMedialAxis : Calculating distance to Medial Axis ...
    --> FOAM IOWarning :
        Found [v1712] 'minMedianAxisAngle' entry instead of 'minMedialAxisAngle' in dictionary "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0/system/snappyHexMeshDict.addLayersControls" 
    
        This keyword is deemed to be 24 months old.
    
    fieldSmoother : Smoothing normals ...
        Iteration 0   residual 1.17395e-17
    displacementMedialAxis : Inserting points on patch inlet if angle to nearest layer patch > 30 degrees.
    displacementMedialAxis : Inserting points on patch up if angle to nearest layer patch > 30 degrees.
    displacementMedialAxis : Inserting points on patch outlet if angle to nearest layer patch > 30 degrees.
    fieldSmoother : Smoothing normals in interior ...
        Iteration 0   residual 1.72658e-17
    
    Layer addition iteration 0
    --------------------------
    
    Determining displacement for added points according to pointNormal ...
    Detected 0 points with point normal pointing through faces.
    Reset displacement at 0 points to average of surrounding points.
    
    displacementMedialAxis : Smoothing using Medial Axis ...
    displacementMedialAxis : Reducing layer thickness at 0 nodes where thickness to medial axis distance is large 
    displacementMedialAxis : Removing isolated regions ...
    - if partially extruded faces make angle < 60
    - if exclusively surrounded by non-extruded faces
    displacementMedialAxis : Number of isolated points extrusion stopped : 0
    fieldSmoother : Smoothing field ...
        Iteration 0   residual 1.07333e-17
    displacementMedialAxis : Moving mesh ...
    displacementMedialAxis : Iteration 0
    Moving mesh using displacement scaling : min:1  max:1
    Correcting 2-D mesh motion ...done
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    displacementMedialAxis : Successfully moved mesh
    displacementMedialAxis : Finished moving mesh ...
    truncateDisplacement : Unextruded 0 faces due to non-consecutive vertices being extruded.
    truncateDisplacement : Unextruded 0 faces due to stringed edges with inconsistent extrusion.
    
    Setting up information for layer truncation ...
    Detected 0 baffles across faceZones of type internal
    
    
    Checking mesh with layer ...
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
    Extruding 330 out of 330 faces (100%). Removed extrusion at 0 faces.
    Added 3300 out of 3300 cells (100%).
    Edge intersection testing:
        Number of edges             : 259246
        Number of edges to retest   : 0
        Number of intersected edges : 0
    
    patch faces    layers   overall thickness
                           [m]       [%]
    ----- -----    ------   ---       ---
    down 330      10       0.544     100     
    
    Writing 3300 added cells to cellSet addedCells
    Writing 2970 faces inside added layer to faceSet layerFaces
    
    Writing fields with layer information:
        nSurfaceLayers    : actual number of layers
        thickness         : overall layer thickness
        thicknessFraction : overall layer thickness (fraction of desired thickness)
    
    Layer mesh : cells:64680  faces:259246  points:130414
    Cells per refinement level:
        0	64680
    Writing mesh to time constant
    Wrote mesh in = 30.25 s.
    Layers added in = 30.25 s.
    Checking final mesh ...
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    Finished meshing without any errors
    Finished meshing in = 30.82 s.
    End
    
    
    


  • gmsh生成的背景网格用snappyHexMesh添加边界层的信息如下,用时3s

    Create time
    
    Create mesh for time = 0
    
    Read mesh in = 0.41 s
    Using #calc at line 24 in file "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0copy/system/snappyHexMeshDict"
    Using #codeStream with "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0copy/dynamicCode/platforms/linux64GccDPInt32Opt/lib/libcodeStream_144513f76453493486a3a7dac85dde895435431d.so"
    
    Overall mesh bounding box  : (0 0 0) (192 1 90)
    Relative tolerance         : 1e-06
    Absolute matching distance : 0.00021205
    
    Reading refinement surfaces.
    --> FOAM Warning : 
        From function Foam::refinementSurfaces::refinementSurfaces(const Foam::searchableSurfaces&, const Foam::dictionary&, Foam::label, bool)
        in file refinementSurfaces/refinementSurfaces.C at line 418
        Reading "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0copy/system/snappyHexMeshDict.castellatedMeshControls.refinementSurfaces"
        Not all entries in refinementSurfaces dictionary were used. The following entries were not used : 1(roof)
    Read refinement surfaces in = 0 s
    
    Reading refinement shells.
    Read refinement shells in = 0 s
    
    Setting refinement level of surface to be consistent with shells.
    Checked shell refinement in = 0 s
    
    Reading features.
    Read features in = 0 s
    
    
    Determining initial surface intersections
    -----------------------------------------
    
    Edge intersection testing:
        Number of edges             : 406712
        Number of edges to retest   : 0
        Number of intersected edges : 0
    Edge intersection testing:
        Number of edges             : 406712
        Number of edges to retest   : 406712
        Number of intersected edges : 0
    Calculated surface intersections in = 0.28 s
    
    Initial mesh : cells:101504  faces:406712  points:204402
    Cells per refinement level:
        0	101504
    
    Adding patches for surface regions
    ----------------------------------
    
    Patch Type                Region                        
    ----- ----                ------                        
    Added patches in = 0 s
    
    Edge intersection testing:
        Number of edges             : 406712
        Number of edges to retest   : 0
        Number of intersected edges : 0
    Selecting decompositionMethod none [1]
    Layer thickness specified as first layer and expansion ratio.
    
    Shrinking and layer addition phase
    ----------------------------------
    
    Using mesh parameters 
    {
        maxNonOrtho     65;
        maxBoundarySkewness 20;
        maxInternalSkewness 4;
        maxConcave      80;
        minVol          1e-13;
        minTetQuality   1e-15;
        minArea         -1;
        minTwist        0.02;
        minDeterminant  0.001;
        minFaceWeight   0.02;
        minVolRatio     0.01;
        minTriangleTwist -1;
        nSmoothScale    4;
        errorReduction  0.75;
    }
    
    
    
    Merging all faces of a cell
    ---------------------------
        - which are on the same patch
        - which make an angle < 120 degrees (cos:-0.5)
        - as long as the resulting face doesn't become concave by more than 90 degrees
          (0=straight, 180=fully concave)
    
    Merging 0 sets of faces.
    
    No faces merged ...
    
    Merging all points on surface that
    - are used by only two boundary faces and
    - make an angle with a cosine of more than -0.5.
    
    No straight edges simplified and no points removed ...
    
    Checking mesh manifoldness ...
    
    Checking initial mesh ...
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
    Duplicating 0 points on faceZones of type boundary
    
    Handling points with inconsistent layer specification ...
    dupNonManifoldPoints : Found : 0 non-manifold points (out of 204402)
    
    Adding in total 0 inter-processor patches to handle extrusion of non-manifold processor boundaries.
    
    Handling points with inconsistent layer specification ...
    
    Handling non-manifold points ...
    
    Checking patch manifoldness ...
    Outside of local patch is multiply connected across edges or points at 0 points.
    Set displacement to zero for all 0 non-manifold points
    
    Handling feature edges (angle < 120) ...
    Set displacement to zero for points on 0 feature edges
    
    Handling cells with warped patch faces ...
    Set displacement to zero on 0 warped faces since layer would be > 0.5 of the size of the bounding box.
    
    patch faces    layers avg thickness[m]
                         near-wall overall
    ----- -----    ------ --------- -------
    down 488      10     0.03      0.547   
    
    Selecting externalDisplacementMeshMover displacementMedialAxis
    displacementMedialAxis : Calculating distance to Medial Axis ...
    --> FOAM IOWarning :
        Found [v1712] 'minMedianAxisAngle' entry instead of 'minMedialAxisAngle' in dictionary "/home/saumuel/OpenFOAM/saumuel-v1912/run/flatSnowDrift/blockMesh0copy/system/snappyHexMeshDict.addLayersControls" 
    
        This keyword is deemed to be 24 months old.
    
    fieldSmoother : Smoothing normals ...
        Iteration 0   residual 1.06709e-17
    displacementMedialAxis : Inserting points on patch frontAndBack if angle to nearest layer patch > 30 degrees.
    displacementMedialAxis : Inserting points on patch inlet if angle to nearest layer patch > 30 degrees.
    displacementMedialAxis : Inserting points on patch outlet if angle to nearest layer patch > 30 degrees.
    displacementMedialAxis : Inserting points on patch up if angle to nearest layer patch > 30 degrees.
    fieldSmoother : Smoothing normals in interior ...
        Iteration 0   residual 1.55283e-17
    
    Layer addition iteration 0
    --------------------------
    
    Determining displacement for added points according to pointNormal ...
    Detected 0 points with point normal pointing through faces.
    Reset displacement at 0 points to average of surrounding points.
    
    displacementMedialAxis : Smoothing using Medial Axis ...
    displacementMedialAxis : Reducing layer thickness at 0 nodes where thickness to medial axis distance is large 
    displacementMedialAxis : Removing isolated regions ...
    - if partially extruded faces make angle < 60
    - if exclusively surrounded by non-extruded faces
    displacementMedialAxis : Number of isolated points extrusion stopped : 0
    fieldSmoother : Smoothing field ...
        Iteration 0   residual 1.24872e-17
    displacementMedialAxis : Moving mesh ...
    displacementMedialAxis : Iteration 0
    Moving mesh using displacement scaling : min:1  max:1
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    displacementMedialAxis : Successfully moved mesh
    displacementMedialAxis : Finished moving mesh ...
    truncateDisplacement : Unextruded 0 faces due to non-consecutive vertices being extruded.
    truncateDisplacement : Unextruded 0 faces due to stringed edges with inconsistent extrusion.
    
    Setting up information for layer truncation ...
    Detected 0 baffles across faceZones of type internal
    
    
    Checking mesh with layer ...
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
    Extruding 488 out of 488 faces (100%). Removed extrusion at 0 faces.
    Added 4880 out of 4880 cells (100%).
    Edge intersection testing:
        Number of edges             : 426242
        Number of edges to retest   : 0
        Number of intersected edges : 0
    
    patch faces    layers   overall thickness
                           [m]       [%]
    ----- -----    ------   ---       ---
    down 488      10       0.547     100     
    
    Writing 4880 added cells to cellSet addedCells
    Writing 4392 faces inside added layer to faceSet layerFaces
    
    Writing fields with layer information:
        nSurfaceLayers    : actual number of layers
        thickness         : overall layer thickness
        thicknessFraction : overall layer thickness (fraction of desired thickness)
    
    Layer mesh : cells:106384  faces:426242  points:214182
    Cells per refinement level:
        0	106384
    Writing mesh to time 0.01
    Wrote mesh in = 2.52 s.
    Layers added in = 2.52 s.
    Checking final mesh ...
    Checking faces in error :
        non-orthogonality > 65  degrees                        : 0
        faces with face pyramid volume < 1e-13                 : 0
        faces with face-decomposition tet quality < 1e-15      : 0
        faces with concavity > 80  degrees                     : 0
        faces with skewness > 4   (internal) or 20  (boundary) : 0
        faces with interpolation weights (0..1)  < 0.02        : 0
        faces with volume ratio of neighbour cells < 0.01      : 0
        faces with face twist < 0.02                           : 0
        faces on cells with determinant < 0.001                : 0
    Finished meshing without any errors
    Finished meshing in = 3.49 s.
    End
    
    

  • 管理员

    用meld或者diff对比一下log差异嘛,论坛里这个不好看



  • 用diff比较了差异,选取了主要的差异出来。<是blockMesh的,>是gmsh的。
    Gmsh的背景网格比BlockMesh的还要多,但是shm用时却少了很多。如果需要的话。我可以严格控制两套网格基本一致,提供给大家用于shm试验

    44c35
    <     Number of edges             : 246036
    ---
    >     Number of edges             : 406712
    48,49c39,40
    <     Number of edges             : 246036
    <     Number of edges to retest   : 246036
    ---
    >     Number of edges             : 406712
    >     Number of edges to retest   : 406712
    51c42
    < Calculated surface intersections in = 0.16 s
    ---
    > Calculated surface intersections in = 0.28 s
    53c44
    < Initial mesh : cells:61380  faces:246036  points:123794
    ---
    > Initial mesh : cells:101504  faces:406712  points:204402
    55c46
    <     0 61380
    ---
    >     0 101504
    65c56
    <     Number of edges             : 246036
    ---
    >     Number of edges             : 406712
    128c119
    < dupNonManifoldPoints : Found : 0 non-manifold points (out of 123794)
    ---
    > dupNonManifoldPoints : Found : 0 non-manifold points (out of 204402)
    149c140
    < down 330      10     0.0298    0.544
    ---
    > down 488      10     0.03      0.547
    216,217c207,208
    < Extruding 330 out of 330 faces (100%). Removed extrusion at 0 faces.
    < Added 3300 out of 3300 cells (100%).
    ---
    > Extruding 488 out of 488 faces (100%). Removed extrusion at 0 faces.
    > Added 4880 out of 4880 cells (100%).
    219c210
    <     Number of edges             : 259246
    ---
    >     Number of edges             : 426242
    226c217
    < down 330      10       0.544     100
    ---
    > down 488      10       0.547     100
    228,229c219,220
    < Writing 3300 added cells to cellSet addedCells
    < Writing 2970 faces inside added layer to faceSet layerFaces
    ---
    > Writing 4880 added cells to cellSet addedCells
    > Writing 4392 faces inside added layer to faceSet layerFaces
    236c227
    < Layer mesh : cells:64680  faces:259246  points:130414
    ---
    > Layer mesh : cells:106384  faces:426242  points:214182
    238,241c229,232
    <     0 64680
    < Writing mesh to time constant
    < Wrote mesh in = 30.25 s.
    < Layers added in = 30.25 s.
    ---
    >     0 106384
    > Writing mesh to time 0.01
    > Wrote mesh in = 2.52 s.
    > Layers added in = 2.52 s.
    254c245,246
    < Finished meshing in = 30.82 s.
    \ 文件尾没有换行符
    ---
    > Finished meshing in = 3.49 s.
    > End
    \ 文件尾没有换行符
    

  • 管理员

    最后网格做完了之后数量查的多么

    你两个终端同时跑就应该能感觉出来那个步骤卡的慢了 我看你blockMesh的edge大约是gmsh的2倍



  • @李东岳 我后来比较严格控制了gmsh和blockMesh的网格数量,膨胀率一样,生成的网格几乎一样了,11万的网格总量,差了3千个网格左右。gmsh的网格shm用时3s左右,blockMesh的网格shm用啥110s。差的也太多了,完全想不通为什么。。


  • 管理员

    @Samuel-Tu 不涉密可以把算例发上来玩玩



  • 想请教一下gmsh画背景网格是有什么优势吗@Samuel-Tu



  • @李东岳 我想发,但是有20MB,发不上来了。。分卷压缩上传提示格式后缀不对。。我留个百度网盘的连接吧



  • @cresendo gmsh建模还是比较方便的。当时觉得blockMesh要找各个点,面的序号很麻烦。



  • @李东岳 链接:
    https://pan.baidu.com/s/13TAxxBcLouq7SGAj5kdtOw
    提取码:zkmi
    解压缩后有两个文件夹,一个叫gmsh,一个叫blockMesh,constant里面的网格是用两种方法分别生成好的背景网格,只需运行snappyHexMesh即可。snappyHexMesh里面只打开了addlayers,是给down边界加一个十层的边界层。gmsh和blockMesh的shm文件完全一样。checkMesh应该可以发现gmsh和blockMesh网格计算域,网格数量,最小最大尺寸是差不多的。
    但是根据我的shm处理时间,gmsh的只用了3秒,而blockMesh的用了110秒。。差距很大



  • @李东岳 有一个很大的发现,blockMesh的时候我设置了empty边界。然后shm的时候 "correcting 2-D motion"这个信息运算了很久。然后我把blockMesh里面的empty边界改成了patch,瞬间治愈!!!!!!!!!!现在blockMesh的shm时间也是3秒了。。。
    原来用gmsh的时候是没法定义empty的,默认是patch边界!所以gmsh的shm信息里没有"correcting 2-D motion"这个信息,也没有相应的计算。
    现在看来shm似乎面对2D网格(尽管是伪三维网格,厚度方向只有一层网格)的时候出现了一些问题。因此我建议shm的时候先不要设置empty,画完网格后再改边界类型。


  • 管理员

    感谢分享 恭喜你debug成功 :146:



  • 紧接着,由于gmsh网格转换时是没有empty边界的,我又把gmsh网格里改成empty。果然shm的时候耗时110秒。因此我的结论是:
    SHM疑似在发现使用了二维网格后,会做一个额外的计算,这个额外的计算消耗了大量的时间。
    另外我觉得这个额外计算是不必要的,因为本来二维网格就是厚度方向只有一层,不用细分的。。。



  • @Samuel-Tu 受教了,有空尝试一下:146:



  • @Samuel-Tu :
    谢谢分享。。。 再讨教下:
    portable的win版gmsh,怎么用python调用?。。。要编辑系统变量吗? 谢谢



  • @leilei 没用过python调用gmsh



  • @Samuel-Tu: 好, 但仍谢谢Tu兄的回复,Tu兄,辛苦了


Log in to reply
 


CFD中文网 | 东岳流体学术 | 东岳流体商业 | 吉ICP备20003622号-1