CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

Fluent udf F_PROFILE setting different boundary conditions for different faces

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   March 30, 2016, 23:35
Default Fluent udf F_PROFILE setting different boundary conditions for different faces
New Member
Join Date: Jun 2015
Posts: 9
Rep Power: 3
syble is on a distinguished road

I'm modelling a boundary where one gas species enters at a certain rate while another species exits the boundary at a different rate.

My plan was to write a udf that loops through all the elements on the boundary and for every second face specify the flow into the domain and for every other face specify the boundary out of the domain (at the moment I just have one gas species to simplify the problem and I'm just altering the flow direction).
To access each second face I keep track of the number of faces I have looped over and if this count is odd then the flow is in one direction and if the count is even then the flow is in the other direction.

This is my udf:

face_t f;
cell_t c0;
int count = 0;
int mod;
int fluxValue = 2.0;

begin_f_loop (f,t)
count += 1;
mod = count%2;
printf("count: %d\n", count);
printf("modulus: %d\n", mod);

if(mod == 0) // even
F_PROFILE(f,t,nv) = fluxValue ;
printf("EVEN cell \n");
else // odd
F_PROFILE(f,t,nv) = -1.0*fluxValue ;
printf("ODD cell \n");
end_f_loop (f,t)

I used this udf to define the inlet boundary of a simple pipe where the outlet of the pipe was set to zero relative pressure. I expected that the net flow over the inlet would be zero since the inward flux specified by half the faces would be balanced by the other half of the faces. However when I look at the results the mass flow rate over the inlet is equal to -fluxValue which makes me think that only the negative condition is being set on all the faces in the boundary.

Am I using the begin_f_loop and F_PROFILE correctly? Does this specify the boundary condition on each face?

The simulation converges in about 300 iterations to RMS residuals for all solution variables to 10^-4.

Thanks in advance for any help.
syble is offline   Reply With Quote


begin_f-loop, boundary conditions, fluent, f_profile, udf

Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[gmsh] Vertex numbering is dense KateEisenhower Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 August 3, 2015 10:49
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 10 June 16, 2015 15:48
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44

All times are GMT -4. The time now is 20:33.