Cross-learning: FLUENT / CFX / STAR / COMSOL - Last updated on 24-Feb-2024
This page is intended to enhance the learning one CFD software to another by providing similarities and difference in approach. The purpose it to help user's learn new software when he/she is familiar with one, the purpose is not to rate any particular software.
Fluids: the colour of fluid nodes change from gray to blue to indicate that fuid models have been activated and continuum is valid.
Solids: the colour of node changes from gray to shaded gray to indicate that models have been activated for this continuum.Regions in STAR-CM+ | Parts in STAR-CCM+ |
Computational domains in STAR-CCM+ are called Region where each region is completely surrounded by boundaries. Boundaries common between two regions can be joined with an interface allowing mass, momentum and energy to pass between the regions. | Parts in STAR-CCM+ are geometrical representation of Objects. Parts can be modified in different ways and used as input for meshing operation and the result of this meshing process gets placed in a region specified in advance. One or several parts can be used as input to one region. Contacts can be created for surfaces common between two parts which are transformed into interfaces when the parts are meshed into regions. |
Following table is an attempt to draw some similarities and analogies between various names and concepts used in CFD programs. However, there is no distinct boundaries and there are overlaps the way these designations refer to underlying objects and collectors.
Identifier | STAR-CCM+ | FLUENT | CFX | OpenFOAM / ParaView |
Solvers | Physics Continua | Viscous Model | - | Application |
Parts | Mesh Continua | Zones | Boundary | |
Regions | Continua | Cell Zones, Face Zones | Cell Zones, Face Zones | Blocks |
Domains | Continua | Cell Zones, Face Zones | Cell Zones, Face Zones | Blocks |
Boundaries | Cell Zones, Face Zones | Face Zones, Edge Zones | Boundary | |
Zones | Regions, boundaries | Boundary, Patch | ||
Case | Model | Case | Definition | Folder |
Scenes | Separate for Geometry, Mesh, Scalar, Vector | Common for Scalar and Vectors, Planes | Common for Scalar and Vectors, Planes | Views and Filters: Render View, Slice View... |
The terms used in this table are building blocks of a simulation which consists of physical space (3D volume designated as domain or region), boundaries of a volume (known as surface regions or face zones), solver types (known as viscous model or continua) and so on. A generic term which can be used for all the objects mentioned in above table is 'collector' which is a collection or group of different physical (nodes, faces...) objects and numerical (turbulence model, material properties ...) objects. Few additional terms used to describe the computational volume are walls, interfaces and contacts.
Excerpts from STAR-CCM+ User Manual: Parts-based meshing is a method for generating surface and volume meshes on geometry parts. It is different to region-based meshing in that it uses a series of mesh operations to define the process from the initial geometry to the final volume mesh. Having a series of operations allows you to modify the initial geometry and repeat the entire process with no additional inputs. This makes parts-based meshing particularly suitable for parametric design studies.
Geometry is defined in terms of geometry volume, surfaces, curves and points. The discretized geometry is defined in terms of body points (volumes), faces, edges and nodes / vertices. The collection of these entities are designated as 'parts' in ICEM CFD, zones in "FLUENT", "regions and boundaries" in STAR CCM+ and "Assembly, Primitive 2D, Primitive 3D" in CFX. The computational model to which physics can be applied is defined in terms of regions (domains or zones defined in FLUENT, CFX) and boundaries. Defining the simulation topology is the process of mapping between the geometrical definition of the problem and the computational (or physical) definition.
In STAR CCM+ geometry parts refers to volume which can be assigned to regions, part surfaces can be assigned to boundaries, and part curves can be assigned to objects called feature curves. This mapping is important if all the operations, CAD import till simulation is performed inside STAR CCM+ environment. If mesh is generated out of STAR-CCM+ environment, these operations need to be performed in that application which will also write output file compatible to STAR-CCM+ requirements. For a typical CFD analysis, simple geometries are usually imported in CAD or non-CAD formats (or in more scientific terms, discrete or tessellated formats), while complex geometries usually come in mixed or hybrid formats, containing both CAD and non-CAD parts.
You can import a surface or volume mesh from an external file via File > Import > Import surface mesh. During geometry import, a choice of centimeters (cm), feet (ft), inches (in), kilometers (km), meters (m) (default), miles (mi), millimeters (mm), micrometers (um) and yards (yd) is allowed. The selection determines the scale factor that is applied to the import surface to make it conform to SI (meters). For example, selecting millimeters automatically scales the vertices by 0.001. If a unit other than one listed was used for the surface file, select the meters option (equivalent to no scaling). After the import process is complete, you can apply a user-defined scaling factor to scale the mesh.
If a unit other than meters (m) was selected, then the option to Set preferred units for length is available (off by default). This option can be used to set the selected unit as the default for all mesh reference and input values that involve length. Leaving the option off maintains meters as the default unit for length.
Surface Repair Tool: This is a utility that allows to directly repair the part surface. It is easy to use and will highlight each error. But in case any geometry upstream isbe changed, one need to redo the repair manually, as it is not a pipelined operation. This utility is a good place to start after importing the geometry as it will show how many errors must be fixed and where they are and what type they are.
Find Similar: This features allows user to select a single body or a topology and find similar topologies within the entire assembly. Users can select and define one topology with a single click and then use the find similar feature to select all similar topologies to work with. Prior to adding the search tool, users had to handpick all the entity and right-click select the defeature option to remove the selected entity.
Fill holes is an operation for preparing a geometry for an internal flow simulation by doing what the name suggests: capping and filling holes in the part. This is possible in 3D-CAD and the surface repair tool, but this operation lets you add it to an automated pipeline. Note there is no Apply button. First select the closed loop (manually or double click on one the edge elements) and then click the fill hole button.
Extract volume pulls an internal volume from a part, typically after Fill Holes or similar operation has been used to cap the openings to prepare the geometry for an internal flow simulation.
One of the most useful operations is that to replace a part. This operation makes swapping out a geometry part repeatable and traceable, unlike manually replacing the part by right clicking it in the tree.
Repairing Features: All feature curves that are required to represent the geometry needs to be correctly identified in the surface mesh. This process identifies feature errors - that is, edges that are features but are not represented as such, and edges that are incorrectly represented as features. Feature curves indicate where sharp edges exist and are listed under the Feature Curves node for each region. If the surface remesher operation is performed to improve the surface mesh quality, then including feature curves is necessary to preserve sharp edges and surface detail (such as imprints). If the feature curves are not included, then edges are rounded off and surface detail is lost.
Closing Gaps: Project vertices onto a set of faces to close a gap using "project selected vertices tool".
Duplicate Faces -- surface repair -- Merge/Imprint: The tool also lets you merge two or more overlapping (co-planar) surfaces or sets of faces. When using Merge/Imprint on a single part, the result is either a common shared surface or no surface at all (that is, the common area is removed). If there are multiple parts, the tool creates part contacts for the shared surface. Similarly, for feature curves belonging to the same parts, the tool can imprint two or more edges onto each other, effectively zipping them together. You can also imprint edges onto faces and imprint faces onto edges, depending on the requirement. No edge options are available when imprinting across multiple parts. In all instances, the faces or edges do not need to belong to a closed surface in order to use the tool.
Automatic repair tool can fix certain global surface problems that relate to bad quality, close proximity and/or intersections (pierced faces) at the push of a button. If you want to fill a large number of holes automatically or zip a large number of edges then you should use the hole filler and edge zipper tools respectively.
To capture the complex and intricate features of the geometry the mesh generation process utilizes contact prevention conditions, volumetric controls and the wrapper scale factor. Wrapped surface is then retriangulated using the surface remesher.
There are two meshing approach in STAR: parts-based meshing and region-based meshing. Parts-based meshing approach is recommended, though one need not always follow this approach to generate a mesh. For simple geometry and assemblies consisting of few sub-assemblies, one can import parts, assign parts to regions, then generate mesh at the regions level. However, if while working with assemblies that contain tens or hundreds of parts, parts-based meshing approach is recommended.
There is an option to use Automatic Surface Repair during Surface Remesher operation. This can help repair small errors in the surface, although it is not recommended for multi-volume models. Automatic Surface Repair cannot repair non-manifold edges or vertices or correct free edges.
Excerpts from User Guide: Parts-based meshing detaches the meshing process from physics modeling and provides a flexible and repeatable sequence of mesh operations. The sequence of mesh operations is called the meshing pipeline.
STAR-CCM+ also includes a comprehensive set of surface-repair tools that allow users to interactively enhance the quality of imported or wrapped surfaces, offering the choice of a completely automatic repair, user control, or a combination of both. One of the most important elements of surface repair tool is its diagnostics tool. It offers functionality to identify error prone parts, surfaces and feature edges and provide real time information via the browse tool as you fix them.
Operations – utilities that perform actions on 'Parts', Certain operations such as "extract volume", "surface wrapper" ... create new parts.
Surface wrapping and partial wrapping: In addition to refining the surfaces of parts in the wrap, partial wrapping can be used to exclude selected parts or part surfaces from the wrap operation. Excluded parts from the wrap, the original tessellation of the those parts is passed through to the final wrap surface. Some geometries only require surface wrapping for a portion of their surface. The surface wrapper allows you to exclude part surfaces that you consider sufficiently well tessellated for subsequent mesh operations. In some cases wrapping the whole geometry is unnecessary and can defeature highly detailed part surfaces unless the surface wrapper is excessively refined using custom controls and contact preventions. Select the Geometry > Operations > Surface Wrapper node and activate the "Perform Partial Wrapping".
Per-part meshing feature of "surface wrapping" operation allows multiple disconnected parts to be wrapped separately. The Minimum Size value indicates the triangle size in the space between the two parts, which determines the octree refinement in the area. The value should be set smaller than the gap size (typically one half or one quarter of the distance). It is just a stopping size for the surface wrapper refinement, which results in the two surfaces being separated.
Surface wrapping process steps:
There are two categories of interfaces in STAR-CCM+ and any interfaces that are created during the simulation setup process are accessible via the Interfaces manager node. The Interfaces node has properties and a pop-up menu.
Interface Types determines the behavior of the interface with respect to the modeling of flow and heat transfer. Interfaces can connect individual boundaries (faces) or entire regions (volumes). Following interface types and connectivity are available in STAR-CCM+
Type | Connects to | Topology | Connectivity |
Baffle | Boundaries | Direct Interface | Imprinted |
Porous Baffle | Boundaries | Direct Interface | Imprinted |
Contact | Boundaries | Direct Interface | Imprinted |
Fan | Boundaries | Direct Interface | Imprinted |
Fluid Film | Boundaries | Direct Interface | Imprinted |
Fully Developed | Boundaries | Direct Interface | Imprinted |
Internal | Boundaries | Direct Interface | Imprinted |
Mapped Contact | Boundaries | Indirect Interface | Mapped |
Mixing Plane | Boundaries | Indirect Interface | Connect Average |
Blower | Boundaries | Indirect Interface | Connect Average |
Heat Exchanger | Regions | Heat Exchanger Topology | Modeled |
Overset Mesh | Regions | Overset Mesh Topology | Modeled |
Note that "creating an interface" is not same as "converting boundaries to an interface". While "converting boundaries to an interface" single and usually common boundary belonging to a surface mesh is duplicated and then an interface made between the original and the copy for the primary purpose of defining multiple regions for meshing. To create an interface between boundaries, select the two boundaries that define the interface. The first boundary selected is termed the master boundary and the second is called the slave boundary.
Imprint is a process of making a common boundary between two volumes. If two square blocks are touching each other, there are two faces, one each belong to each square. When imprint is performed, the one of the common surface is deleted. The imprint operation will result into entity known as 'contacts' in STAR, and may become interfaces when parts are transferred to regions. Four types of contact definition exists: In-place, Weak in-place (meshed non-conformally), Periodic, Baffle. Part-part contacts may be created (a) automatically during geometry import, (b)by imprinting, (c)by tolerance based searching and (d)manually. STAR-CCM+ allows to imprint parts non-conformally. This process is useful when:
The compact report for a volume mesh generates statistics for each mesh region having following sub-sections: Entity count, Mesh extents, Mesh validity check, Face validity statistics and Volume change statistics.
The full diagnostics report is structured in a similar way to the compact report and contains all the information the compact report produces with following extra items for each region and the overall summary: Boundary details, Entity count per cell shape, Volume range (the minimum and the maximum volumes of an element in entire domain), Maximum interior skewness angle. The boundary details are split up as Number of faces, Boundary extent, Surface area and Maximum boundary skewness angle. To check if the volume mesh has zero or negative volume cells, either run the mesh diagnostics report or initialize the solution. Cells havin ≥ 0 volumes can be identified and visualized using threshold values.
Face quality is a measure of similarity between a face and the ideal face shape which is an equilateral triangle. The surface diagnostics calculate face quality = "in-circle radius / circumcircle radius" x 2. For an equilaterl triangle, in-circle radius * 2 = circum-circle radius. Thus, face quality '0' is degenerate triangle and 1 is the ideal shape. Default value of poor element setting in STAR-CCM+ is 0.01. The other definition in STAR-CCM+ as used in Surface Remesher is that quality of a triangle = the ratio of the triangle face area to the area of an equilateral triangle that would exactly fit inside the circumcircle of the triangle. The default value for surface remesher is 0.05
Dihedral angle of an edge is the angle between its adjacent faces. Edges are considered invalid if they are free or non-manifold as a dihedral angle cannot be calculated for such edges.
Removing Invalid Cells tool allows to remove mesh cells from the volume mesh region definition based on one or more of the following 4 mesh criteria: Face Validity, Cell Quality, Volume Change and Contiguous Cells. STAR-CCM+ moves all the removed cells into a separate region that is not used in the analysis. Symmetry plane boundaries are automatically added to the neighboring cell faces of cells that have been removed, minimizing the impact of these removed areas on the solution. Cells that do not meet the provided criteria are moved into a new region called Cells deleted from [Region] where [Region] is the name of continuum which these deleted cells belong to.
The polygonal patch filler is a quick and easy way of closing arbitrary shaped holes which do not have a closed loop definition and/or are not planar. The process literally 'patches' up the surface by creating faces that cover the hole area completely. Having an overlap in the patched surface is perfectly acceptable as the wrapper deals with this overlap automatically.
Excerpts from User Guide: Assigning parts to regions creates a relationship between the meshed part and the physics region where part-level objects (parts, part surfaces, and part curves) are associated to their equivalent region-level objects (regions, boundaries, and feature curves). This action allows STAR-CCM+ to convert the volume mesh to a finite volume representation that the solver can use to obtain a solution. These assignments do not need to be one-to-one. That is, you can assign multiple part-level objects to the same region-level objects.
If Steady State option is selected, Eulerian Multiphase model would not be available. Lagrangian Multiphase gets active only when Liquid or Gas and flow as Coupled or Segregated are selected.
Stopping Criteria in STAR-CCM+
Automatically generated stopping criteria cannot be deleted, but the Enabled property can be activated or deactivated.Options exist to create stopping criteria based on monitors already defined. The node of a monitor-based stopping criterion has properties just like the automatically generated ones.The monitor-based convergence check and stopping criteria can be used to identify possible divergence or unrealistic results early during the simulation thereby reducing HPC cores and license usage. For example, area-averaged pressure or temperature can be monitored on key planes or walls and if the value exceeds some unreasonably high value say 0.5 [MPa] or 500 [K], the solution should be stopped immediately. This is important when runs are made on a cluster with queueing of large number of tasks. The simulation shall get terminated as soon as divergence conditions emerge and result files shall get saved as well. Note that ANSYS FLUENT does not save any file if divergence occurs.Field Functions in STAR-CCM+
Field functions are mathematical expressions to define boundary conditions, material properties and booleans. Few basic rules that applies to creating Field Functions in STAR are described below.From User's Guide: Examples of Field Function Mesh Refinement - The following examples show mesh refinement using the trimmed, polyhedral, and tetrahedral mesher. The field function refines the mesh in an area where the turbulence kinetic energy is greater than 4.0 [J/kg]: Trimmed Cell Mesher:($TurbulentKineticEnergy > 4)? 0.1 : 0, Polyhedral Mesher: ($TurbulentKineticEnergy > 4)? 0.1 : (1.2*pow($Volume, 1/3)), Tetrahedral Mesher: ($TurbulentKineticEnergy > 4)? 0.1 : (2*pow($Volume, 1/3))
Make Multiple Runs in a Sequential Manners
Following macro as available from STAR-CCM+ official user guide document can be customized to make multiple runs by reading different *.sim file for each run. The correct path to the working directory needs to be specified for variable simDir which contains the simulation files to run in sequence.package macro; import java.io.*; import star.base.neo.*; import star.common.*; public class runMultiple extends StarMacro { public class SimFileFilter implements FilenameFilter { public boolean accept(File dir, String name) { return name.endsWith(".sim"); } } public void execute() { File simDir = new File("multipleRuns"); Simulation sim_0 = getActiveSimulation(); sim_0.kill(); for (File f : simDir.listFiles(new SimFileFilter())) { startAndRun(f); } } public void startAndRun(File f) { System.out.println("\n Starting "+f); String fileName = f.getAbsolutePath(); Simulation sim = new Simulation(fileName); // Uncomment next line to clear simulation before running // sim.getSolution().clearSolution(); sim.getSimulationIterator().run(); String newFileName = fileName.replaceAll("\\.sim", "-new.sim"); sim.saveState(newFileName); sim.kill(); } }
Heat Exchangers Models in STAR-CCM+
Heat Exchangers models are used to replicate the transfer of heat between two fluid streams - hot fluid and cold fluid. Applications include air conditioner evaporators, condensers, charge air coolers, radiators, electric heaters, and electronic devices. There are two options available:
STAR-CCM+ Lite can be used to post-process the results of a simulation that were solved using STAR-CCM+ (ccmpsuite). STAR-CCM+ Lite can be used to run the simulation for further iterations providing all models are available in STAR-CCM+ Lite including Java macros that were generated by STAR-CCM+ (ccmpsuite). However, if the macro activates any models that are not permitted under the STAR-CCM+ Lite license, the simulation shall fail to run.
The stopping criteria in STAR is not incremental. That means, if stopping criteria is set to 4000 iterations and that many iterations are already completed, this value needs to be increased to 5000 when you modify (such as change inlet velocity) the *.SIM file and want to make additional 1000 iterations. In batch runs, the output of the program can be saved to a file: starccm+ -batch mySim.sim > log.text. For work in the interactive (GUI) client, check the option: Menu bar > Tools > Options > Environment > Log output to File.
The parallel batch (non-interactive or non-GUI) runs on local machines can be made using command line or from shell/batch files such as: [1]When batch or shell script and *.sim files are in same folder --- starccm+ -np 32 -batch javaFile.java simFile.sim [2]When batch or shell script and *.sim files are in different folders --- starccm+ -np 32 -batch javaFile.java folder1/sub-folder1/simFile.sim. starccm+ -batch geoImport.java, geoClean.java, geoReanme.java, mesh, step, run - multiple commands within the -batch argument can be specified, three macros are run in order before running the mesh pipeline, step and the solver.
If the properties in the simulation file are correctly set, many batch simulations can be run using the default operations with no java file: starccm+ -batch myCase.sim. For example, reports, auto-save, auto-export, and scene hardcopies can all be specified in the simulation properties. Command line to open the STAR-CCM+ workspace, start a new simulation, and play a macro: starccm+ -new -m macro.java Batch mode for macros is run from the command line using the -batch option: starccm+ -batch macro.java myCase.sim. This option runs STAR-CCM+ with a script (macro.java in the above example). The -batch option ensures that no GUI is displayed. If you do not want the server process to exit once the batch file has completed, then add the -noexit option to the command line.
CHECKPOINT and ABORT: STAR-CCM+ runs can be aborted (saved at current iteration and exit the run) by creating a blank 'ABORT' file in home directory. A blank CHECKPOINT file shall save the simulation file at current iteration and let the run continue as per convergence setting.
Multiple Simulations Consecutively
Multiple simulation files can be loaded and run consecutively using a single macro. The following sample macro looks for all the .sim files in a specified directory, then for each simulation file it starts a server, iterates, and saves to a new filename. Use the command line: starccm+ -batch runMultiple.java. Save the macro as runMultiCases.java.
package macro; import java.io.*; import star.base.neo.*; import star.common.*; public class runMultiCases extends StarMacro { public class SimFileFilter implements FilenameFilter { public boolean accept(File dir, String name) { return name.endsWith(".sim"); } } public void execute() { File simDir = new File("simFolder"); Simulation sim_0 = getActiveSimulation(); sim_0.kill(); for (File f:simFolder.listFiles(new SimFileFilter())) { startAndRun(f); } } public void startAndRun(File f) { System.out.println("\n Starting "+f); String fName = f.getAbsolutePath(); Simulation sim = new Simulation(fName); sim.getSimulationIterator().run(); String nuName = fName.replaceAll(".sim","-new.sim"); sim.saveState(nuName); sim.kill(); } }
The plots in STAR is generated using scenes which are collection of 2 objects - Displayers and Outline. (a)Outline can be used to select section plane, boundary faces and edges (b)Scalar or vector - the actual component of contour plot - here again parts need to be selected on which contour plots are to be generated and (c)Attributes - this refers to features available to control the generation and display of the plots. In ANSYS Fluent as on V2021 R2, separate plots for mesh and scalar needs to be generated. Then a scene needs to be manually created where required mesh plot and scalar plot can be combined which makes it close to the concept of Scene used in STAR.
Section Planes and Reports
The post-processing planes can be created under Derived Part tab in the Model Tree. Quantitative values such as area-averaged pressure needs to be defined under Reports tab in the Model Tree. The convergence history charts are available under tab Plots.//Macro to count number of elements in a boundary PartSurface prtSrf_1 = ((PartSurface) Part_0.getPartSurfaceManager().getPartSurface("Inlet")); eCountRep_0.getParts().setObjects(prtSrf_1); eCountRep_0.printReport();
This code to generate mesh and this Java macro to make runs contains examples to carry out various pre-processing operations in STAR-CCM+ including volume mesh generation.
License Manager: LMTOOLS
Most of the CFD programs be it ANSYS FLUENT or STAR-CCM+ use LMTools to manage the licenses at their customers. The executable utility is installed in the same folder where main program such as ANSYS FLUENT is installed. The syntax to use LMSTAT is: lmstat [-a] [-c license_file_list] [-f [feature]] [-i [feature]] [-s[server]] [-S [vendor]] [-t timeout_value]. The purpose of each option is:Finding Names of Feature: to use -f option, one need to know the exact names of feasures. This can be found in license.dat file or check the output from -a options. lmutil.exe lmstat -s licServers -f "feature_name"
For scripting and partial automation of pre-processing, solver and post-processing activities, refer to this section of scripting page.
For dealing with file handling in Linux and Windows, refer to short summary of shell scripting.
The content on CFDyna.com is being constantly refined and improvised with on-the-job experience, testing, and training. Examples might be simplified to improve insight into the physics and basic understanding. Linked pages, articles, references, and examples are constantly reviewed to reduce errors, but we cannot warrant full correctness of all content.
Template by OS Templates