CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

set BC mass-flow-inlet via UDF and via GUI perform different result

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

LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2015, 03:04
Default set BC mass-flow-inlet via UDF and via GUI perform different result
New Member
Join Date: Dec 2013
Posts: 4
Rep Power: 0
sawa25 is on a distinguished road
Hellow,udf experts! Advise, please

(i solving HVAC system-water vapor goes from open water surface in the closed room and suck/inflate ventilation system is working there)
i stuck about how to set water evaporating(i did function, obviously it calculate water vapor properly(i spend big time for it),
but i did not understand right, how properly hook this to fluent!

first of all i mention strange very big difference in mass flow from water surface and from air inlet/out.
I start to explore why.

this difference was because of setting BC: each BC(air inlet and water vapor in) was mass-flow-inlet;
BUT air was set from GUI as fixed value Mass Flow Rate, and water was set as compiled UDF DEFINE_PROFILE.

this was my mistake:
i thought that as i loop over all faces, i should set mass flow for every face proportionaly to the total summ.
(Mass Flow Rate for every face calculated based on area/velocity above face on some distance/difference in d(d is weight of water vapor in air)-
usual formula for water evaporation for swimming pool)

does not matter how exactly function work, but i need to set different value(of massflow) to every face, not same value....
because conditions for every face is different.

BUT to set Mass Flow Rate why does fluent expect loop over all face and set this summ massflowrate to every cell(i mean every face),
because i set BC here for water surface

to explain what i mean see simple code, that doing things wrong, because FLUENT divide totalmassflow by number of face(Flux report mass flow rate, or surface integrals mass flow rate).
in this simple code for air inlet,i just show what i need in the sense of proportionality:

DEFINE_PROFILE for air inlet and hook this UDF for air inlet instead fixed value (0.584kg/s):
#define vozduhanG 0.584 //summ air massflow from air inlet(kg/s)(in first case that value i set in GUI as Mass Flow Rate)
{ face_t f;
real NV_VEC(farea);
real area,sumarea=0;
//let get sum area for air in (in my model 4 different air inlet , summ area = 1m2, but they act as one surface with common named selection)
//get face area
area = NV_MAG(farea);
//summ every face area to get total area for our air inlet

//then simply set on each face mass flow proportional to area of this face:

real sumflow=0,
area = NV_MAG(farea);
sumflow+=F_PROFILEvalue;//store summ massflow to test finaly
F_PROFILE(f,t,i) =F_PROFILEvalue;//set massflow for each face(proportionaly to it area)

//diagnostic message show us right summ value: 0.584 kg/s, summarea 1m2
CX_Message("\n sumflowvozduhan= %g kg/s %g kg/h sumarea %g",sumflow,sumflow*3600,sumarea);

but Flux report mass flow rate, or surface integrals mass flow rate show us 0.073 kg/s (total summ divided by number of face)

when i set vozduhanG as fixed value from GUI, report is as expected: 0.584
(i use
energy on
species transport
air (o2,n2,h2o) as mixture
coupled preasure based solver

Last edited by sawa25; February 16, 2015 at 08:14.
sawa25 is offline   Reply With Quote

Old   February 25, 2015, 00:51
Default solved
New Member
Join Date: Dec 2013
Posts: 4
Rep Power: 0
sawa25 is on a distinguished road
to do what i need, i use mass flux instead mass flow rate
sawa25 is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

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

All times are GMT -4. The time now is 16:52.