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

UDF to return assigned gauge pressure to a BC + mass flow rate

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tarantino

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2017, 19:27
Question UDF to return assigned gauge pressure to a BC + mass flow rate
  #1
Member
 
Tarantino
Join Date: Feb 2013
Posts: 46
Rep Power: 13
Tarantino is on a distinguished road
Hello!

I want to return an assigned pressure to a pressure outlet BC and do some math based on in a UDF. I want also to return mass flow rate.
Here is a part of udf that need to do so:

Code:
#include"udf.h"
real flow_tot, p;

DEFINE_ON_DEMAND(Pressure_flow)
{
Domain *d; 
real flow;
cell_t c;
Thread *t;
face_t f;

d = Get_Domain(1); 
t= Lookup_Thread(d, 29);

begin_f_loop(f,t)
{
flow+=F_FLUX(f,t);
}
end_f_loop(f,t)
p = C_P(c,t);
printf("gauge pressure = %g\n", p);
printf("Mass Flow Rate: %g\n",flow);
flow_tot =flow;
flow=0.;
}

However, when I compile and Execute-on-demand, then I got the following error:

Code:
==============================================================================

Node 0: Process 13808: Received signal SIGSEGV.

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

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

Node 1: Process 17288: Received signal SIGSEGV.

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

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

Node 3: Process 17844: Received signal SIGSEGV.

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

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

Node 999999: Process 16332: Received signal SIGSEGV.

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

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

Node 5: Process 12176: Received signal SIGSEGV.

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

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

Node 6: Process 17444: Received signal SIGSEGV.

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

Anyone know the problem?
Thanks.
Svetlana likes this.
Tarantino is offline   Reply With Quote

Old   September 28, 2017, 20:06
Default eq?; use monitor
  #2
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15
Svetlana is on a distinguished road
What pressure boundary condition do you want to set, if you write it in English and maths formulas?

For the mass flow rate you can add a monitor point, you do not have to add it to the UDF
Svetlana 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
Exit Corrected Mass Flow Rate Mesh Sensitivity Study s__s__s CFX 4 July 20, 2016 12:46
UDF to access interior surface to calculate mass flow rate shahjehan Fluent UDF and Scheme Programming 0 August 11, 2015 15:44
DPM total mass flow rate yow FLUENT 0 July 17, 2015 13:01
Periodic channel flow with time dependent mass flow rate QBeast FLUENT 3 May 10, 2013 14:14
Discrete Phase & Mass Flow Rate MagnusZeus FLUENT 0 December 2, 2011 18:57


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