Creating a User-Defined Adaptive Mesh Criterion

After selecting the Adaptive Mesh model in the physics continuum, you define a field function that returns an adaption criterion based on the gradient of the Mach number.

You create the field function to be used as the adaption criterion function.
  1. To create the field function:
    1. Right-click the Automation > Field Functions node and select New > Scalar.
    2. Select the User Field Function 1 node and rename it to RefineCriterionMachNumber.
    3. Select the RefineCriterionMachNumber node and set the properties as follows:
      Property Setting
      Function Name RefineCriterionMachNumber
      Dimensions Dimensionless
      Definition mag(grad(${MachNumber}))*(${AdaptionCellSize})

      The quantity ${AdaptionCellSize} returns the current cell size during the AMR procedure. Here it is used to scale the magnitude of the Mach number gradient. See also: Adaption Cell Size.

      In practice, you would plot this criterion after a trial simulation and decide on suitable ranges for when cells can be refined. Identify the magnitude of gradients in those areas where you expect adaption to make most impact.

To set up the Adaptive Mesh model and add an adaptive mesh criterion:
  1. Select the Continua > Physics 1 > Models > Adaptive Mesh node and set the properties as follows:
    Node Property Setting
    Adaptive Mesh Prism Cell Refinement None
    Transition Width 1
    Limit Cell Size

    By activating this option, the proposed child cell size is checked against the Min Adaption Cell Size below during the mesh refinement. If the predicted child cell size falls below the limit, the refinement is not executed for the parent cells.

    Min Adaption Cell Size 0.01m
  2. Right-click the Adaptive Mesh > Adaptive Mesh Criteria node and select New > User-Defined Mesh Adaption.
  3. Select the Adaptive Mesh > Adaptive Mesh Criteria > User-Defined Mesh Adaption 1 node and set Max Refinement Level to 1.
    For an industrial simulations a maximum refinement level of 2 or 3 would be more realistic. Here, however, in order to reduce the computation time required for the tutorial case, only one level of refinement is applied.
    NoteThe Refine in solution init option is deactivated here, which means that no mesh adaption is carried out during the solution initialization process. Usually you activate this option only when starting from a well-converged initial solution. For example, you might start a transient simulation from a converged steady flow solution.
  4. Select the User-Defined Mesh Adaption 1 > Adaption Request node and set the properties as follows:
    Node Property Setting
    Adaption Request Method Adaption Criterion Function
    Scalar Function RefineCriterionMachNumber
    Range [0.5,1.0]

    Note that for an industrial simulation the lower limit here could be increased to avoid refining cells far beyond the shock wave.

    Above Max Refine
    Between Keep
    Below Min Coarsen

    By applying this adaption criterion, Simcenter STAR-CCM+ refines cells in which the Mach number is changing.

  5. Save the simulation.