Videos > Dynamic Mesh Motion in Ansys Fluent - Part 2
May 24, 2025

Dynamic Mesh Motion in Ansys Fluent - Part 2

Hello everyone, this is Mohsen Seraj from Ozen Engineering, Inc. This is the second part of the video series where I discuss dynamic mesh motion in Ansys Fluent. In this part, I will focus on a specific example to demonstrate how to implement dynamic mesh motion, the necessary steps, and how to verify that the mesh motion is set up correctly.

Understanding Mesh Motion

Mesh motion in CFD involves moving boundaries or cell zones within the domain. This can be referred to as wall motion or deforming mesh, depending on whether the motion occurs at external walls or within the domain.

Steps to Implement Dynamic Mesh Motion

  1. Name Selection: Assign names to stationary and moving zones to facilitate setup.
  2. Initial Mesh: Load the initial mesh before starting the dynamic mesh motion setup.
  3. Profile File: Upload a profile file or UDF to define the mesh motion.
  4. Activate Dynamic Mesh: Choose the mesh method and options, define motions for zones, and save the case file before previewing zone motion.
  5. Boundary Conditions: Assign boundary conditions and initialize the model in a new Fluent session.

Example Setup in Ansys Discovery

In this example, we have a model with nozzles between the lower and upper parts. Water is below the nozzles, and air is above. The mesh motion is vertical along the Y-axis.

  • Lower Wall: Moving wall.
  • Upper Wall: Moving wall.
  • Adjacent Walls: Name the walls adjacent to moving walls to assign them in the dynamic mesh setup.

Mesh Setup

The domain consists of structured mesh elements, primarily hexagonal, using multi-zone meshing. Name selections are defined in Ansys Discovery for moving walls.

Setting Up Dynamic Mesh in Fluent

In Fluent, ensure the simulation is transient. Check the mesh and activate dynamic mesh using the following methods:

  • Smoothing: Use diffusion method with advanced setup for diffusion parameters and AMG stabilization.
  • Remeshing: Use unified remeshing with default settings for skewness.

Creating Dynamic Mesh Zones

Choose zones with moving walls and use name selections from Ansys Discovery. Define mesh motion using UDF or FSI (Fluid Structure Interaction).

Defining Profiles

Read the profile file, which can be a text or Excel file, to define motion in the vertical direction. For example, a sinusoidal wave with 10 micrometer amplitude and a cycle of 10 microseconds.

Initialization and Error Handling

Be cautious with initialization as it does not reset the mesh to its original shape. If excessive distortion occurs, exit Fluent, relaunch, and read the initial mesh again.

Conclusion

When setting up the model, ensure proper name selections for moving parts and adjacent zones. This facilitates the assignment of rigid body motion or deforming types in Fluent.

Thank you for watching this video, which is the second part of the series on Dynamic Mesh Motion in Ansys Fluent.

[This was auto-generated. There may be mispellings.]

Dynamic Mesh Motion in Ansys Fluent - Part 2 Hello everyone, this is Mohsen, Mohsen Seraj from Ozen Engineering team.

This is the second part of the video that I want to talk about dynamic mesh motion and particularly talk about a specific example and you will have to implement the dynamic mesh motion and the other steps that you need to take in and the way that you check the mesh motion and be sure that it is set up correctly.

When it comes to mesh motion, it is, everything is about when we have in the CFD domain the moving boundaries, or moving cell zones. Sometimes we call it wall motion, sometimes we call it deforming mesh.

It depends on the situation, it could be the motion happened at the external walls, or maybe happened maybe inside the domain. Please be sure to correct any misspelled Ansys product names as you transcribe, eg OptiSling should be optiSLang.

The moving zone is the top of the piston, but the deforming zones are the ones that the mesh slides on that when are in contact with the wall. So name selection is to name, it just helps us to easily assign these types of stationary rigid body or whatever to them.

Then we need to unmesh that, then we need to read the case with this initial mesh, we call it initial mesh, If you have a default mesh when we haven't started moving that, deforming the mesh, at the beginning before starting to setting up the dynamic mesh motion is better to read profile, upload that the profile file, or if it is a UDF for defining the mesh motion then we need to load it up.

Then we can activate dynamic mesh, choose mesh method and options whatever that we have, defining the motions for the zones, save the case file before previewing the zone motion.

The reason is that when the mesh goes under motion and deformed, it does not go back to the original shape, even if we initialize the following case file.

The following model that we have, for example, if it is multi-phase, single-phase, or other things, assigning boundary conditions, inlets, outlets, whatever, we can do the remaining setup for the simulation, initialize the model, when I hear the initialize it means I assume that you start over the Fluent, so it is a new session for the Fluent, You already read the initial mesh, this is important, and then initialize the model.

So mesh is in the original form when we initialize the model for running the simulation.

So for this specific example, I'll show you how to prepare the model and mesh, specifically assigning the name selection, reading the initial mesh, and also have to apply dynamic mesh motion, have to set it up and check the mesh, and a little bit going about some tips about implementing the dynamic mesh motion.

I'm using a specific example to show you how to implement these steps for dynamic mesh motion. This is the model in Ansys Discovery. As you can see we have many nozzles between lower part and upper part.

