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

problem with UDF for a pressure BC

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 4, 2011, 05:41
Default problem with UDF for a pressure BC
  #1
New Member
 
Sylvain Arnaud
Join Date: Aug 2011
Posts: 2
Rep Power: 0
sarnaud42 is on a distinguished road
Hi

I have created a file for pressure BC at the outlet depending on mass flow rate. The UDF.c is as shown below. During intepreting by Fluent 6.3, it has a syntax error at line 2. However, I don't find anything wrong with line 2. Anyone out there see the source of this syntax error, please help thanks

#include "udf.h"
DEFINE_PROFILE(pressure-chem1, thread, position) /*line2*/
{
float pressure1;
float debit;
face_t f;
pressure1 = 0.000001;
begin_f_loop(f,thread);
{
debit=debit+F_FLUX(f,thread);
}
end_f_loop(f,thread);
pressure1 = debit*6.25-5.0;
begin_f_loop(f,thread);
{
F_PROFILE(f, thread, position)=pressure1;
}
end_f_loop(f,thread);
}

Last edited by sarnaud42; August 4, 2011 at 06:26.
sarnaud42 is offline   Reply With Quote

Old   August 5, 2011, 01:16
Default
  #2
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 109
Rep Power: 8
gearboy is on a distinguished road
Quote:
Originally Posted by sarnaud42 View Post
Hi

I have created a file for pressure BC at the outlet depending on mass flow rate. The UDF.c is as shown below. During intepreting by Fluent 6.3, it has a syntax error at line 2. However, I don't find anything wrong with line 2. Anyone out there see the source of this syntax error, please help thanks

#include "udf.h"
DEFINE_PROFILE(pressure-chem1, thread, position) /*line2*/
{
float pressure1;
float debit;
face_t f;
pressure1 = 0.000001;
begin_f_loop(f,thread);
{
debit=debit+F_FLUX(f,thread);
}
end_f_loop(f,thread);
pressure1 = debit*6.25-5.0;
begin_f_loop(f,thread);
{
F_PROFILE(f, thread, position)=pressure1;
}
end_f_loop(f,thread);
}
try changing pressure-chem1 to pressure_chem1
gearboy is offline   Reply With Quote

Old   August 8, 2011, 03:25
Default Thanks a lot Gearboy !
  #3
New Member
 
Sylvain Arnaud
Join Date: Aug 2011
Posts: 2
Rep Power: 0
sarnaud42 is on a distinguished road
I thought it was only a problem with my text editor encoding.
sarnaud42 is offline   Reply With Quote

Old   August 9, 2011, 10:47
Default
  #4
Member
 
pranab_jha's Avatar
 
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 8
pranab_jha is on a distinguished road
Quote:
Originally Posted by sarnaud42 View Post
I thought it was only a problem with my text editor encoding.
Did that solve your problem?
Sometimes, unix platforms do not accept files built in editors like wordpad (windows). Try a unix based editor.
pranab_jha 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
Static pressure problem Kiat110616 CFX 0 April 12, 2011 13:11
UDF to control Static Pressure (in cylinder) James FLUENT 0 July 20, 2004 07:54
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 22:02
Fluent 5.2, UDF and Pressure BC's Alfonso Ferrandez FLUENT 0 May 4, 2000 07:02
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


All times are GMT -4. The time now is 11:09.