Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

If-Statement for UDF

    • Max4
      Subscriber

      Hi,


      I´m trying to write an UDF for porous media which depends on time. So I have used an If-Statement, but an error occurs.




      Is it necessary to have an else-statement after if? If yes, what should I write for the else? that the "source" is zero?



      Regards,


      Maxime

    • Amine Ben Hadj Ali
      Ansys Employee

      You need to put the if statement inside the the DEFINE... macros.

    • Max4
      Subscriber

      Before defining the variables? Then I have to do one for each macro, I guess. I have tried this, but it doesn´t work.




      Regards,


      Maxime

    • Amine Ben Hadj Ali
      Ansys Employee

      First of all that would not work using (rpgetvar..) that is now C and not Scheme. You need to use the macros CURRENT_TIME or RP_Get_Real("flow-time").


      No further debugging will be provided here.

Viewing 3 reply threads
  • The topic ‘If-Statement for UDF’ is closed to new replies.
[bingo_chatbox]