Dealing with Non-Flat Faces in OpenFOAM

Dealing with Non-Flat Faces in OpenFOAM

Non-flatness in mesh faces can cause issues in OpenFOAM simulations, particularly with finite volume discretization. Here are several approaches to handle non-flat faces:

Prevention During Meshing

  1. Use quality meshing tools:

    • snappyHexMesh: Set proper feature capturing and mesh quality controls
    • cfMesh: Has good handling of complex geometries
    • ANSA, HyperMesh, or other CAD-based meshers with OpenFOAM export
  2. Mesh quality parameters:

    // In snappyHexMeshDict or other mesher dictionaries
    maxNonOrtho 65;  // Maximum non-orthogonality
    maxConcave 80;   // Maximum concavity
    minFlatness 0.5; // Minimum face flatness (0-1)
    

Post-Meshing Solutions

  1. Check mesh quality:

    checkMesh -allGeometry -allTopology
    

    Pay attention to “Face flatness” and “Face concavity” warnings.

  2. Face splitting:

    • Use splitMesh or splitMeshRegions to divide problematic faces
    • Or implement face splitting in your meshing process
  3. Mesh smoothing:

    foamyHexMesh -parallel
    # or
    surfaceRefineRedGreen
    
  4. Manual correction:

    • Use autoPatch to identify problematic faces
    • Edit the mesh with topoSet and refineMesh

Simulation-Time Solutions

  1. Numerical schemes:

    // In system/fvSchemes
    divSchemes
    {
        default         Gauss linear;
        // More robust schemes for bad meshes
        div(phi,U)      Gauss limitedLinear 1;
    }
    
  2. Relaxation factors:

    // In system/fvSolution
    relaxationFactors
    {
        fields
        {
            p           0.3;
        }
        equations
        {
            U           0.7;
        }
    }
    
  3. Non-orthogonal correctors:

    // In system/fvSolution
    PIMPLE
    {
        nNonOrthogonalCorrectors 2;
    }
    

Advanced Techniques

  1. Polyhedral meshing:

    • Polyhedral cells can better handle non-flat faces
    • Use polyDualMesh to convert to polyhedral mesh
  2. MPPIC or Lagrangian methods:

    • For multiphase flows, these may be more robust
  3. Custom boundary conditions:

    • Implement special BCs that account for face non-flatness

Remember that prevention through quality meshing is always better than fixing issues later. Always check your mesh quality before proceeding with simulations.


资料

OpenFOAM源码位置

src/mesh/snappyHexMesh/refinement*
src/meshCheck/*

你可能感兴趣的:(CFD/OpenFOAM,算法)