|
[Sponsors] |
January 18, 2010, 15:56 |
varying velocity inlet
|
#1 |
New Member
Andre
Join Date: Jan 2010
Posts: 2
Rep Power: 0 |
Hi!
I have a multi-phase flow in an pipe where the velocity varies with time. Here goes my UDF #include "udf.h" DEFINE_PROFILE(inlet_velocity, thread, index) { real x[ND_ND]; real y; face_t f; double veloc[8]= {0.0159,0.0146,0.0135,0.0087,0.0079,0.0079,0.0159, 0.0159}; double time[8]= {0,0.42,1.32,1.8,2.4,2.724,2.736,3.18}; int i=0; int current_time = CURRENT_TIME; double inlet_vel; while( time[i] <= current_time ) { i = i + 1; } inlet_vel = ((veloc[i] - veloc[i-1]) / (time[i] - time[i-1]))*current_time + veloc[i-1]; begin_f_loop(f, thread) { F_PROFILE(f, thread, index) = inlet_vel; } end_f_loop(f, thread) } My velocity changes linearly in time. The thing is that the UDF looks for the current simulation time and compares with the time array and if its smaller than the time array keeps increasing the current time till gets there and when it gets its should calculate the velocity. When it reaches the 3 element from the arrays, I change the fluid. However it dosent seem to be working. Can anyone give me a hand? Thanks a lot |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
velocity inlet vs pressure inlet | cheong | FLUENT | 6 | April 9, 2011 04:07 |
Create hemisphere like velocity profile at inlet | Nelson | Main CFD Forum | 3 | July 27, 2005 13:05 |
UDF problem : inlet velocity in cyl. coord. system | Jongdae Kim | FLUENT | 0 | June 15, 2004 12:21 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |
Velocity Inlet Boundary Conditions | M.A. Rakib | FLUENT | 3 | June 7, 2000 10:40 |