Pointwise Reliable People. Reliable Tools. Reliable CFD Meshing. C F g L M P t Y +
 
   
   
 

Share This Article


Automating Geometry and Mesh Generation for Heat Exchangers

Maura Gallarotti
Master's Student
KTH Royal Institute of Technology

During my master thesis in a multinational company, I used Glyph scripting to automate the geometry and mesh generation for a 2-D axisymmetric simulation.

The aim of my thesis was the analysis of the temperature distribution in cylindrical heat exchangers with oil as the cooling fluid. A cross sectional area of the analysed geometries can be seen in Figure 1, where the rectangular elements represent the cross sectional areas of the hot discs. Two different types of heat exchangers were analysed, one where the heat is released by full discs (Figure 1 on the left) and one with discs with an additional cooling channel to increase the cooling efficiency (Figure 1 on the right). In the heat exchangers under study, the flow of the cooling oil was driven just by natural buoyancy which means that the flow of the oil enters the heat exchanger from the bottom and then rises because of the decreasing density of the oil due to the increasing oil temperature. This leads to a self-driven cooling system that does not require an oil pump to work and thus is more reliable with lower operation and maintenance costs.

From a physical point of view, the study of the flow of the oil in these heat exchangers presented some challenges. First, the cooling fluid was a high Prandtl number oil that tends to not have a uniform temperature distribution and creates hot streaks. Consequently, a highly refined mesh in the oil pipes was needed to adequately resolve the gradients in the flow field. Furthermore, the computational fluid dynamics (CFD) simulations revealed that the small geometrical features of the discs combined with a low Reynolds flow created unique flow features such as recirculation bubbles and vortex structures. All these aspects lead to the need of a high grid quality. In particular, several detached recirculation regions took place in the pipes, and those unsteady flow structures strongly influenced the time dependent solution. The mesh also had to satisfy CFL constraints for the accuracy of the implicit time integration, but this aspect was not too stringent as the buoyancy-driven flow was very slow.

The scripting capability of Pointwise allowed me to quickly generate the heat exchanger geometries and to perform parametric studies by changing the dimensions of several geometrical parameters to assess the effect of these parameters on the cooling efficiency.

Geometries generated using Glyph scripting.

Figure 1: Geometries generated using Glyph scripting (the x-axis represents the axis of symmetry). +

Figure 2 shows the geometry and mesh obtained with Pointwise. An orthogonal structured mesh was used as it is the most accurate option for the studied geometry.

With the x-axis being the axis of symmetry for the 2D approximation, the scripts create the geometry rotated by 90° with respect to the real position. Gravity acts in the negative x direction. The solid region where the heat generation occurs is highlighted in green, while the fluid region where the oil flows is highlighted in blue. The inlet region is on the left (representing the bottom of the heat exchanger) and the outlet on the right (representing the top of the heat exchanger). It was decided to also mesh the solid discs and not only the fluid region in order to solve for the heat conduction in the discs and obtain the temperature distribution.

The final structured mesh with the fluid region in blue and the solid region in green.

Figure 2: The final structured mesh with the fluid region in blue and the solid region in green. +

A series of close-up images highlighting the details of the structured mesh.

Figure 3: A series of close-up images highlighting the details of the structured mesh. +

In order to easily specify the dimension of the geometrical parameters, a GUI was developed using Tk which can be seen in Figures 4 and 5. Figure 4 shows the GUI for the heat exchangers with full discs, while Figure 5 shows the GUI in the case of an additional cooling channel.

The user interface created using Tk which exposes the parameters necessary to generate the geometry.

Figure 4: The user interface created using Tk which exposes the parameters necessary to generate the geometry. +

The user interface used to generate the geometry with an additional gap.

Figure 5: The user interface used to generate the geometry with an additional gap. +

The geometries of these heat exchangers present a clear repeated pattern that can easily be implemented using Glyph scripting. The first step of the scripting process was the generation of the red region in Figure 6. This involved defining the coordinates of each point, the connectors between each point, and the domains enclosed by the connectors. Next, a procedure for the mirroring of the inlet region was developed in order to obtain the outlet geometry.

According to the number of discs chosen by the user through the GUI, three “copy procedures” copy the black, the blue, and the yellow regions in order to assemble the entire geometry.

Specific regions used in the copy procedures.

Figure 6: Specific regions used in the copy procedures. +

The dimension of the connectors, which is the number of grid points on each edge, was defined as a function of the geometrical size of the connector itself. In this way, different geometrical parameters can drive the dimensions of the connectors and ultimately the mesh resolution. In order to avoid a mesh that is too coarse or fine for certain geometrical parameters, the dimensions of the connectors have been limited to a certain range of proper values. These constraints allow for a fully automated meshing procedure. Figures 7 and 8 show the resulting mesh when using different combinations of geometrical parameters.

Different geometrical parameters still generate a high quality mesh as can be seen in this case with thicker discs.

Figure 7: Different geometrical parameters still generate a high quality mesh as can be seen in this case with thicker discs. +

