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

Udf problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 6, 2012, 06:56
Question Udf problem
  #1
New Member
 
JEEE
Join Date: Nov 2011
Posts: 7
Rep Power: 5
alexsatan is on a distinguished road
HI,ALL

I am doing a simulation about two phases--air and water. I use dpm to interact with water , if i do nothing about DPM, DPM will interact with air phase, so I want to use UDF to remove DPM when it reach into air phase, here I write a UDF, when I interpreted it in Fluent, an error"undeclared variable" come out, and I donnot know why. Can anybody tell me ?

here is the UDF:

# include "udf.h"
# include "dpm.h"
DEFINE_DPM_SCALAR_UPDATE (reDPM,c,t,in,p)
{
cell_t c;
real vof_g = C_VOF (c,pt[0]);

if (vof_g>=0.1)
p->reDPM=-1;
else
return vof_g;
}
alexsatan is offline   Reply With Quote

Old   October 6, 2012, 07:25
Default
  #2
Member
 
sadjad.s's Avatar
 
sadjad
Join Date: Jan 2012
Posts: 60
Rep Power: 5
sadjad.s is on a distinguished road
Send a message via Yahoo to sadjad.s
hi.
first, the 4th line is extra, because cell identifer "c" has been defined by second argument.
second you should define pt as a phase pointer variable (ie "Thread **pt;")
sadjad.s is offline   Reply With Quote

Old   October 7, 2012, 05:37
Default
  #3
New Member
 
JEEE
Join Date: Nov 2011
Posts: 7
Rep Power: 5
alexsatan is on a distinguished road
Quote:
Originally Posted by sadjad.s View Post
hi.
first, the 4th line is extra, because cell identifer "c" has been defined by second argument.
second you should define pt as a phase pointer variable (ie "Thread **pt;")
hi:

I modified the UDF ,but there still is a error"line 5,parse error"

here is the UDF:

# include "udf.h"
# include "dpm.h"
DEFINE_DPM_SCALAR_UPDATE (reDPM,c,t,in,p)
{
Thread **pt;
real vof_g = C_VOF (c,pt[0]);

if (vof_g>=0.1)
p-> reDPM = -1;
else
return vof_g;
}
alexsatan is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 01:31
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


All times are GMT -4. The time now is 00:44.