I have written a UDF as below: no problem in compiling but when i run Fluent, there is an error message,
real TT = RP_Get_Real("T-ref");
d = Get_Domain(1);
t = Lookup_Thread(d,3);
q = WALL_HEAT_FLUX(f,t); /* gets the TOTAL Heat flux vector at the surface */
q_t = q / NV_MAG(A);
T_W = F_T(f,t);
htc = ABS(q_t / (T_W - TT));
C_UDMI(F_C0(f,t),THREAD_T0(t),0) = q_t;
C_UDMI(F_C0(f,t),THREAD_T0(t),1) = htc;
The following error message appears:
Error: rpgetvar: T-ref: undefined variable
Error Object: ()
I have already defined T-ref using
(if (not (rp-var-object ‘T-ref))(rp-var-define ‘T-ref 290 ‘real #f)) in TUI so I think there should be no problems!
I will appreciate if you can help me resolve this problem,
That means the scheme variable "T-ref" has not been defined.
I believe the sentence RP_Get_Real("T-ref") is to get the reference temperature, commonly, 298.15K. If the scheme variable is not defined in your system, you can also use
real TT = T_REF;
to get the reference temperature.
Actually I don't understand you point "if the scheme variable is not defined in yor system".
As you mentioned there is no problem when i write TT=T-ref. But i need to change this value frequently and that's why i have to use rp- var-define.
Is there any solution?
Have you tried gearboy's recommendation above? Otherwise, you could hard code the reference temperature into your script, T_reference = 298.15; or similar.
Worth a try: avoid capital letters in scheme.
So not "T-ref", but "t-ref".
|All times are GMT -4. The time now is 20:42.|