This case with wider discs illustrates how the geometric parameters drive the connector dimension and ultimately the mesh resolution.

Figure 8: This case with wider discs illustrates how the geometric parameters drive the connector dimension and ultimately the mesh resolution. +

The script was developed in such a way that the boundary conditions were automatically assigned as pressure inlet, pressure outlet, and wall, in order to simulate the buoyancy driven flow.

The external walls were adiabatic with a no-slip condition, while for the discs walls the “coupled” boundary condition was assigned to balance the energy transfer. In order to account for the effect of an insulation layer around the discs, the "shell conduction" option was enabled, setting a non-zero wall thickness.

Every disc has been defined as a separate solid entity in order to define a specific heat generation value in each disc and to create a temperature monitor in ANSYS Fluent. Each entity was named DiscN, where N represents the disc number from inlet (N=0) to outlet. Furthermore, for the mass flow rate monitoring, a name has been given to each edge at the inlet of each pipe (EdgeN and EdgeShadowN) and the connectors have then been fused and set to “interior” in ANSYS Fluent using input journal.

Figure 9 shows a screenshot of the automatically assigned boundary conditions, highlighting in the upper figure the definition of a name for the edges at the inlet of the first three oil pipes: Edge1 and EdgeShadow1, Edge2 and EdgeShadow2, Edge3 and Edge Shadow3 and so on. These connections are later fused within ANSYS Fluent and a specific name (pipe1, pipe2, pipe3…) is given to them to recall all these edges.

This case with wider discs illustrates how the geometric parameters drive the connector dimension and ultimately the mesh resolution.

Figure 9: Boundary conditions are automatically assigned using Glyph including wall-type boundary conditions for the discs and boundary conditions used to specify mass flow monitors for each oil pipe. +

Figures 10 shows the resulting cell zone conditions and boundary conditions. In particular, all the discs are defined as solid entities. An ANSYS Fluent input journal defines the monitors for the temperature of the oil in the middle of each oil pipe as shown in Figure 11 and Figure 12. For the geometry with discs that have an additional cooling channel, additional monitors are defined in order to monitor the oil mass flow rate that enters the pipes in the lower region and that leaves the pipes in the upper region as shown in Figure 12.

Volume conditions automatically assigned by the script.

Figure 10: Volume conditions automatically assigned by the script. +

Temperature and mass flow rate monitors in the unsteady simulations for the geometry with full discs.

Figure 11: Temperature and mass flow rate monitors in the unsteady simulations for the geometry with full discs. +

Temperature and mass flow rate monitors in the unsteady simulations for the geometry with an additional cooling channel.

Figure 12: Temperature and mass flow rate monitors in the unsteady simulations for the geometry with an additional cooling channel. +

Superposing the velocity contours to the mesh, one can see that the boundary layer is always inside at least two mesh layers, but in the thicker boundary layer regions it is within 3-4 mesh layers. The resolution there is not optimal, but the flow had a very low Reynolds number, so this is acceptable. Furthermore, the computational domain presented about 400 90° corners, so the resolution could not be too high, otherwise the computational time for the 1500 s physical time unsteady simulations would have been too long. In the end the comparison with experimental results was satisfactory for these meshes.

Velocity contours and mesh.

Figure 13: Velocity contours and mesh. +

Temperature contour (solution of the unsteady simulation).

Figure 14: Temperature contour (solution of the unsteady simulation). +

Recirculation regions at the outlet region.

Figure 15: Recirculation regions at the outlet region. +

The oil flowing around each disc develops stagnation and separation points.

Figure 16: The oil flowing around each disc develops stagnation and separation points.

Recirculation regions.

Figure 17: Recirculation regions. +

Solution for the heat exchanger with an additional cooling channel.

Figure 18: Solution for the heat exchanger with an additional cooling channel. +

Average temperature in the solid discs from inlet to outlet (solution of the unsteady simulation).

Figure 19: Average temperature in the solid discs from inlet to outlet (solution of the unsteady simulation). +

As shown both by the temperature contours and by the average temperature distribution in the discs (Figure 19), the temperature from the inlet to the outlet of the heat exchanger does not increase linearly, but presents a periodical behaviour, with temperature peaks each 10-15 discs. The formation of these peaks is related to the oil mass flow rate distribution inside the heat exchanger, with stagnation regions every 10-15 discs. Additionally, Figures 15, 16, 17 and 18 show that the mesh was able to resolve recirculation bubbles and strong flow gradients. Ultimately, the simulation set up was validated thanks to comparison with experimental measurements that showed an average relative error below 2%.

When I started my thesis, I had no experience with Pointwise and I had never heard about Tcl/Tk or Glyph. Nonetheless, I was able to write a script to completely automate the grid generation process in less than a week. I have no hesitation in saying that without Glyph scripting I would have lost several hours generating grids for this application and I would not have been able to perform all the simulations that are now a part of my thesis.

Try Pointwise Yourself

If you would like to generate your meshes using Pointwise request a free evaluation today.