|
[Sponsors] |
March 21, 2005, 21:23 |
UDF and text commands
|
#1 |
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 |
|
March 24, 2005, 13:19 |
Re: UDF and text commands
|
#2 |
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 |
|
June 24, 2022, 15:10 |
|
#3 |
New Member
|
Hello david.It has been many years but if you could guide me I would be very grateful.How would I do the same thing except that read the time dependent values for the average/bulk velocity from a txt file?Could you give a UDF code for that?
Thank you very much. |
|
June 27, 2022, 00:10 |
|
#4 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Quote:
look for DEFINE_PROFILE macro
__________________
best regards ****************************** press LIKE if this message was helpful |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF with output text file | manu | Fluent UDF and Scheme Programming | 18 | December 12, 2018 23:46 |
Suspend iterations from UDF | masins | Fluent UDF and Scheme Programming | 0 | May 20, 2011 05:25 |
my UDF can not calculation? | happyrabbit | FLUENT | 0 | October 21, 2010 09:59 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 11:16 |
UDF interpretation trough TUI | David | FLUENT | 2 | March 18, 2005 15:26 |