Fluids

Fluids

“time” not changing DEFINE_GRID_MOTION for 3D flexible body

    • Nida
      Subscriber

      Hi Sir,


      I am writing UDF for 3D heart shape and using DEFINE_GRID_MOTION macro.


      I checked it through mesh preview up to 100 Numbers Of Time Steps by taking Time Step Size 0.001


      "CURRENT_TIME" and "time" is not varying that I am displaying in console. CURRENT_Time is always "0" and time is "0.001". Also dtime still remains on 0.001.


      You do not debug UDF that's why I am not sharing here.


      Do you have any idea that what is the reason that "CURRENT_TIME" and "time" and "dtime" is not varying.


      Thank you!


       

    • DrAmine
      Ansys Employee

      Are you using transient solver? 

    • Nida
      Subscriber

      Yes Sir, It is "transient". That's why "Mesh Preview Motion" is enable.


      What I am getting on console is just showing x, y, z coordinates again and again.


      It runs 100 times but "CURRENT_TIME" and "time" is repeating same value.


      That's why grid is not moving

    • DrAmine
      Ansys Employee

      How are you printing the current time? Please add the lines showing that.

    • Nida
      Subscriber

      }/*end f_node_loop*/


       


      Update_Face_Metrics(f, tf);


      printf("CURRENT_TIME=%g, time=%g, dtime=%g , vol=%g, aa=%g, a=%g, c=%g, x=%g, y=%g, z=%g, xnew=%g, ynew=%g, znew=%g, zz=%g, theta=%g, phai=%gn", CURRENT_TIME, time, dtime, vol, aa, a, c, x, y, z, xnew, ynew, znew, zz, theta, phai);


      }


       


      end_f_loop(f, tf)


       


      Sir, This is the print command before ending face loop and after ending node loop

    • DrAmine
      Ansys Employee

      Does a simple DEFINE_ON_DEMAND print the correct Current time and time step?

    • Nida
      Subscriber

      Sir, I just tried to print this.


      #include "udf.h"


      DEFINE_ON_DEMAND(demand)


      {


      Message("%gn", CURRENT_TIME);


      }


      It is just printing "0", two times, when I press Execute on Demand.


      I could not understand how to print time as it is not provided as input.


       


      Moreover, I checked Mesh preview motion without providing any UDF and it is printing this.


      Updating mesh to time 1.00000e-03 (step = 00001)...


      No mesh motion in domain!


       


      done.


      Updating mesh to time 2.00000e-03 (step = 00002)...


      No mesh motion in domain!


       


      done.


      Updating mesh to time 3.00000e-03 (step = 00003)...


      No mesh motion in domain!


       


      done.


      Updating mesh to time 4.00000e-03 (step = 00004)...


      No mesh motion in domain!


       


      done.


      Updating mesh to time 5.00000e-03 (step = 00005)...


      No mesh motion in domain!


       


       


      done.

    • aCVP
      Subscriber
      Hi, I am having the exact same problem. My UDF used to work on my old computer with ANSYS. I have since moved to a new computer (But same version of ANSYS) and am having this EXACT problem. Any ideas? Thanks in advance.n
    • Rob
      Ansys Employee
      Does the UDF compile on the new computer? n
Viewing 8 reply threads
  • You must be logged in to reply to this topic.