We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Implementing Python UDF in Fluent 2025 R1

    • s.sethuraman
      Subscriber

      Hi, 

      I have a question regarding writing and implementing UDFs for Fluent in Python. I understand that it is only available in the Beta Feature in 2025R1. But I have a hard time implementing them. 

      The Link (33.1. Fluent GPU Solver Beta Features) explains how to implement them and since they are in beta version, you can only use TUI command. I used this command (

      (rpsetvar 'gpuapp/python-udf-files '("myudf.py"))

      ) with my UDF. I think the scheme command hooks my UDF, but the UDF is never implemented during iteration. With the above command, I don't encounter any errors either. So, I think there is no error in UDF.py. But Fluent silently ignores the UDF?

      In addition, I observed that only a handful of functions are currently available in Python UDF (Table 33.5: Supported Hookup Functions). I cannot seem to find any relevant function which is equivalent to DEFINE_NET_REACTION_RATE (name, c, t, particle, pressure, temp, yi, rr, jac) in C UDFs. 

      If anyone has experience in handling the above two issues, please let me know. 

      Any suggestion is highly helpful. :)

      Thank you!

    • Rob
      Forum Moderator

      As it's a beta feature there's a good chance it's not fully functional. Additionally, the gpu solver hasn't (yet) got all of the additional models available: so the chemistry UDFs may simply not be available (yet). 

      What is your UDF trying to do? 

    • s.sethuraman
      Subscriber

      Hi, Rob. 

      The main purpose of the UDF is to define net reaction rate for every species in the model. As premilinary test, I was trying a Python UDF to perform logging of velocity components, but it did not work as I expected. The model case is fairly simple - Laminar Combustion.

      I guess I could perform the same in C. But I wanted to implement it in Python since my Custom Chemistry Calculation program is in Python. 

      Thanks in advance!

    • Rob
      Forum Moderator

      I suspect that's not available in the gpu solver at present. The fact you needed a rpsetvar to switch something on generally means it's not quite ready. 

    • Rob
      Forum Moderator

      And for once the person I needed was in the same time zone and available. It's not quite there yet: keep watching the release notes as it's a rapidly evolving solver. 

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