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/)
-   -   Error in UDF DPM (https://www.cfd-online.com/Forums/fluent-udf/153362-error-udf-dpm.html)

YANNAPOL May 24, 2015 08:51

Error in UDF DPM
 
3 Attachment(s)
Dear All,

I have been facing this kind of problem for so long long time.

I use exactly the same declaration and function as tutorial, but i do not why I get this error (Attachment 1: Error)

I also attach the code in that line (Attachment 2: Line 109-111)
Anyone please advise

Best Regards,
Yannapol S.

`e` May 24, 2015 18:29

Variables need to be declared at the start of a code block for the programming language ANSI C (which Fluent UDFs are coded with). What is the tutorial you are following, and how have they declared their thread pointers?

YANNAPOL May 25, 2015 00:34

Dear e,

Thank you for your reply

i followed the tutorial http://148.204.81.206/Ansys/150/ANSY...F%20Manual.pdf

"2.5.5.3. Example" PAGE 167


I will attach the code in C language for your convenience in the main thread
It was declared ...

Thread *t0 = P_CELL_THREAD(p); LINE 17

I am very new with this, I may miss something. Please advise

`e` May 25, 2015 01:19

Quote:

Originally Posted by `e` (Post 547515)
Variables need to be declared at the start of a code block for the programming language ANSI C (which Fluent UDFs are coded with).

The UDF manual correctly declares the thread pointer (and also initialises this pointer with P_CELL_THREAD(p)) at the start of a code block (after an opening curly bracket). You should follow this rule in your code, specifically: move "Thread *t0;" up with your other variable declarations.


All times are GMT -4. The time now is 13:12.