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

Fluent UDF for reading mass flux on inlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 16, 2019, 09:10
Default Fluent UDF for reading mass flux on inlet
  #1
New Member
 
--
Join Date: Sep 2019
Posts: 3
Rep Power: 7
Mr.Rioes is on a distinguished road
Hey,
at the moment I am working on a project, where I need an UDF to read the mass flux on an inlet. The inlet is a pressure inlet, and the simulation will be run in 2D.

I've looked in many forums and threads around how this would be possible, an I found the F_FLUX function.
But i don't get the code running. Everytime Fluent tries to start the UDF it crashes.

I get the error:

=============================

============================================

Node 999999: Process 14860 : Recieved signal SIGSEGV.

===============================================
===============================================

.....

MPI Application rank 1 exited before MPI_Finalize() with status 2
The fl process could not be started.


The code I am running at the moment is:

DEFINE_EXECUTE_AT_END(mass_flow_update)
{

Domain *d1;
Thread *t1;
face_t f;

d1 = Get_Domain(5);
t1= Lookup_Thread(d1, 17);


flow = F_FLUX(f,t1);


act_mass_flow_inlet = flow / area_factor;
act_mass_change = act_mass_flow_inlet * CURRENT_TIMESTEP;

Message("Mass flow this timestep is: %f\n",act_mass_change);

}
Mr.Rioes is offline   Reply With Quote

Old   September 20, 2019, 11:55
Default
  #2
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
If you are running a single phase simulation, you should use
d1 = Get_Domain(1);
upeksa is offline   Reply With Quote

Old   September 24, 2019, 07:12
Default
  #3
New Member
 
--
Join Date: Sep 2019
Posts: 3
Rep Power: 7
Mr.Rioes is on a distinguished road
Okay thank you it worked,
I thought i had to use the ID I see in fluent, because I splitted my mesh into several areas.
Mr.Rioes 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 - Inlet Velocity Profile (Ansys Fluent) vinayak4399 Fluent UDF and Scheme Programming 3 August 25, 2020 15:15
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
Error inputting udf into fluent for mass source ejvikings Fluent UDF and Scheme Programming 0 April 26, 2012 22:42
Problem setting with chtmultiregionFoam Antonin OpenFOAM 10 April 24, 2012 10:50
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 16:20.