Resources

Ansys FreeFlow/Rocky Solver SDK customization: Impinging Jet Cooling

Written by Tiago Lins | Nov 7, 2025 4:15:32 PM

Discover ways of customizing your Rocky or Freeflow model. Here, we describe the workflow for adding a new module in FreeFlow.

Challenges

In high-fidelity fluid-solid thermal scenarios, leveraging advanced simulation platforms like FreeFlow and Rocky paired with the customization power of Rocky SDK enables engineers to build additional physics and postprocessing modules. In this blog we explore how one could develop a Rocky SDK extension, using as an example a impinging liquid jet of SPH elements striking a hot wall, capturing splash, heat transfer, and wall interaction forces.

Engineering Solutions

Ansys FreeFlow and Rocky provides many modules that can incorporate complex physics for SPH and DEM. Like user-defined functions in Fluent, FreeFlow and Rocky also offer the possibility of adding your own custom modules using the Rocky Solver Software Development Kit (SDK). These are some capabilities:

  • Adding new force terms or modifying particle acceleration and trajectory.

  • Capturing heat transfer between SPH/DEM particles and walls with custom scalars.

  • Defining new interactions, including mass transfer and reactions between DEM particles and the surrounding gas phase with CFD coupling.

  • Advanced, custom-defined post-processing, including defining new scalars and properties.

Thus, by writing your own plugin/add-in, you gain full control over element acceleration, scalar fields, wall interactions, debug logging, and post-processing. A number of hooks can be used to modify SPH element properties, physics, and interactions, as shown on the figure on the right from the Ansys Developer website.

We will show the application of this method for a specific problem involving water flow: A liquid‐jet (modeled via SPH) consisting of water at 300 K impinges perpendicularly on a hot planar wall at 400 K. Key phenomena includes deceleration on impact, radial spread, splash/recirculation, and heat transfer to the wall. Here, we deployed a new SDK module to artificially generate swirl in the SPH elements. This is achieved by providing an additional acceleration term that only acts in a pre-defined region of interest (ROI).

The new module was adapted from Ansys SDK Development source codes available in the Ansys Support Webpage. The basic workflow involves the following steps: 

Define the add-in specification for GUI (Python)
Use a specification file to define user inputs: jet swirl start time, initial velocity or swirl strength, wall temperature, ROI list (reference points). This corresponds to the Python spec file where model parameters are defined (e.g., start time, swirl strength, axis vector, ROIs) and can be modified by the user. 

Once the module is compiled, can be found when opening a new session of FreeFlow or Rocky, and parameters can be adjusted to control the intensity of swirl and the location and axis where it will be activated:

 



Configure the Module Data Structure (C++)
Create a struct (ModuleData) holding runtime parameters: e.g., start_time, swirl_strength, axis of injection, number of ROIs, array of ROIData structures (each with index, reference point). Allocate and free in configure/teardown.

Prepare the plugin function (C++)  
The main portion of the code is written using a function called ROCKY_PLUGIN_POST_FORCE_ON_SPH_ELEMENTS. Here, we calculate each SPH element's position relative to the axis of injection supplied by the user. Based on the calculated radial distance, an acceleration term that is orthogonal to both the axis of injection and the radial distance vector is applied to each SPH element, as long as they are within the bounds of the specified area. This method artificially adds the effect of swirling flow into SPH elements. 

 

When swirling is turned on, we observe the effects on the impinging jet on the surface, including a more unstable and more turbulent flow on the plate.

The heat transfer coefficient on the bottom plate can be assessed using FreeFlow built-in SPH HTC Calculator. Here, we see that the increase in swirl intensity leads to lower heat transfer from the hot plate to the liquid in some zones, especially near the center of the domain.

A detailed description of the model setup and code is shown in the video below:

Downloadable Resources

Module source code: Link

Benefits

Ansys FreeFlow and Rocky already provides a growing library of modules that incorporates complex physics, and additional post-processing capabilities. Advanced users also have the flexibility of further customizing their models based on their needs using the SDK tools and sample codes. 

Ozen Engineering Expertise

Ozen Engineering Inc. leverages its extensive consulting expertise in CFD, FEA, optics, photonics, and electromagnetic simulations to achieve exceptional results across various engineering projects, addressing complex challenges.

We offer support, mentoring, and consulting services to enhance the performance and reliability. Trust our proven track record to accelerate projects, optimize performance, and deliver high-quality, cost-effective results. For more information, please visit https://ozeninc.com.

If you want to learn more about our consulting services, please visit: https://www.ozeninc.com/consulting/

CFD: https://www.ozeninc.com/consulting/cfd-consulting/ 

FEA: https://www.ozeninc.com/consulting/fea-consulting/ 

Optics: https://www.ozeninc.com/consulting/optics-photonics/ 

Photonics: https://www.ozeninc.com/consulting/optics-photonics/ 

Electromagnetic Simulations: https://www.ozeninc.com/consulting/electromagnetic-consulting/ 

Thermal Analysis & Electronics Cooling: https://www.ozeninc.com/consulting/thermal-engineering-electronics-cooling/

Suggested blogs by Ozen Engineering

Simulating Electric Motor Cooling with Ansys FreeFlow: Oil Spray and Water Jacket Methods

Ansys FreeFlow and EnSight: Visualizing Heat Transfer in a Stirred 

Getting Started with Ansys FreeFlow: Modeling a Stirred Tank