# question about writing an udf

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

 January 13, 2005, 04:27 question about writing an udf #1 Denitiu Marian Guest   Posts: n/a I'm trying to write an udf, to simulate a periodic flow through a geometry composed of a center cilinder, and three pipes which all comunicate with the central cilinder. They are placed at 120 degrees apart from each other. At a certain time, through one of the pipes, I have fluid coming inside the geometry, and through the other two, the fluid is coming out. I'm not really interested about the time variation, but I want the principle of the thing explained to me. Here is what I wrote. It is based ont the oscilating pressure udf, found on the Fluent documentation disk. / #include "udf.h" DEFINE_PROFILE(unsteady_pressure, thread, position) { float t, pressure; face_t f; float x,M; begin_f_loop(f, thread) { t = RP_Get_Real("flow-time"); x=(t/1.5); M=t-1.5*x; if ((M>0) && (M<0.5)) { pressure = (0.12*sin(1748.8*t)+0.737)*101325.0; } else M=0; if ((M>0.5) && (M<1) { pressure = (0.12*sin(1748.8*t)+0.737)*101325.0; } else M=0; if ((M>1) && (M<1.5)) { pressure = (0.12*sin(1748.8*t)+0.737)*101325.0; } else M=0; F_PROFILE(f, thread, position) = pressure; } end_f_loop(f, thread) } When I try to compile it, I receive: Error: c:\fluent.inc\pexit1.c: line 36: parse error. Error: c:\fluent.inc\pexit1.c: line 39: parse error. Error: c:\fluent.inc\pexit1.c: line 49: parse error. Any ideas?

 January 13, 2005, 06:19 Re: question about writing an udf #2 Andrew Garrard Guest   Posts: n/a You will never get to the second two if ... else statements. When M is assigned a value in then enters the first if else. if it is between 0 and 0.5 it changes pressure. if not M becomes 0. This means that it won't enterd the remaining two if else statements.

 January 14, 2005, 07:28 Re: question about writing an udf #3 wanghong Guest   Posts: n/a try to put your udf on your computer table,perhaps "parse error" will not appear again.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Cantstandit Fluent UDF and Scheme Programming 5 September 20, 2010 20:30 Sandilya FLUENT 0 May 31, 2007 12:03 Claud FLUENT 1 April 10, 2007 17:02 owet.L FLUENT 4 December 20, 2005 04:19 Tango FLUENT 1 November 27, 2003 03:56

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