Dynamic Mesh problem, can't avoid negative cell volume detected

MiguelGuerraMiguelGuerra Member Posts: 2

Hello everybody.

I would like to ask you some help because I have been stuck for a few weeks with a simulation.

I have this geometry; it is half of the top of a hemispherical piston. The green walls correspond to the piston, so they move in the simulation.

I mesh this geometry with a tetrahedral mesh and create named selections. When I go to Fluent I make sure that the boundary conditions are correct (symmetry, walls and interior). Then I add the compiled UDF with the movement of the piston (sinusoidal movement) and I go to the dynamic mesh section. In the mesh methods I enable smoothing (spring constant factor=0 because I do not want the boundary to get deformed) and remeshing (where I enable local cell, local face and I use defaults in the parameters). After this, I create the dynamic mesh zones:

-         Piston walls as rigid body with UDF motion and the interior cell height in meshing options.

-         For the exterior walls I do not create a dynamic mesh zone

-         Interior and symmetry as deforming with smoothing/remeshing and their respective zone parameters.

In the display zone motion, I check that the movement is correct and finally I go to preview mesh motion where I always get the “negative cell volume detected” error.

I have already tried many combinations creating individual selections, changing and trying different dynamic mesh zones with rigid body, deforming and stationary, trying different mesh method settings, … And I do not know what else I can try.

When I refine the mesh or change the time step to a lower one, I only came to the conclusion that the error will be delayed but will appear, it always does.

I have discard changing something in the udf motion because I have tried the same udf with other geometry using hexahedral mesh and layering and the simulation goes perfect. Also in the udf I have "udf.h", "dynamesh_tools.h" and "unsteady.h" included.

I have found that with a Cell Register I can see where the negative volume is created but I can´t create the Field Variable (it is locked in grey) or at least I don’t know how to use it.

Could you give me any advide or some help?