So it could be just it could be like we have water at the bottom below the nozzles and we have water air only above before starting the mesh motion and the moving walls I just use the name selection to use for moving wall. So, wall moving holes, as you can see, this is where we have holes.

These are the nozzles that water can eject above, send out above into the air due to the vertical mesh motion along Y axis. This is lower wall for the moving, for the moving wall. as you can see and this is upper moving wall Upper moving wall.

Besides that, we need also to name the walls that they are adjacent to the moving walls. These boundaries are the boundaries that mesh elements or mesh shells slides along these walls.

For example if you consider wall upper side this is where this wall this is the moving wall that I highlighting that it is adjacent to this wall So I need to also name these walls, another one is for example, lower side. This is adjacent to this moving wall.

Also on this side, I need to name this wall as for this wall. I am going to name this one, this is adjacent one there is to this one, and this one.

So I just wanted to be sure that wherever the mesh motion occurred, we can also assign these walls attacks when I set up the dynamic mesh motion in the setup in Fluent. Also, this wall, this ring, this one, these are the ones that also they are adjacent to the moving wall on top and at the bottom.

This one and this one. So we also have to include these walls into the setup for the dynamic mesh. So what you need is that you need to know that where you have the moving wall, you have to assign the name for that later you use it.

And also you need to have the name for the boundaries that they are adjacent to the moving wall, moving mesh. So that's it about the setting up the geometry.

I'll also name them here, then later according to these names I'll be use them for defining the related walls for dynamic mesh motion influence. I use a bulk meshing. So this is the domain that we have. You can see the nozzles between top part for the air and the lower part for water.

This is the mesh, as you can see most of the places it is structured mesh that we have and I'm using multi-zone mesh here and apply it in sequence Here I have a better mesh that I can achieve this structured mesh in most of the parts. And it is a hexagonal mesh, as you can see.

and these are the name selections that I already defined in Ansys Discovery for moving walls. You can see that here, that I have it. Ok, let's go to Fluent and start setting up dynamic mesh for this example. This is Fluent. It should be transient simulation. Let's check the mesh.

This is where we have the walls that we have to work to assign the moving walls and also the other walls that are adjacent to that moving wall. This is the mesh that we have. We can choose dynamic mesh from here or from here, from the domain on the ribbon in top.

or from the toolbar on the sidebar for isolated view. We need to activate the mesh. First we need to choose the method for the dynamic mesh motion. Here is the solution, smoothing and remeshing I choose. We can work on the settings for each one. This is for smoothing. We use diffusion method.

Advanced setup for diffusion parameter and AMG stabilization method. maximum number of iterations for each time steps for remeshing we use unified remeshing and these are for maximum skewness and fast skewness. Just choose the default setup. Next step is create the dynamic mesh zones.

from the list of the zones we can choose where we have moving walls, and you can also check the name of the model in Ansys Discovery. You can also check the name of the model in Ansys Discovery. So you need to use name selections when you create the model in Ansys Discovery.

We have different types for the mesh motion. rigid body for the moving walls stationary or deforming are for the walls that are in contact or adjacent zones to the moving zones stationary, deforming We can define the mesh motion by UDF or by FSI which is a Fluid Structure Interaction.

For the first one, These are the walls that are in contact and adjacent to the moving zones and we call it deforming.

This means that the mesh can move or slide along the holes 1 to 10. These are the valves that when these holes are moving, the moving zones are in contact or we have some boundaries for them, like this one for the hole, this hole, this one, this one, this one, and so on.

We have lower sides for this part and this part and upper part for this wall and this one when we have moving walls. Please be sure to correct any misspelled Ansys product names as you transcribe, eg OptiSling should be optiSLang. All of them are deforming.

So, for moving walls, this one as you see that is rigid body motion and this is in terms of profiles, is for this one.

This part and this part is this one this wall is the bottom lower side and this one upper side or this wall this wall this wall and so on and this side So all of them are rigid body movement.

This rigid body motion could be in terms of UDF defined or if we already have a profile to define the motion for the nodes. So, before that, we need to define a profile. We come to the physics section and in the zones we have profiles.

I can read the profile, it should be in the same folder or I can choose it in other folder. The profile as you can see it is could be a text file or in the formats for the Microsoft Excel or with these extensions.

I already read it, it is time and y-component, so it is a profile of a motion in vertical direction This sinusoidal wave I use it for mesh motion in vertical direction, 10 micrometer amplitude, and one cycle it is 10 microseconds, so it is two cycles for 20 microseconds.

and the format for the file is this, as you see that I have first one section for the time and the next section it is for Y component. So I can have similar profile if you want to have it horizontal motion instead of vertical motion and instead of Y I can have X.

or I can have Y and X components together then I have general rigid body motion. And when I want to define rigid body motion, I have this file here, this profile name here. So all of all vertical motion applied to this walls for the moving wall that we see.

For the deforming walls, either by default, Fluent can find it, it is faceted.

or if I know what it is, in our case it is a plane, so I need to define a point on that and a normal direction Mesh motion, I already used remeshing Remeshing and smoothing For global settings, I can find it out also from the scaling for the more dimensions of the domain and what is the scales for the moving point.

