Fluids

Fluids

Dynamic Mesh UDF for 3D case using DEFINE_GRID_MOTION

    • bv169
      Subscriber

      Hello,

      I am writing a UDF for dynamic mesh on a face of a domain using DEFINE_GRID_MOTION. The goal is to be able to put in x,y,z coordinates to update each time step that moves the nodes in the z direction (up and down). I have a UDF drafted but when I preview mesh motion it does not change the mesh. The base UDF I used and edited for my use was for a 2D simulation. I thought maybe that it did not work because I am using z coords so I added the #ifdef RP_3D statement before the references to z coords, but it still is not working. The udf compiles and loads without error, but nothing happens when I set preview mesh motion. Is there something else I may be missing here? I have the x,y,z coords as vectors to update each time step and the SET_DEFORMING_THREAD_FLAG to check that nodes need to be updated. Additionally, if there is a simpler way to achieve the goal I am aiming for please let me know! I tried using a profile but don't see a good way to do it this way based on examples I have seen. 

      Thanks,

      Breanna 

    • Rob
      Ansys Employee

      Are you trying to deform something or move a rigid body? More information will help. Otherwise, check whatever triggers the motion is triggered and that the UDF is correctly hooked in: the latter is covered in the documentation. 

    • bv169
      Subscriber

      So I have a flat face on the top of a domain and I am trying to move certain coordinates of the mesh on that face up or down to another certain z coordinate according to a dataset I have. From the tutorials I completed this seems to required the DEFINE_GRID_MOTION UDF. 

       

    • Rob
      Ansys Employee

      That looks OK.  You may need to add in some terms so the solver can find the nearest node to your data set. If you set a precise position and there isn't a node nothing will happen. 

    • bv169
      Subscriber

      Okay I am guessing that's the issue! Is there a specific place in the customization manual I can find these terms to add? Thanks!

    • Rob
      Ansys Employee

      Possibly here?  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v222/en/flu_udf/flu_udf_DataAccessMacros.html%23flu_udf_GridNodeMacros 

Viewing 5 reply threads
  • You must be logged in to reply to this topic.