Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

How to create variables for use during solution at beginning of simulation?

    • ansysuser
      Subscriber

      Hello,


       


      I am running a simulation in Fluent and I need to use DEFINE_GRID_MOTION in my UDF. I want to be able to access some variables that are stored in an external file. I was able to make Fluent read the external file from within a UDF, but this is slow because Fluent passes the same nodes to the UDF many times during each time step and so all this IO is time-consuming.  Is there a way to run one UDF to load some variables that are stored in an external file once at the beginning of the solution so that they are available when the UDF is called during the simulation?

      So to be clear, I want to be able to load some variables (vectors) from an external file at initialization or during the first time step only, then have these variables available to the solver and the DEFINE_GRID_MOTION during all subsequent time steps so I am not constantly loading the variables for each time the solver calls the UDF.  How can I accomplish this?


       


      Thanks!

    • Rob
      Ansys Employee

      You may be able to use a DEFINE_ON_DEMAND or DEFINE_ADJUST and User Defined Memory. Not sure how that will work with the moving mesh though; won't the vectors change? 

    • ansysuser
      Subscriber

      I was able to make it work by using the former.  I tried to post solution yesterday but the site was down.


       


      Thanks for confirming!

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