TAGGED: define_grid_motion, dynamic-mesh, udf
-
-
June 13, 2025 at 2:19 pm
fakhreddine.madi
SubscriberI have created a UDF that appears to work perfectly when I preview the mesh motion (tested for over 5+ cycles) and zone motion, but fails when running the simulation. I am using the same inputs for my mesh that worked fine in preview motion mode.
Some of my settings that work fine in preview motion are:
- Diffusion smoothing, with AMG Stabizilation set as GMRES. ( with Verboisty 3, to help debug)
- Remeshing (Methods-Based Remeshing, 2 interval) with parameters set from initial mesh stats - Also tried turning this off, and preview still works.
All the mesh statistics (even when remeshing if off) seem to be fine, and the nodes are moving accordingly.
However, when I start a new case with the same approach (setting and compiling), the mesh motion is incorrect (fails or only moves some nodes, then fails due to neg volume).
I have tried the following versions of Fleunt (opened in MS environment): 2024R2, 2025R1 and 2021R2. Each version appears to fail in different ways; however, they all seem to work fine when I preview mesh motion mode (tested with 5+ cycles).
For example, 2021R2, motion works up to a point in time, after which my motion stops. In 2025R1, I get a floating point error asap, even before morphing. In 2024R2, the motion fails when morphing time starts. I start by using the same mesh for all cases and run them in steady first before testing the motion. I also tested a few different meshes (hybrid and pure tetrahedral), but all have the same issue.
I know that this form and Ansys support are unable to debug my UDF code, but I would appreciate any help or guidance (other than the customisation manual). I see mesh preview as a sandbox to develop UDF code, motion, and validation of motion, but this does not seem to translate to a working motion simulation in my case.
- Could someone help me understand why I'm facing this issue?
- What is the main difference between how mesh motion preview works vs the actual motion of the mesh during the simulation?
- If it works in mesh motion (with good stats), why would it fail on the first iteration, where the motion is due to move the grid? Although I am using the same settings that worked in mesh motion
Additional information about my UDF: Using DEFINE_GRID_MOTION to move nodes in x and y based on mathematical calculations, it first collects all the initial coordinates before morphing (time set).
Many thanks,
Academic user
-
June 13, 2025 at 2:24 pm
Federico
Ansys EmployeeHello,
first, are you using the 6DOF model at all? Preview Mesh motion will not update forces acting on the 6DOF surfaces so the resulting motion will inevitably be different from the actual result.
second, are you reloading your mesh/case after previewing the mesh motion? Doing a Preview Mesh motion actually moves the nodes, so you need to reload your case to start from the same starting position.
Finally, what is the error that you get when you are actually running your case? Are you using the same time step size as the preview mesh motion?
-
June 13, 2025 at 2:43 pm
fakhreddine.madi
SubscriberHi Fed,
Thanks for getting back to me quickly.
I am not using a 6DoF; my case is only 2D Aerofoil (x,y updating with no FSI link)
Yes, I close Fluent (unload the UDF and clear the built folder), then reopen a new case and rebuild from scratch.
The most common error is getting a negative cell volume due to not all the nodes moving, but I don't understand why. Given that the motion preview actually moves the mesh fine, and I am using the same settings.
Let me know if any more information would help.
Many thanks again,
Madi -
June 13, 2025 at 3:06 pm
Federico
Ansys EmployeeCan you show some screenshots of your model/mesh and Dynamic Mesh settings?
-
June 13, 2025 at 4:33 pm
-
June 13, 2025 at 6:42 pm
fakhreddine.madi
SubscriberGiven the dynamic mesh works in preview mode with those settings, I am not sure why it wouldn’t during the actual simulation, using the same dt and settings
-
June 13, 2025 at 6:57 pm
fakhreddine.madi
SubscriberSorry, I forgot to mention that I also have “Local cell” clicked on, which I forgot to apply to the snip. (But I also have tried not using that option, but it does not impact the issue I am facing, as it helps with remeshing tets, but still end up getting the same error as before, regardless.)
Thank you again for your time and help
-
- You must be logged in to reply to this topic.
-
3266
-
1031
-
984
-
859
-
798
© 2025 Copyright ANSYS, Inc. All rights reserved.