|
[Sponsors] |
November 9, 2010, 17:32 |
UDF for decreasing pressure
|
#1 |
Member
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 16 |
Hello All,
Can someone tell me what am I doing wrong in this UDF that I have? I want to have a pressure inlet boundary condition with decreasing pressure as I march in time. /************************************************** ******************** pr_10.c UDF for specifying a pressure boundary condition ************************************************** ********************/ #include "udf.h" DEFINE_PROFILE(pr_10, thread, nv) { face_t f; /* Defines f as a face thread index */ real t = CURRENT_TIME; /*current flow time*/ real dt = RP_Get_Real("physical-time-step"); real vel = F_V(f,thread); /* v-velocity*/ real Q0 = 5.0; /*Q0=l*b*h, l=b=1 */ real Q; real newQ; real rho = 0.6679; /*density*/ real g = 9.81; real D = 0.05; /*inlet size*/ real PI=3.14159; int time_step = N_TIME; /*returns time step number*/ real P0 = rho*g*Q0; real A = PI*D*0.125; /*inlet area*/ real mem = F_UDMI(f,thread,0); if(time_step = 1){newQ = Q0} /*initializing newQ*/ else{newQ = mem} begin_f_loop(f, thread) { Q = newQ - (A*vel*dt); F_PROFILE(f, thread, nv) = Q*P0/Q0; mem = Q; } end_f_loop(f, thread) } When I try to interpret it, I get the following error messages: Error: W:\Fluent files\Slug\2D\l1\pressure10.c: line 26: parse error. Error: W:\Fluent files\Slug\2D\l1\pressure10.c: line 29: f_loop_last: undeclared variable Can someone help me out with this. Thanks, Pranab |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to adjust pressure outlet | a.lynchy | FLUENT | 4 | February 15, 2021 00:50 |
Pressure BC for combustion chamber | Giuki | FLUENT | 1 | July 19, 2011 11:35 |
Modifying Pressure swirl atomizer model by UDF | jeff_F | FLUENT | 0 | May 22, 2010 09:22 |
calculation average pressure in a plane with UDF | Vitalij | FLUENT | 1 | April 10, 2007 03:39 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 02:15 |