|
[Sponsors] |
April 5, 2005, 05:02 |
Unsteady udf, velocity step
|
#1 |
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, 10:36 |
Re: Unsteady udf, velocity step, more help pls!
|
#2 |
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="<udfconfig.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, 11:23 |
Re: Unsteady udf, velocity step, more help pls!
|
#3 |
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, 17:23 |
Re: Unsteady udf, velocity step, more help pls!
|
#4 |
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="<udfconfig.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, 17:26 |
Re: Unsteady udf, velocity step, more help pls!
|
#5 |
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, 11:14 |
Re: Unsteady udf, velocity step, more help pls!
|
#6 |
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, 04:51 |
Re: Unsteady udf, velocity step, more help pls!
|
#7 |
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="<udfconfig.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, 05:44 |
Re: Unsteady udf, velocity step, more help pls!
|
#8 |
Guest
Posts: n/a
|
CURRENT_TIME is not avaiable in Fluent 6.0. Try with RP_Get_Real("flow-time").
|
|
April 7, 2005, 12:08 |
Re: Unsteady udf, velocity step
|
#9 |
Guest
Posts: n/a
|
|
|
April 8, 2005, 04:15 |
Re: Unsteady udf, velocity step, more help pls!
|
#10 |
Guest
Posts: n/a
|
At last, it works! Thanks everyone.
|
|
April 8, 2005, 05:20 |
Re: Unsteady udf, velocity step, more help pls!
|
#11 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple floating objects | CKH | OpenFOAM Running, Solving & CFD | 14 | February 20, 2019 10:08 |
On Setring Step Size in unsteady Solver of FLUENT | lzgwhy | FLUENT | 0 | August 19, 2009 23:44 |
how did I see next time step of velocity cotour ? | Andy Chen | FLUENT | 2 | June 30, 2009 13:48 |
How to modify velocity with UDF | jddmsh | FLUENT | 0 | June 28, 2003 22:59 |
UDF component in Cyliderical Velocity? | Hongchan Kim | FLUENT | 3 | April 24, 2001 13:20 |