CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF and text commands

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 21, 2005, 21:23
Default UDF and text commands
  #1
David
Guest
 
Posts: n/a
Hi CFD community,

I have written a UDF for an unsteady (parabolic profile) inlet velocity. I am having problems assigning the UDF at the velocity inlet when using text commands although the UDF has been interpreted successfully (no problems encountered when using GUI).

Below I have copied part of the transcript file. Look closely to the definition of the velocity inlet condition. More precisely:

profile name [""] "square_wave"

data name [""] "square_wave"

where square_wave is the name of my UDF.

1) Am I doing something wrong? (See Transcript File below).

2) Are boundary profile files an option? Can they be used to specify time and position dependent profiles (such as a parabolic profile with time-varying bulk velocity)?

/*Partial Transcript File*/

> /define/user-defined/interpreted-functions UDF Source File Name [""] "c:libudfsquare_wave0.c"

CPP Command Name ["cpp"] "cpp"

virtual machine stack size [10000] 10000

display assembly code listing? [no] no

cpp -IC:\FLUENT.INC\fluent6.1.22/src -IC:\FLUENT.INC\fluent6.1.22/cortex/src -IC:\FLUENT.INC\fluent6.1.22/client/src -IC:\FLUENT.INC\fluent6.1.22/multiport/src -I. -DUDFCONFIG_H="" c:\libudf\square_wave0.c

/define/boundary-conditions/velocity-inlet (velocity_inlet.11)

zone id/name [velocity_inlet.11] 3

Velocity Specification Method: Magnitude and Direction [no] no

Velocity Specification Method: Components [no] yes

Reference Frame: Absolute [yes] yes

Use Profile for X-Velocity? [no] yes

profile name [""] "square_wave"

data name [""] "square_wave"

The UDF that I would like to use is as follows. But again I do not think the problem lies there has Fluent interprets it successfully:

#include "udf.h" DEFINE_PROFILE (square_wave,thread,position)

{ #define PI 3.14159 real x[ND_ND]; face_t f; real z,y,test; z=CURRENT_TIME;

if (z<0.30) test =0; else if (z<0.70) test=2*sin(2.5*PI*z-2.3562); else if (z<1.3) test=0;

else

test=0;

begin_f_loop(f, thread)

{ F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,position) = test - y*y/(.0065*.0065)*test; } end_f_loop(f, thread) }

Thanking your in advance for you time

David

  Reply With Quote

Old   March 24, 2005, 13:19
Default Re: UDF and text commands
  #2
david
Guest
 
Posts: n/a
Hi, I figured it out so no need to reply. To solve my problem I typed the following when prompted:

profile name [""] "udf"

data name [""] "square_wave"

Regards

  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
UDF with output text file manu Fluent UDF and Scheme Programming 6 April 24, 2013 02:46
Suspend iterations from UDF masins Fluent UDF and Scheme Programming 0 May 20, 2011 04:25
my UDF can not calculation? happyrabbit FLUENT 0 October 21, 2010 08:59
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10:16
UDF interpretation trough TUI David FLUENT 2 March 18, 2005 15:26


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