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

Access inlet mass flow value (target mass flow rate)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2018, 14:30
Default Access inlet mass flow value (target mass flow rate)
  #1
New Member
 
Join Date: Mar 2018
Location: Brazil
Posts: 7
Rep Power: 6
YCarv is on a distinguished road
Hello everyone,
I need to specify the mass flow rate percentage through multiple outlets, just as in outflow boundary condition, but using pressure-outlet boundary condition instead, and target mass flow rate option.

The inlet mass flow varies with time. How can I retrieve this value ?
I've created the UDFs, but the results are weird. I think I am not retrieving the correct inlet mass flow.


---------------------------------------------------------------------------
Here is the code I've created:

DEFINE_PROFILE(target_massflow_left1,outlet_thread ,massflow)
{
face_t f;
face_t inlet;
Domain *domain;
real percentage = 0.24;
int inlet_zone_id = 61;
real inlet_massflow;

domain = Get_Domain(1); //fluid domain
Thread *inlet_thread = Lookup_Thread(domain,inlet_zone_id); //thread containing inlet

begin_f_loop(inlet,inlet_thread)
{
if(BOUNDARY_FACE_THREAD_P(inlet_thread)) //found inlet
{
inlet_massflow = -F_FLUX(inlet,inlet_thread);

}
}
end_f_loop(inlet, inlet_thread);


//loop over every face on the thread
begin_f_loop(f,outlet_thread)
{
F_PROFILE(f,outlet_thread,massflow) = percentage * inlet_massflow ;

}
end_f_loop(f, outlet_thread);
}
----------------------------------------------------------------------------------

Thanks in advance,
YCarv
YCarv is offline   Reply With Quote

Old   April 1, 2018, 06:27
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 24
pakk will become famous soon enough
To get the total inflow, you need to sum the inflow overall faces in the inlet.

Code:
real inlet_massflow=0;
[...]
inlet_massflow -= F_FLUX(inlet,inlet_thread);
pakk is offline   Reply With Quote

Old   April 1, 2018, 08:09
Default
  #3
New Member
 
Join Date: Mar 2018
Location: Brazil
Posts: 7
Rep Power: 6
YCarv is on a distinguished road
oh, of course !
Thank you very much pakk, I will try this now !
YCarv is offline   Reply With Quote

Reply

Tags
target-mass-flow-rate

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mass flow inlet and pressure outlet with target mass flow rate Zigainer FLUENT 13 October 26, 2018 05:58
Target Mass Flow Rate Nitin FLUENT 9 June 17, 2017 10:30
DPM total mass flow rate yow FLUENT 0 July 17, 2015 12:01
OpenFOAM14 for Mac OSX Darwin 104 gschaider OpenFOAM Installation 118 July 20, 2008 05:19
Mass Flow Inlet Pravir Kumar Rai FLUENT 0 February 17, 2003 19:23


All times are GMT -4. The time now is 00:05.