# Refinements

This document provides an overview of mesh refinement capabilities in Flow360. Refinements enable precise control over mesh resolution in specific regions of your geometry to better capture flow features or geometric details.

# 📋 Available Refinement Types

Type Description Applicable To
Surface Edge Refinement Controls mesh resolution near edges Edges
Surface Refinement Controls surface mesh cell size Surfaces
Boundary Layer Refinement Creates prismatic layers near walls Surfaces
Passive Spacing Controls mesh behavior without direct refinement Surfaces
Uniform Refinement Creates uniform mesh spacing in a region Boxes and cylinders
Axisymmetric Refinement Creates structured-like mesh with cylindrical bias Cylinders

# 🔍 General Guidelines

# Refinement Selection

  1. Surface Features

    • Use Surface Edge Refinement for leading/trailing edges
    • Apply Surface Refinement for general surface resolution
    • Implement Boundary Layer Refinement for wall regions
  2. Off-Body Features

    • Use Uniform Refinement for wakes and shocks
    • Apply Axisymmetric Refinement for rotating machinery
    • Consider Passive Spacing for interface regions

# Best Practices

  • Start with coarser refinements and gradually increase resolution where needed
  • Ensure smooth transitions between regions of different refinement levels
  • Consider geometric scale when setting refinement parameters
  • Balance resolution requirements with computational cost
  • Account for flow regime and Reynolds number effects

# Common Applications

  1. Aerodynamic Simulations

    • Surface Edge Refinement for leading edges
    • Boundary Layer Refinement for wall regions
    • Uniform Refinement for wake regions
  2. Rotating Machinery

    • Axisymmetric Refinement for rotor/propeller regions
    • Boundary Layer Refinement for blade surfaces
    • Uniform Refinement for tip vortex regions
  3. Complex Geometries

    • Surface Refinement for general resolution
    • Passive Spacing for interface regions
    • Uniform Refinement for critical flow features

💡 Tips

  • Review detailed documentation for each refinement type
  • Consider flow physics when selecting refinement types
  • Use appropriate units for all parameters
  • Ensure compatibility between different refinements
  • Monitor mesh quality metrics

❓ Frequently Asked Questions

  • How do I choose between different refinement types?

    Consider the geometric features and flow phenomena you need to resolve, then select the most appropriate refinement type(s).

  • What happens if refinements overlap?

    The finest (smallest) spacing will be used in overlapping regions.

  • How do I ensure mesh quality?

    Monitor aspect ratios, skewness, and other quality metrics while adjusting refinement parameters.


🐍 Python Example Usage

from flow360 import (
    MeshingParams,
    SurfaceEdgeRefinement,
    SurfaceRefinement,
    BoundaryLayer,
    PassiveSpacing,
    UniformRefinement,
    AxisymmetricRefinement,
    u
)

# Example of combining multiple refinements
meshing=MeshingParams(
    refinements=[
        # Surface edge refinement for leading edge
        SurfaceEdgeRefinement(
            name="leading_edge",
            edges=[leading_edge],
            method=HeightBasedRefinement(value=0.001 * u.m)
        ),
        # Surface refinement for general resolution
        SurfaceRefinement(
            name="wing_surface",
            faces=[wing_surface],
            max_edge_length=0.05 * u.m
        ),
        # Boundary layer refinement for wall regions
        BoundaryLayer(
            name="wing_bl",
            faces=[wing_surface],
            first_layer_thickness=1e-5 * u.m,
            growth_rate=1.2
        ),
        # Passive spacing refinement for interface region
        PassiveSpacing(
            name="interface_region",
            refinement_type="projected",
            faces=[interface_surface]
        ),
        # Wake region refinement
        UniformRefinement(
            name="wake_region",
            entities=[wake_box],
            spacing=0.1 * u.m
        ),
        # Axisymmetric refinement for propeller region
        AxisymmetricRefinement(
            name="propeller_region",
            entities=[prop_cylinder],
            spacing_axial=0.02 * u.m,
            spacing_radial=0.01 * u.m,
            spacing_circumferential=0.015 * u.m
        )
    ]
)