Udf dpm error
1 Attachment(s)
Dear All,
I am new with UDF in Fluent, I have tried to understand UDF Manual from ANSYS, but I am still cannot solve this problem. I provide part of my code which has error below.... and I attach the error shown in Fluent in the attachment .... .... .... Thread *tcell; *tcell=P_CELL_THREAD(p); cell_t c=P_CELL(p); Best Regards, Yannapol S. |
Hi,
You don't need the * in front of the second line: Also, I would group all declarations first, and group steps where you set values later. so: Code:
Thread *tcell; |
Hi, CeesH
Thanks for your quickly reply. Unfortunately, I did it, then the same error is still appear. error C2275: 'Thread' : illegal use of this type as an expression error C2065: 'tcell' : undeclared identifier error C2275: 'cell_t' : illegal use of this type as an expression |
What is the rest of your UDF and are you compiling the UDF correctly? Have a read of my compiling process for Fluent UDFs with an existing library loaded.
|
Dear 'e',
You mentioned that it should have 5 steps for compiling Normally, for the simple code(code from UDF Manual), I think I am able to compile completely without step 1) and 2). Anyway, I check the my UDF library Manager(Define > User-Defined > Functions > Manage...). It is blank !!! Is it necessary to do step 1) and 2) for compiling UDF ? if yes, What should I do to make the existing library appear ? Best Regards, Yannapol S. |
The first two steps are there if you already have a compiled UDF which I assume is the case if you're modifying an existing UDF. What is your UDF?
|
Code (only Error part)
1 Attachment(s)
Dear All,
i provide code in this Reply |
Dear 'e',
I provide part of my code in new reply, please help Best Regards, YannapoL S. |
I see a few questionable things;
- You make a couple of declarations outside of the function body (namely Code:
real ParticleTotalMass; - your declaration section is very messy and this can give problems. For example: Code:
FILE *fp;* - if you use #if loops, make sure they are closed with #endif. If you use if loops, use if{} to mark the extent of the loop. Also use for(...){} - always use brackets to mark what is included in the loop. - Code:
idim = dim; Maybe there's more, but I can't check all lines for you... I'd advice you to take a good look at the script, section it to be more readable, and make sure all loops and functions are properly closed. Do not do anything outside the function body, except of course the macro definitions and include statements. |
All times are GMT -4. The time now is 23:12. |