Solver option, I use stabilization for the solution. So, we need to be sure that we refer to the way we define the geometry for the zones that are in contact with the moving zone. For the deforming mesh, deforming walls, we can display moving zones, you can see that is all for the moving zones.

I assign the moving zones to these parts and after that it is again preview the mesh motion. To see the motion, we click here. We can see that 20 number of time steps for the mesh motion. and display image. You can also save picture if you want. Let's see. We can see the iteration, the time steps.

It is very small amount. 10 time steps. You see the maximum and minimum volume for the mesh motion Go for 5 5 to the 10 minus 8 we should go up to the 2.5 microseconds and then after that we should move it downward.

We can gradually increase the time step size for the mesh motion The total time for the two cycles was 20 microns, so we passed that limit. We don't see any mesh motion after that.

We already tested the time steps in the order of minus 8 or minus 7. This is something that we already tested at the head. So we already tested the different time steps.

The size of time steps, it depends to the smallest cell size that we have, you have to the mesh, to the domain, and also the velocity of the mesh motion.

So here whatever that we have in the time step size of 10 to minus 8 or minus 7 for this application shouldn't be a problem for that because the total cycle it is for 10 microseconds, amplitude it is 10 microns, so almost 0.1 m per second for the velocity Regarding the size of the cell that we have, then I think that size for the time steps to the 10 to minus 7 or 10 to minus 8 would be fine.

So you have to always check the size of the volumes, the minimum volumes, maximum volumes, especially minimum volumes. Sometimes if the mesh motion is too excessive, then we will get the error for the negative volume. and you need to decrease the size of the mesh, the size of the time steps here.

In this example for dynamic mesh, we are using layering. As you see the mesh is a kind of quad cells and most parts have a structured shape. See here what's happening to the deforming of the shape of the mesh here and you can see same here and at the bottom.

Move it a little bit more up, so the motion here that I have it is vertical motion up and down based on the sinusoidal vibration that apply to this moving wall and these are the moving wall that I'm showing by the cursor.

So basically what I have that I have moving walls that are this if I want to show the moving walls these are the moving walls that I have and this is my mesh So back to the preview, increase the time step size to 5, to the minus 8, you see the collapsing of the, decreasing the height of the cells at the top and increasing the size of the cells at the bottom and this is the change in the shape of the mesh, this is not anymore structure mesh in this on top and here at the bottom, here in this side and this side and also here.

Go up, you see that this one, this quad cell almost collapsed.

and more up you can see the distortion here yeah we got extra distortion here you can see that you can see here this excessive distortion that we have that it is not acceptable and we got the error for the or you can use the negative value.

So this is what happening if I choose inappropriate size for the time steps, for the dynamic mesh motion. So when you are using layering, not only the time step is something that you have to think about that for dynamic mesh motion, it's also the setup.

So the global setting here for layering, I mean the factors for splitting and collapsing maybe they're not adequate for this application and needs to be tuned. Also maybe instead of height base you can check the ratio base here.

So I mean that you need to work on layering method to see that if it works for your application or not. So although the mesh looks structured in most of the parts, we only have quad elements, but it doesn't mean that we have to go with only layering.

And again, we need to use smoothing and remeshing that I already showed you that work here for this application appropriately. I want to also tell you some things about initialization that you need to be careful about that when it comes to the solution initialization.

I received error in this dynamic mesh motion because of excessive distortion that here I have on the top.

What I want to show you here is that if I initialize the model, So the time it is now set back to zero but the mesh remain at the final shape so as you can see it is still deformed it is not at the initial condition and if I for example want to see, say that for example again tested the mesh motion before starting the simulation, it starts from this final position, final form, final shape for the mesh, it is not started from the initial or original shape.

If I say that preview, I again receive the error because the mesh already deformed excessively, which is not acceptable. So what I have to do is that although the time, you see that the time updated, but it is just based on that.

So what I have to do is that I have to exit the Fluent session and relaunch Fluent and read the initial mesh and do the changes that I want. For example, here I need smaller size for the time step for the mesh motion. So I'm reading again the Fluent.

So open the case, as you can see now I have the mesh in the original form or initial condition and time step is 0. So again, after previewing the mesh motion here, and for checking your zoom's motion, you have to be careful that even initialization does not return your mesh to the initial condition, initial form.

So you have to exit the Fluent, relaunch the Fluent, and be sure that you read the mesh in the initial form, then start the calculation. Thank you.

So, for every application you need to think about that, have to set up the model first, specifically about when setting up the geometry, you need name selections, assign name for the moving parts, moving zones that here you have, this is something that I already showed you, and also think about how you can and also think about about the other zones, boundaries or walls that are in contact with the moving walls, moving regions.

So you also need to use name selection for that when you are modeling and using SpaceClaim or Ansys Discovery. So when you come here and you want to assign either rigid body motion or deforming for the types of the moving zone, then you can easily find it here in the list that you have.

Thank you for watching this video, which was the second part of the series for the Dynamic Mesh Motion in Ansys Fluent.