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

problem with UDF for a pressure BC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2011, 06: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 07:26.
sarnaud42 is offline   Reply With Quote

Old   August 5, 2011, 02:16
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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, 04: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, 11:47
Default
  #4
Member
 
pranab_jha's Avatar
 
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 17
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


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
Static pressure problem Kiat110616 CFX 0 April 12, 2011 14:11
UDF to control Static Pressure (in cylinder) James FLUENT 0 July 20, 2004 08:54
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 23:02
Fluent 5.2, UDF and Pressure BC's Alfonso Ferrandez FLUENT 0 May 4, 2000 08: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 22:08.