|
[Sponsors] |
April 8, 2015, 05:04 |
Udf dpm error
|
#1 |
Member
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12 |
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. |
|
April 8, 2015, 05:13 |
|
#2 |
Senior Member
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0 |
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; cell_t c=P_CELL(p); tcell=P_CELL_THREAD(p); |
|
April 8, 2015, 05:19 |
|
#3 |
Member
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12 |
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 |
|
April 8, 2015, 05:38 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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.
|
|
April 8, 2015, 06:09 |
|
#5 |
Member
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12 |
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. |
|
April 8, 2015, 06:17 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
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?
|
|
April 8, 2015, 06:27 |
Code (only Error part)
|
#7 |
Member
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12 |
Dear All,
i provide code in this Reply |
|
April 8, 2015, 06:28 |
|
#8 |
Member
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12 |
Dear 'e',
I provide part of my code in new reply, please help Best Regards, YannapoL S. |
|
April 8, 2015, 07:03 |
|
#9 |
Senior Member
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0 |
I see a few questionable things;
- You make a couple of declarations outside of the function body (namely Code:
real ParticleTotalMass; real P_Mass[6]; real P_Impact_Mass[6]; real P_Stick_Mass[6]; Domain *domain; /*Get domain pointer and assign later to domain*/ - your declaration section is very messy and this can give problems. For example: Code:
FILE *fp;* Thread *tcell; - 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. |
|
Tags |
dpm fluent, fluent - udf, fluent 14 to fluent 15., udf code, udf dpm |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 14:21 |
[OpenFOAM] an error in Calculator's equation | immortality | ParaView | 12 | June 29, 2021 01:10 |
Pressure outlet boundary condition | rolando | OpenFOAM Running, Solving & CFD | 62 | September 18, 2017 07:45 |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 08:11 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |