CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF reads CO at an outlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2022, 12:12
Default UDF reads CO at an outlet
  #1
Senior Member
 
AH
Join Date: Apr 2014
Posts: 287
Rep Power: 0
visitor is on a distinguished road
Is there an example of a UDF which reads CO at an outlet boundary? Looking for a way to read CO at two different time intervals, starting with something below, and if I can use these macros;

Initially inlet_1 = 10, inlet _2 = 0.

If (C_YI(c,t,i) > C_YI_M2(c,t,i))
(Increment inlet_1 by 1e-3) && ( decrement inlet_2 by 1e-3)

Just for starters, code below needs to read outlet via an a boundary ID, and then increment/decrement mass flows at inlet_1 and inlet_2. Thanks.

int main ()
{
real inlet_1, inlet_2; //the two inlets.
Inlet_1=10 //starting with a value of 10.
Inlet_2=0 //starting with a value of 0.
begin_f_loop(f, t) //start looping
{
If(C_YI(c,t,i) > C_YI_M2(c,t,i)) //the two 1st macro reads at current time, 2nd reads at 2 time steps behind. BUT I don't know how to get C_YI(c,t,i) macro to get CO (carbon monoxide)at the outlet.//
Inlet_1 +=1; //increment by 1 based on if condition.
Inlet_2 -=1; //decrement by 1 based on if condition.
Else if(C_YI(c,t,i) < C_YI_M2(c,t,i)) //this does the opposite to the above 'if' condition.
Inlet_1 -=1;
Inlet_2 +=1;
//if either way changes in CO value are within 5% (0.05), then leave & print inlets as they are.
Else ( ((C_YI(c,t,i))/( C_YI_M2(c,t,i)))<0.05 || ((C_YI_M2(c,t,i))/( C_YI (c,t,i)))<0.05 )
Message("RECOMMENDED value for inlet_1 within +/- 0.05 is: %g\n", inlet_1);
Message("RECOMMENDED value for inlet_1 within +/- 0.05 is: %g\n", inlet_2);
}
end_f_loop(f,t)
}

Last edited by visitor; September 11, 2022 at 17:00.
visitor is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for zero pressure gradient at BC outlet ghordog Fluent UDF and Scheme Programming 1 April 28, 2022 06:12
UDF writes the outlet temperature assignment to the inlet temperature of another calc ZengJiChuan FLUENT 7 May 27, 2020 05:14
outlet pressure Boundary settings -velocity streamline under ambient temp.conditions Vishnu_bharathi CFX 12 November 21, 2017 07:56
UDF for flow at the outlet of pipe sknandwani80@gmail.com Fluent UDF and Scheme Programming 0 November 4, 2017 04:06
UDF in Fluent to Match Mass Flow at Pressure Outlet Jonas Larsson Main CFD Forum 1 April 29, 1999 11:44


All times are GMT -4. The time now is 13:41.