|
[Sponsors] |
July 10, 2013, 04:08 |
UDF for Pulsed flow
|
#1 |
New Member
Vahideh zare
Join Date: Jul 2013
Posts: 5
Rep Power: 13 |
Hi all ,I’m new in fluent and particularly UDF, I want to model a system that a gas is inlet and it flows for 3s and doesn’t flow for 3s alternatively and continuously. I wrote a udf for this problem But it don't do correctly.
Please, guide me. Thank you very much #include"udf.h" DEFINE_PROFILE(inlet_x_velocity, t, position) { face_t f; real flow_time = RP_Get_Real("flow-time"); int i; begin_f_loop(f, t) { for(i=0; i<=flow_time; i++) { if(flow_time >= i*6 && flow_time <= i*6 +3) F_PROFILE(f,t ,position)=0; else F_PROFILE(f,t,position)=0.58425; } } end_f_loop(f, t) } |
|
July 10, 2013, 05:33 |
|
#2 |
Senior Member
|
Try this one.
Code:
#include"udf.h" DEFINE_PROFILE(inlet_x_velocity, t, position) { face_t f; real flow_time = RP_Get_Real("flow-time"); int i = (int)(flow_time/3.0)%2; begin_f_loop(f, t) { if( i) F_PROFILE(f,t ,position)=0; else F_PROFILE(f,t,position)=0.58425; } end_f_loop(f, t) } |
|
July 10, 2013, 06:09 |
|
#3 |
New Member
Vahideh zare
Join Date: Jul 2013
Posts: 5
Rep Power: 13 |
Thank you very much in advance.
regards |
|
July 16, 2013, 03:19 |
|
#4 |
New Member
Vahideh zare
Join Date: Jul 2013
Posts: 5
Rep Power: 13 |
Hi Blackmask, if I want to model a system that a gas is inlet and it flows for 0.05s and doesn’t flow for 0.05s alternatively and continuously, What do I do?
|
|
July 16, 2013, 04:17 |
|
#6 |
New Member
Vahideh zare
Join Date: Jul 2013
Posts: 5
Rep Power: 13 |
I change this but the udf can't do correctly
|
|
July 16, 2013, 04:35 |
|
#8 |
New Member
Yaser
Join Date: May 2013
Location: I. R. Iran, Tehran
Posts: 20
Rep Power: 13 |
Hi Dear Vahideh
please see Chapter 8 of the ANSYS FLUENT UDF Manual. /************************************************** ********************* vprofile.c UDF for specifying steady-state velocity profile boundary condition ************************************************** **********************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y, h; face_t f; h = 0.016; /* inlet height in m */ begin_f_loop(f,thread) { F_CENTROID(x, f, thread); y = 2.*(x[1]-0.5*h)/h; /* non-dimensional y coordinate */ F_PROFILE(f, thread, position) = 0.1*(1.0-y*y); } end_f_loop(f, thread) } /************************************************** ******************** unsteady.c UDF for specifying a transient pressure profile boundary condition ************************************************** *********************/ #include "udf.h" DEFINE_PROFILE(unsteady_pressure, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = 101325.0 + 5.0*sin(10.*t); } end_f_loop(f, thread) } |
|
June 10, 2016, 05:44 |
udf
|
#9 |
New Member
adnan
Join Date: Mar 2016
Posts: 2
Rep Power: 0 |
Hi all ,I’m new in fluent and particularly UDF, I want to model a system that a gas is inlet and it flows for 3s and doesn’t flow for 3s alternatively and continuously in steady state. I wrote a udf fo r this problem But it don't do correctly.
Please, guide me. Thank you very much. #include"udf.h" DEFINE_PROFILE(inlet_x_velocity, t, position) { face_t f; real flow_time = RP_Get_Real("flow-time"); int i = (int)(flow_time/1.0)%2; begin_f_loop(f, t) { if( i) F_PROFILE(f,t ,position)=0; else F_PROFILE(f,t,position)=0. 2; } end_f_loop(f, t) } |
|
June 10, 2016, 06:37 |
|
#10 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
|
||
June 11, 2016, 04:38 |
|
#11 |
New Member
adnan
Join Date: Mar 2016
Posts: 2
Rep Power: 0 |
The Model is a tube being inside water intermittent (pulse), but when I use the code is not there is a change in the results, When change my time
I do not know how or where I put the time flow |
|
March 20, 2018, 13:30 |
|
#12 |
New Member
Join Date: Mar 2018
Posts: 2
Rep Power: 0 |
hello, i'm currently try your code.. but it seems not working. could you please teach me how to write udf...?
|
|
March 20, 2018, 15:33 |
|
#13 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
"It seems not working" is not very helpful. Please be more detailed.
(Does it give errors? Warnings? Wrong results? Fluent crashes? Your computer destroyed in a fire? Nothing happened?) |
|
March 20, 2018, 23:30 |
|
#14 |
New Member
Join Date: Mar 2018
Posts: 2
Rep Power: 0 |
Thank you for you reply Sir..
so i was trying to simulate gas-solid fludized bed dryer with pulsed flow... 0.2 m/s inlet velocity in +y direction, frequency 1 Hz ( 0s -> 0.5s it flow 0.2m/s 0.5s -> 1s the flow stop at 0 m/s 1.0s -> 1.5s the flow again at 0.2m/s , repeat continously and when i simulate the volume fraction..it doesn't show any pulsed effect..more likely constant velocity.. i'm also trying to change the frequency into 3s flow...3s stop just to see wether the udf code is working properly or not..and it show the same.. here the copy of my udf code for 3S flow..3S stop flow ================================== #include"udf.h" DEFINE_PROFILE(inlet_y_velocity,t,position) { face_t f; real flow_time = RP_Get_Real("flow-time"); int i = (int)(flow_time/3)%2; begin_f_loop(f,t) { if (i) F_PROFILE(f,t,position)=0; else F_PROFILE(f,t,position)=0.2; } end_f_loop(f,t) } =============================== note: i still very beginner in fluent, especially in udf... so i don't know wether when we have to add "space" "." or ";" , and anything about coding |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to measure Mass Flow Rate | a.lynchy | Fluent UDF and Scheme Programming | 31 | October 4, 2018 15:10 |
UDF for time-dependent flow | borhan_sd@yahoo.com | Fluent UDF and Scheme Programming | 2 | May 30, 2013 03:59 |
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat | kokoory | FLUENT | 0 | August 17, 2011 03:07 |
How to define mass flow rate using UDF? | SAMUEL | FLUENT | 0 | December 16, 2004 03:55 |
UDF for multiphase flow | ROOZBEH | FLUENT | 3 | April 7, 2004 18:54 |