Ansys Free Student Software

Ansys Free Student Software

P_USER_REAL: undeclared variable ERROR

    • Dana Moses
      Subscriber

      hi!

      Im writing a UDF and getting this error-

      P_USER_REAL: undeclared variable

      this is the UDF:

      include "udf.h"
      #include "dpm.h"

      DEFINE_DPM_SCALAR_UPDATE(boron_scalar, c, t, initialize, p)
      {
          if (initialize)
          {
              P_USER_REAL(p,0)=0.1;
          }
          else
          {
              P_USER_REAL(p,0)=P_USER_REAL(p,0);
          }
      }

       

      I already activeted the discreat phase model and define Number of scalars as "1" in User Variables in the discreat phase model tab.
      Asking kindly for any help!

       

    • Rob
      Ansys Employee

      Is it a real, integer, array etc? 

    • Dana Moses
      Subscriber

      p_user_real is a macro - "Particle values can be stored in an array associated with the Tracked_Particle (accessed with the macro P_USER_REAL(p,i))" (from Fluent UDF manual)

    • Rob
      Ansys Employee

      You sure about that?  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf.html  

    • Dana Moses
      Subscriber

      yes :)

      Unfortunatly I cant access the link you attached for some reason - can you elaborate?

    • Rob
      Ansys Employee

      Are you REALLY sure?  

      Click on Help in Fluent and have a look for  DEFINE_DPM_SCALAR   There's a very good reason we don't like third party copies of the documentation, not just copyright. 

    • Dana Moses
      Subscriber

      I sure understand. can you guide me to where Help is in fluent softwhere? I'm afraid I don't know where to look :)

    • Rob
      Ansys Employee

      Open any panel in the Fluent software, and look for the button towards the bottom left of that panel. It's labelled as "Help" to guide you! :)   You may want to look into the Learning section on here, and in Fluids you'll find some courses on how to use Fluent: do those and then the tutorials you'll find in the Help system. 

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