Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF for time-dependent outlet pressure profile

    • Joe
      Subscriber

      Hi

      I would like to specify the outlet boundary pressure profile using a text file for each time step where each text file specifies the pressure at each cell. 

      I have written the attached UDF but it gives the incorrect answer on initialization (though it does compile and load OK). It definitely acknowledges the values in the text file, as they change on the initialization when I change the text file. However, the values it reads are of no obvious relationship to the values in the text file (and of significantly lower magnitude). Once I run the simulation, I get a SIGSEGV mpt accept error. I think there are issues with my UDF but I'm new to them so I would appreciate any advice (I know you can't directly edit). 

      Thanks. 

    • Rob
      Forum Moderator

      Settting a single pressure value with time wouldn't need the files. Setting a boundary using a file would need you to loop over and interpolate the contents of the file to the boundary: it's not as simple as giving the file x, y, z & pressure. 

      What are you trying to mimic? 

    • Joe
      Subscriber

      Sorry for the confusion. I would like to specify the full pressure profile on the boundary, not just a single value. 

      Preferably, I want to try and avoid doing interpolation inside the solver to reduce the compute time (and so that I'm sure of the interpolation method). I'm happy to do my own interpolation so that the file I read in will have the exact data for each cell. Then I hope to organise the data in such a way that it is in the same order as the cells are stored in Fluent.

    • Rob
      Forum Moderator

      You may be better off using profiles and a journal to update the profile & boundary condition every some time steps. Much less complex and the solver will interpolate the profile file automatically. 

    • Joe
      Subscriber

      Would this not be extremely slow since I need to update the profile at every time step? 

    • Rob
      Forum Moderator

      If you need to update the boundary that frequently then you won't be any better off using a UDF. Does the boundary value change that often to need updating at the resolved flow timescale? 

    • Joe
      Subscriber

      Unfortunately yes. I'm trying to simulate a spinning acoustic mode at the outlet so the whole profile must vary with each timestep.

    • Rob
      Forum Moderator

      And you want to update the profile every micro second? 

    • Joe
      Subscriber

      Yes - the time step size is in the region of 1e-5 seconds, and the profile changes at each time step. 

    • Rob
      Forum Moderator

      I'm not convinced that's going to work well with the solver in the event of the revised boundary not matching what the solver thinks should be going on: ie you could create a feedback instability. UDF or profiles will work, but you may find it easier to model the next bit too. 

Viewing 9 reply threads
  • The topic ‘UDF for time-dependent outlet pressure profile’ is closed to new replies.