Thanks for your attention.


  • sdebsdeb Posts: 200Forum Coordinator


    Since you have tested it thoroughly, I believe you have already checked it.

    But can you please make sure to use the Local Mesh settings for Remeshing instead of Global values. You will get the local info by using "Mesh Scale Info" button. Then use those values or values close to them for the Min/Max lengths scales.

    You mesh might be getting very skewed before it gets remeshed. Also make sure to frequently do the remeshing if the deformation is significant.



  • MiguelGuerraMiguelGuerra Posts: 9Member

    Hello sdeb.

    Normally when I go to the remeshing mesh method settings I enable local cell and local face, then I click "Use Defaults" for the parameters and in "Size Remeshing Interval" I put 1 interval.

    For more information, in this simulation, the walls are moving 11.3 mm in 0.15 s (reaches top) and then 22.6 mm backward in the next 0.45 s (reaches bot) and it goes again 22.6 mm to top (piston movement). The velocity varies in a sinusoidal function (UDF). If the wall moves too fast from one time step to another, it causes the negative cell volume, isn't it?

    Which values for cell skewness and face skewness should I consider as maximums?

    Is it good to use the layering method with a tetrahedral mesh?

    Here is a pic of the mesh.

    Thank you for your attention.

  • sdebsdeb Posts: 200Forum Coordinator


    Please see embedded image on what I meant for Mesh Scale Info. Also, dynamic layering has a few limitations with mesh type like hexahedral elements need to be used. Please check this link : https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v195/flu_ug/flu_ug_dynam_mesh_update.html%23flu_ug_dynam_layer_meth.

    Yes, if you can split your domain avoiding the limitations of dynamic layering, then it will be easier and faster and more stable approach than remeshing.

  • YasserSelimaYasserSelima Posts: 944Member
    edited March 31

    Make the minimum length scale zero and increase the interval. Use the same maximum appear in the mesh scale info. Also make sure your time step is much lower than ( minimum length scale/max_wall_velocity)

  • MiguelGuerraMiguelGuerra Posts: 9Member

    Hello Yasser,

    I tried your answer but I still got the negative cell volume error. Here is what I have done, can you take a quick look at it in case you see the mistake?

    1st I mesh the model and create the named selections in the ansys meshing bench and I export it as .msh

    2nd I read and check the mesh in fluent. Then I go to Boundary Conditions and Cell Zone Conditions to make sure it is right.

    3rd Mesh Method Settings: I enable Smoothing and Remeshing. For Smoothing I enable Spring with Constant Factor=0. In remeshing I do what you said.

    4th Dynamic Mesh Zones. I compiled the UDF and create the zones.

    • piston head: rigid body and select the udf file. In meshing options I let it as default (cell height 0 m)
    • interior, symmetry and interior wall: deforming, and in the zone parameters I only change the maximum lenght scale as zone scale info.
    • fot the base and exterior walls I don't create Dynamic Mesh Zones, should I create them as stationary?

    5th Display Zone Motion: it moves as I want.

    6th Preview Mess Motion:

    In the Mesh Method Settings, for Remeshing, the minimum length scale is 0.00048793 m = 0.48793 mm. With the UDF equation I have that the max velocity is 118.33 mm/s so the time step should be lower than 0.48793/118.33 = 0.004123 s. I take 0.001 s.

    And when I preview it fails at time step 12.

    At time step 11 I get this message:

    Dynamic Mesh Statistics:

    Minimum Volume = 1.10750e-12

    Maximum Volume = 9.44725e-10

    Maximum Cell Skew = 1.00000e+00 (cell zone 2) (it is the interior)

    Warning: maximum cell skewness exceeds 0.95.

    Minimum Orthogonal Quality = 5.57139e-10 (cell zone 2) (interior)

    Warning: minimum orthogonal quality less than 0.05.

    Maximum Face Skew = 9.99545e-01 (face zone 5) (symmetry wall)

    Warning: maximum face skewness exceeds 0.95.

    At time step 12:

    Smoothing partition boundaries...

    WARNING: 2 cells with non-positive volume detected.

    Error at host: Update-Dynamic-Mesh failed. Negative cell volume detected.

    Do you see any mistake? Am I doing something wrong?

    How can I use the Cell Registers to see the cells with negative volume? I read that it is with Filed Variable but it is locked:

    Thank you for your help and attention and sorry for the inconvenience.

  • gowtham326gowtham326 Posts: 2Member

    I think you need atleast 2 elements between your inner and outer wall. You need to initialize first for "field variables" to activate in cell register.

  • MiguelGuerraMiguelGuerra Posts: 9Member

    Hi gowtahm326,

    thanks for your answer. I have prepared this mesh quickly to test your advice.

    I followed the same steps, I got a new minimum lenght scale = 0.00017075 m so the new time step size is 0.00144299. I took 0.0005 s at time step size but it still failed with negative cell volume error at time step 47 (at least it doubled the simulation time). I think you got a point, so I will try to remesh the model with more cells between the walls and reduce the number of elements in the hemispherical part (to reduce the computational cost) while I wait for more answers/help.

    Also, how do I initialize first for "field variables"?

  • YasserSelimaYasserSelima Posts: 944Member

    I agree with @gowtham326 , you need two elements at least .. I would add to this, use diffusion instead of spring under smoothing.

  • gowtham326gowtham326 Posts: 2Member


    Its difficult to tell until you see where the negative cells are. Try these

    1. Before you hit "run calculation" there is "initialization" under "Monitors" section. Choose Hybrid and 10 as no of Iterations. After this you can go to field variables and try,
    2. Under results, go to mesh and create new mesh plane before running calculation. After run your calculation - go back to mesh plane right click and display. This should show where the negative cells are .


  • MiguelGuerraMiguelGuerra Posts: 9Member

    Hi Yasser, I´ve tried this.

    First I changed the geometry by removing the cylindrical internal wall because I think it is better to simulate that part with hexa mesh and layering with an interface mesh with the hemispherical part. So here is the new geometry and mesh I'm trying.

    In the Mesh Method Settings I use this:

    And then I create the Dynamic Mesh Zones:

    For the time step size in Mesh Motion I take 0.0005 s. And it goes great until it almost reach the top because the negative cell volume comes. The piston reaches the top at 0.15 s and it fails at 0.1335 s.

    I think that the error is from this part.

    The exterior wall should dissapear whe the piston reaches top and then appear again when it comes back. Is there a way to make it possible? With layering technique and hexa/prism mesh I did this in other geometry but I don´t how to do this with tetra mesh. For the dynamic mesh zone of the wall I have this.

    Do you have any idea?

    Thank you for your help and attention.

  • YasserSelimaYasserSelima Posts: 944Member

    I am not sure what is wrong ... there is no re-meshing happening! decrease the intervals to 3 or 4 ... hopefully this works

Sign In or Register to comment.