|March 30, 2016, 23:35||
Fluent udf F_PROFILE setting different boundary conditions for different faces
Join Date: Jun 2015
Posts: 9Rep Power: 3
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:
int count = 0;
int fluxValue = 2.0;
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");
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.
|begin_f-loop, boundary conditions, fluent, f_profile, udf|
|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|