CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Udf dpm error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2015, 05:04
Default Udf dpm error
  #1
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12
YANNAPOL is on a distinguished road
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.
Attached Images
File Type: jpg Error Show.jpg (32.9 KB, 23 views)
YANNAPOL is offline   Reply With Quote

Old   April 8, 2015, 05:13
Default
  #2
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
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);
CeesH is offline   Reply With Quote

Old   April 8, 2015, 05:19
Default
  #3
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12
YANNAPOL is on a distinguished road
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
YANNAPOL is offline   Reply With Quote

Old   April 8, 2015, 05:38
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   April 8, 2015, 06:09
Default
  #5
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12
YANNAPOL is on a distinguished road
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.
YANNAPOL is offline   Reply With Quote

Old   April 8, 2015, 06:17
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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?
`e` is offline   Reply With Quote

Old   April 8, 2015, 06:27
Default Code (only Error part)
  #7
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12
YANNAPOL is on a distinguished road
Dear All,

i provide code in this Reply
Attached Files
File Type: c Test_ParticleDeposition.c (3.2 KB, 20 views)
YANNAPOL is offline   Reply With Quote

Old   April 8, 2015, 06:28
Default
  #8
Member
 
YANNAPOL SRIPHUTKIAT
Join Date: Sep 2014
Posts: 43
Rep Power: 12
YANNAPOL is on a distinguished road
Dear 'e',

I provide part of my code in new reply, please help

Best Regards,
YannapoL S.
YANNAPOL is offline   Reply With Quote

Old   April 8, 2015, 07:03
Default
  #9
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
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 loops are not properly closed, make sure every { is matched with a } at the appropriate place

- your declaration section is very messy and this can give problems. For example:
Code:
FILE *fp;*

Thread *tcell;
is not a correct statement

- 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;
,but dim is undeclared.


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.
CeesH is offline   Reply With Quote

Reply

Tags
dpm fluent, fluent - udf, fluent 14 to fluent 15., udf code, udf dpm


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 15:59.