CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   (DPM) Names for User Scalars (instead of Use Variable 0)? (https://www.cfd-online.com/Forums/fluent-udf/75241-dpm-names-user-scalars-instead-use-variable-0-a.html)

sega April 20, 2010 07:27

(DPM) Names for User Scalars (instead of Use Variable 0)?
 
Hello World.

I'm using a total number of 41 User Defined Scalars in my DPM-Iteration.

Is there a way to give these variables some other names than "User Variable 0" or "User Variable 23"?


This would be very usefull for (first) the distinction and (second) for the plots I'm plotting.

Any ideas?

coglione April 20, 2010 07:51

hi sega,
there is a macro called Set_User_Scalar_Name. Have a look in UDF-Manual chapter 3.2.8.
cheers

sega April 20, 2010 08:09

Quote:

Originally Posted by coglione (Post 255426)
hi sega,
there is a macro called Set_User_Scalar_Name. Have a look in UDF-Manual chapter 3.2.8.
cheers

Hm, looks like this macro works only for "real" User Defined Scalars (UDS).
I'm just using user variables from within the DPM-Model I access with
Code:

P_USER_REAL(p,i)
I think this is not the same.

coglione April 20, 2010 08:33

I don't know, you have to try it out. However, if your intention is to make your code more readable for yourself, you might use enum to correlate a name with a specific index like this:

enum
{
myscalar
yourscalar
...
}
P_USER_REAL(p,myscalar) would then be equivalent to P_USER_REAL(p,0)

cheers


All times are GMT -4. The time now is 07:49.