# Unsteady udf, velocity step

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 5, 2005, 04:02 Unsteady udf, velocity step #1 CJ Guest   Posts: n/a Is it possible to write a unsteady udf such that: t<2 velocity=20 t>2 velocity=30 I have used this sinusoidal function previously (below), but would like to have a simple step change as above DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; begin_f_loop(f, thread) { real t = RP_Get_Real("flow-time"); F_PROFILE(f, thread, position) = 25. + 5.0*sin(10.*t); } end_f_loop(f, thread) }

 April 5, 2005, 09:36 Re: Unsteady udf, velocity step, more help pls! #2 CJ Guest   Posts: n/a I have this error: cpp -IC:\FLUENT.INC\fluent6.0/src -IC:\FLUENT.INC\fluent6.0/cortex/src -IC:\FLUENT.INC\fluent6.0/client/src -IC:\FLUENT.INC\fluent6.0/multiport/src -I. -DUDFCONFIG_H="" time.cError: time.c: line 13: parse error. with this program: #include "udf.h" DEFINE_PROFILE(unsteady, thread, position) { face_t f; begin_f_loop(f, thread) { real t = RP_Get_Real("flow-time"); if (t < 2) F_PROFILE(f, thread, position) = 50 else F_PROFILE(f, thread, position) = 20 } end_f_loop(f, thread) } can anyone please help and point out any obvious mistakes, or if this is even possible?

 April 5, 2005, 10:23 Re: Unsteady udf, velocity step, more help pls! #3 swarup Guest   Posts: n/a CJ, Try this. This will work. DEFINE_PROFILE(unsteady_pressure,thread,position) { face_t f; real t=CURRENT_TIME; begin_f_loop(f,thread) { if(t<2) F_PROFILE(f,thread,position)=50.0; else F_PROFILE(f,thread,position)=20.0; } end_f_loop(f,thread) }

 April 5, 2005, 16:23 Re: Unsteady udf, velocity step, more help pls! #4 CJ Guest   Posts: n/a Thankyou for your help, and it certainly seems to be closer, but i now get this error: cpp -IC:\FLUENT.INC\fluent6.0/src -IC:\FLUENT.INC\fluent6.0/cortex/src -IC:\FLUENT.INC\fluent6.0/client/src -IC:\FLUENT.INC\fluent6.0/multiport/src -I. -DUDFCONFIG_H="" time3.cError: time3.c: line 6: CURRENT_TIME: undeclared variable i have tried numerous ways to sort it but none seem to work. any more advice please?

 April 5, 2005, 16:26 Re: Unsteady udf, velocity step, more help pls! #5 CJ Guest   Posts: n/a Sorry, this is what generated the error: #include "udf.h" DEFINE_PROFILE(unsteady_pressure, thread, position) { face_t f; real t = current_time; begin_f_loop(f, thread) { if(t<2) F_PROFILE(f, thread, position) = 50.0; else F_PROFILE(f, thread, position) = 20.0; } end_f_loop(f, thread) }

 April 6, 2005, 10:14 Re: Unsteady udf, velocity step, more help pls! #6 swarup Guest   Posts: n/a CJ, i have tried this UDF earlier in connexion with unsteady pressure. that's why the UDF name is unsteady_pressure. we have to use CURRENT_TIME and not current_time. hope this will resolve. Swarup.

 April 7, 2005, 03:51 Re: Unsteady udf, velocity step, more help pls! #7 CJ Guest   Posts: n/a It just says this instead: cpp -IC:\FLUENT.INC\fluent6.0/src -IC:\FLUENT.INC\fluent6.0/cortex/src -IC:\FLUENT.INC\fluent6.0/client/src -IC:\FLUENT.INC\fluent6.0/multiport/src -I. -DUDFCONFIG_H="" time3.cError: time3.c: line 6: CURRENT_TIME: undeclared variable Im not sure of the problem if yours works but mine does not. Different versions of Fluent (I have 6.0)?

 April 7, 2005, 04:44 Re: Unsteady udf, velocity step, more help pls! #8 Luca Guest   Posts: n/a CURRENT_TIME is not avaiable in Fluent 6.0. Try with RP_Get_Real("flow-time").

 April 7, 2005, 11:08 Re: Unsteady udf, velocity step #9 ram Guest   Posts: n/a

 April 8, 2005, 03:15 Re: Unsteady udf, velocity step, more help pls! #10 CJ Guest   Posts: n/a At last, it works! Thanks everyone.

 April 8, 2005, 04:20 Re: Unsteady udf, velocity step, more help pls! #11 pUl| Guest   Posts: n/a Sounds good, However, one word of caution for others who may be writing udfs to incorporate models. Just because a UDF compiles fine and fluent seems to have no problems accomodating it, one should not assume that the UDF is correct. The best way to confirm is to test and check whether the UDF is really doing what you want it to do. For instance, if you are writing a custom drag model, start by trying to write the schiller-naumann law in a UDF (which is already implemented in fluent) so that you can compare the results and check for yourself. All the Best! Best Regards, Srinath Madhavan

 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 CKH OpenFOAM 10 September 21, 2011 23:13 lzgwhy FLUENT 0 August 19, 2009 22:44 Andy Chen FLUENT 2 June 30, 2009 12:48 jddmsh FLUENT 0 June 28, 2003 21:59 Hongchan Kim FLUENT 3 April 24, 2001 12:20

All times are GMT -4. The time now is 19:04.

 Contact Us - CFD Online - Top