TRACE User Guide  TRACE Version 9.8.1
On-the-fly partitioning and non-conformal meshes

The TRACE DG solver supports non-conformal meshes with 2-1 and 4-1 element connections based on the mortar method [29]. Using this kind of mesh requires some pre-processing to find the element connections since they are not directly stored in the CGNS file. The following process can also be used with conformal meshes to gain the ability to partition on-the-fly.

Precondition
CGNS must contain a single unstructured block (in this example called Domain1).
Note
For general 3D meshes, the solution polynomial order \(p\) needs to be at least twice the geometry polynomial order \(q\) ( \(p \geq 2q\)) for guaranteed free stream preservation [30].
Warning
This is still a prototype. Processes are subject to change without prior notice.

Required tools

  • HOPR by Uni Stuttgart (https://hopr.readthedocs.io/en/latest/) with functionality to map CGNS element order to new element order (DLR Gitlab)
  • pyTraceCGNS for command line tools in process below (DLR Gitlab)
  • pythoncgio required dependency of pyTraceCGNS (DLR Gitlab)
  • pytip required dependency of pyTraceCGNS (DLR Gitlab)
Note
The process described below is automated with srsturbo (DLR Gitlab) for linear cascade configurations. See corresponding documentation.

Process

  • Start with a mesh exported from a mesh generation tool of your choice containing CGNS native high-order elements (HEXA_20 or HEXA_27).
  • Make sure, the file is ADF (required for pythoncgio, GMC):
    hdf2adf ho_mesh.cgns
  • Use GMC to perform any geometric modifications on the high-order mesh.
  • Convert the high-order mesh from CGNS native high-order elements to TRACE GridCoefficients format:
    convertCGNSHighOrderToTRACE ho_mesh.cgns TRACE.cgns
  • Set up the case in GMC with periodic connections. This will be the file used to start TRACE.
  • Use GMC to create a second CGNS file TRACE.nonPeriodic.cgns with the periodic connections deleted via Block->Delete connectivity (gmcPlay command delete_connectivity_blocks).
  • Create a HOPR input file parameter.ini listing all the boundary panels and the corresponding periodic panels with the respective translation vector. An example for a configuration with inlet and outlet panels called Inlet and Outlet as well as y-periodic panels p1 and p2 and z-periodic panels p3 and p4:
    !=============================================================================== !
    ! OUTPUT
    !=============================================================================== !
    projectname = TRACE ! name of the project (used for filenames)
    Debugvisu = T ! Write debug mesh to tecplot file
    outputFormat = 0
    DebugvisuLevel=2 ! Level 0: visualization of linear mesh and BC (default),
    ! Level 1: + curved surface visualization (_SplineSurf.*), if useCurveds
    ! Level 2: + curved volume visualization (_SplineVol.*), if useCurveds
    !=============================================================================== !
    ! MESH
    !=============================================================================== !
    Mode = 3 ! 1 Cartesian 3 CGNS 4 STAR-CD V3
    nZones = 1 ! number of zones
    filename = TRACE.nonPeriodic.cgns ! name of mesh file
    meshscale = 1 ! scales all input meshes by a factor
    spacequandt = 1. ! tolerance for mesh connectivity (multiplied with real tolerance (1e-12), use 1e4 for global tolerance 1e-8 in GMC)
    !=============================================================================== !
    ! CURVED
    !=============================================================================== !
    useCurveds = F ! T to generate curved boundaries
    curvingMethod = 1
    normalsType = 1
    checkElemJacobians= T ! checks the Jacobian and scaled Jacobian for each element
    !=============================================================================== !
    ! BOUNDARY CONDITIONS
    !=============================================================================== !
    BoundaryName = p1
    BoundaryType = (/1,0,0,1/)
    BoundaryName = p2
    BoundaryType = (/1,0,0,-1/)
    vv = (/0,1,0/)
    BoundaryName = p3
    BoundaryType = (/1,0,0,2/)
    BoundaryName = p4
    BoundaryType = (/1,0,0,-2/)
    vv = (/0,0,1/)
    BoundaryName = Inlet
    BoundaryType = (/2,0,0,0/)
    BoundaryName = Outlet
    BoundaryType = (/2,0,0,0/)
    Note
    Boundary condition settings here are only used for mesh connectivity. All boundary condition setup for flow solver remains in CGNS file.
  • Run HOPR with
    hopr parameter.ini
  • Create the directory for the HOPR output file corresponding to the CGNS file and block:
    mkdir -p TRACE/Domain1
    mv TRACE_mesh.h5 TRACE/Domain1/Mesh.h5
  • Extract grid coefficients from CGNS file:
    createSFCSolutionFiles TRACE.cgns
    This will create a TRACE/Domain1/GridCoefficients.h5.
  • Optional: interpolate vertex-based FV or DG solution for restart:
    interpolateFlowSolution -src /path/to/TRACE.cgns -p <polynomial order> -n Legendre-Gauss-Lobatto --copy_timestep --copy_time -dst TRACE.cgns
    This will create a TRACE/Domain1/FlowSolution.h5. If the source solution only contains primitive variables, conservative variables for restart can be computed via:
    addConservativeVariablesToHDF5 TRACE.cgns
  • Add appropriate element weights for mortars and expensive boundaries such as STG via:
    modifySFCElementWeights --mortar <mortar weight> --boundary <panel name>=<boundary weight> TRACE/Domain1/Mesh.h5
  • Delete solutions from TRACE.cgns via GMC or gmcPlay to have a small output CGNS file.
  • Check if the desired number of processes lead to a valid partition using PREP:
    PREP -cgns TRACE.cgns -clb -np <number of processes> -sfc
  • Run TRACE with the -otf flag.
    mpirun -np <number of processes> TRACE -cgns TRACE.cgns [-cntl TRACE_control.input] -otf
    Note
    The partition algorithm will determine an optimal number of partitions lower or equal to the specified number of processes. TRACE will try to redistribute load to empty processes if that is the case. If this redistribution fails, a uniform partition not considering the weights will be used and a warning will be issued. This will lead to degraded parallel efficiency. So please double check screen output and PID. Valid partitions can be tested a priori with PREP using the command given above.
  • Output will be CGNS files without solutions and HDF5 files containing the flow solution next to the output CGNS file in
    ../output/cgns/TRACE/Domain1/FlowSolution.h5
    The solutions can be added to CGNS for further processing:
    addFlowSolutionFromHDF5 --meshCgnsFile TRACE.cgns ../output/cgns/TRACE.cgns

Files

The following example gives an overview of the files involved in a case with a single block called Domain1 where the main CGNS file is TRACE.cgns.

Directory File Description
input ho_mesh.cgns Standard CGNS file containing only the native high-order mesh.
TRACE.cgns Standard CGNS file containing only the linear mesh and solver settings, all solutions removed.
TRACE.nonPeriodic.cgns Derived from TRACE.cgns by deleting connectivity. Used only as input for HOPR.
parameter.ini Input file for HOPR.
input/TRACE/Domain1 Mesh.h5 Mesh output file generated with HOPR containing linear mesh and connectivity with elements ordered along space-filling curve (SFC).
GridCoefficients.h5 Solution file corresponding to GridCoefficients flow solution in TRACE.cgns ordered along SFC, generated with createSFCSolutionFiles.
FlowSolution.h5 Solution file corresponding to FlowSolution flow solution in TRACE.cgns ordered along SFC, generated either with createSFCSolutionFiles if it was already in the CGNS file or with interpolateFlowSolution applied to a CGNS already configured for on-the-fly partitioning.
output/cgns TRACE.cgns Standard CGNS file containing only the linear mesh and solver settings, all solutions removed.
TRACE.statistics.cgns Standard CGNS file containing only the linear mesh, solver settings and statistics meta data, all solutions removed.
output/cgns/TRACE/Domain1 FlowSolution.h5 Solution file corresponding to FlowSolution flow solution in TRACE.cgns ordered along SFC. Can be added to CGNS using addFlowSolutionFromHDF5.
output/cgns/TRACE.statistics/Domain1 FlowSolution.h5 Solution file corresponding to FlowSolution flow solution in TRACE.statistics.cgns ordered along SFC. Can be added to CGNS using addFlowSolutionFromHDF5.