Usability: Creating a Template Simulation File

Template simulation files allow you to define a set of physics models and conditions once, and then apply those settings to multiple geometries.

By using dynamic queries in the meshing pipeline, and for region and boundary assignment, you can create a template file that requires little effort to apply in subsequent simulations.

In this tutorial you take a prototype simulation file and export it to a template simulation file. The prototype simulation is for a cold-flow analysis of pipework. You import the solid geometries of the pipework—Simcenter STAR-CCM+ extracts the wetted volume. Although the sample geometry contains only a single pipe section, the resulting template file is suitable for pipework with multiple sections.

A key factor in designing the template is to use mesh operations that can function based on dynamic queries.



This tutorial and the one that follows it only consider the internal volume. The template simulation file is for an internal cold flow simulation only. Therefore there are no interfaces required between the fluid and solid. Also, since a single internal volume is extracted, there are no fluid-fluid interfaces between pipes at the regions level.

The starting file already has the following:

  • An initial sample part
  • The meshing pipeline defined. The steps in the pipeline are:
    1. Fill Holes
    2. Imprint
    3. Extract Volume
    4. Automated Mesh

    The Fill Holes operation is necessary for closing the ends of the open pipes before applying the Extract Volume operation. The Imprint operation ensures that part contacts are defined for all touching surfaces.

  • A region and its boundaries defined
  • Physics models selected. The models are typical for an internal cold-flow analysis, and include the Realizable K-Epsilon Two-Layer turbulence model.
  • Several scenes
  1. Launch Simcenter STAR-CCM+ and load QueryTutorial_StartingFile.sim from the foundationTutorials folder of the downloaded tutorial files.
  2. Save the simulation as QueryTutorial_TemplateFile.sim. The name reflects the fact that you export this simulation to a template file after you finish the initial setup.
Convert the meshing pipeline to use dynamic queries for selecting the input parts to which each operation applies:
  1. Create two tags for identifying the upstream and downstream faces of the pipework.
    Tags allow you to identify almost any object within a simulation. Here, you create tags that are then applied to faces within geometry parts.
    1. Right-click the Automation > Tags node and select New.
    2. Rename the Tags > Tag node, Inlet End.
    3. Create a second tag and rename it, Outlet End.


  2. Apply the tags to the corresponding upstream and downstream faces of the sample part:
    1. Expand the Geometry > Parts > pipe_section > Surfaces node.
    2. Right-click the flange_0 node and select Tags > Set > Inlet End.
    3. Select the flange_1 node and apply a tag using another method. In the Tags property, select Outlet End from the drop-down list.
  3. To identify the end surfaces that guide the Fill Holes operation, use these same tags in a dynamic query:
    1. Select the Geometry > Operations > Fill Holes node.
    2. In the right half of the End Surfaces property, click the query editor button ().
    3. Activate the drop-down list and select OR.
    4. To add the first predicate, click (Add a new item). Use the controls to set Tag contains Inlet End and click (Commit changes).
    5. Add a second predicate and set it to Tag contains Outlet End.
      Simcenter STAR-CCM+ provides a preview of the objects that are selected by these predicates. As you already applied the Inlet End and Outlet End tags, you can see that the flange_0 and flange_1 parts are selected.

    6. Click OK.
  4. Also for the Fill Holes operation, set the Input Parts property to select any input part that contains "pipe" in its name:
    1. In the right half of the Input Parts property, click the query editor button ().
    2. Add a predicate, Name contains pipe.
    3. Click OK.
For the Imprint and Extract Volume operations, you create a filter that identifies the surfaces that surround the wetted volume. This filter assumes that all internal surfaces of any imported pipework have the text "pipe" within their names.
  1. To create the filter for internal wetted surfaces:
    1. Right-click the Automation > Filters node and select New.
    2. In the Filter window, from the drop-down list, select Name.
    3. In the middle drop-down list, leave the setting at its default, contains.
    4. In the text box to the right of the second drop-down list, enter Fill Holes.
    5. To finish the first entry, or predicate, click (Commit changes).
    6. To begin the second predicate, click (Add a new item).
    7. Set this predicate to Name contains pipe.
    8. Click the AND operator in the upper left corner of the view. In the drop-down list that appears, change it to OR.


      The first filter is now complete.
    9. Close the Filter window.
    10. Rename the Filters > Filter node Wetted Surfaces Filter.
  2. Now move on to the Imprint operation. Here, you want to choose all parts that participate in the meshing pipeline, including the result of the Fill Holes operation.
    In this example, the Merge/Imprint Method is set to Discrete Imprint Curves, which is the most suitable method for this case.
    1. Select the Operations > Imprint node.
    2. For the Input Parts property, click the query editor button ().
    3. Set the predicate to Filter matches Wetted Surfaces Filter. Click (Commit changes).


    4. Click OK.
  3. Select the Operations > Extract Volume node, and repeat the previous steps.
The Automated Mesh operation keeps its original settings since it references the Extract Volume operation. You are ready to build the mesh.
  1. Right-click the Operations node and select Execute All.

You now convert the input parts properties for boundaries so that they use dynamic queries for assigning part surfaces.

In order to identify correctly the inlet and outlet surfaces for their respective boundary conditions, you must manually apply tags to the correct surfaces within the Extract Volume part. This part is the result of the Extract Volume operation. When you apply your template to a new geometry, you also repeat this manual step after running the mesh pipeline.

  1. Identify the inlet and outlet faces at the geometry level:
    1. Expand the Geometry > Parts > Extract Volume > Inherited Parts > Fill Holes node.
    2. Right-click the pipe_section.flange_0 node and select Tags > Set > Inlet End.
    3. Right-click the pipe_section.flange_1 node and select Tags > Set > Outlet End.
  2. Set the fluid inlet and outlet boundaries to use dynamic queries based on the same tags:
    1. Select the Regions > Fluid > Boundaries > Inlet node.
    2. In the right half of the Part Surfaces property, click the query editor button ().
    3. Set the predicate to Tag contains Inlet End.
    4. Select the Outlet node and, using the same technique, set the predicate of its dynamic query to Tag contains Outlet End.
For the wetted wall boundary, you select all surfaces that are not already applied to other boundaries. To achieve this goal, you make use of the selection priority property for boundaries.
  1. To select the remaining surfaces and apply selection priority:
    1. Select the Wetted Wall node.
    2. In the right half of the Part Surfaces property, click the query editor button ().
    3. Set the predicate to Relationship below in tree [Parts >] Extract Volume.


    4. Click OK.
      At this point, you can observe that all part surfaces are assigned to Wetted Wall. That is, Inlet and Outlet no longer have any surfaces assigned. The following steps rectify this assignment.
    5. Select the Boundaries node.
    6. In the Part Surface Selection Priority property, click (Custom Editor).
    7. In the Boundaries - Part Surface Selection Priority dialog, change the ordering so that Simcenter STAR-CCM+ applies part surfaces to the Wetted Wall boundary last:
      1. Select Wetted Wall (Dynamic) in the list.
      2. Click (Move to Bottom) in the right side of the dialog to move that boundary to the bottom of the list.
        Before:

        After:

      3. Click OK.
  2. Finally, remove the sample part and its mesh, and export the final template file:
    1. Right-click the Geometry > Parts > pipe_section node and select Delete. Accept the prompt and continue.
    2. Select Mesh > Clear Generated Meshes.
    3. Select File > Save to Template. Save the template file as QueryTutorial_TemplateFile.simt.
    4. Close the simulation. You need not save it since your changes during this exercise are saved in the template file.