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

Can't interpret my udf (MPT_gisum1: no function prototype)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By nnvoro

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2014, 14:46
Default Can't interpret my udf (MPT_gisum1: no function prototype)
  #1
New Member
 
Join Date: Apr 2013
Posts: 17
Rep Power: 13
nnvoro is on a distinguished road
Dear all,

I'm currently trying to set up the resistance boundary condition on the pressure-outlet to model blood flow in the vessel tree.

The idea is to calculate flow rate trough the outlet at each time instant and then calculate the lumped parameter model pressure using formula: P=Q*R where R is resistance (parameter values for which are taken from literature). Lumped parameter model (P,Q) can be coupled to the outlet boundary of the computational domain (p,v) by:

Q = -\int_\Gamma v*n d\Gamma
-Pn = pn+\mu(\nabla v)n

where \Gamma - outlet, v - velocity, and n - normal vector. P and p are scalars. Using these formulas I get pressure p and set it as the pressure-outlet condition.

I wrote udf to set up this boundary condition. UDF is for parallel computation. When I interpret it I get an error: line 73: MPT_gisum1: no function prototype. The line which gives me an error is shown in red in the code.

Here is my UDF:

DEFINE_PROFILE(pressure_profile1,t,i)
{
/* Variables used by serial, host, node versions */
real Q = 0.;
real R1 = 10.; /*resistance value downstream outlet*/
real P;
real flow_time = RP_Get_Real("flow-time");
face_t f;
if (flow_time == 0.)
{
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = 0.;
}
end_f_loop(f,t)
}
else
{
#if !RP_HOST
/*calculate flow through the outlet*/
begin_f_loop(f,t)
{
Q += F_FLUX(f,t);
}
end_f_loop(f,t)

#if RP_NODE
Q = PRF_GISUM1(Q); /* summation of the flow rate*/
#endif /* RP_NODE */

#endif /* !RP_HOST */

P=Q*R1;/*calculate resistance BC model pressure*/
Q = 0.;
/*calculate pressure at the outlet*/

begin_f_loop(f,t)
{
.................................................. ..................
.................................................. ..................
here comes the part where I calculate pressure p
which I removed from the post
.................................................. ..................
.................................................. ..................
F_PROFILE(f,t,i) = ... ;
}
end_f_loop(f,t)
}
}

Could you please help me with this problem?

Thanks

nnvoro
nnvoro is offline   Reply With Quote

Old   September 17, 2014, 14:28
Default
  #2
New Member
 
Join Date: Apr 2013
Posts: 17
Rep Power: 13
nnvoro is on a distinguished road
I think I found the solution to this problem. Before I was interpreting this UDF and it didn't work. It seems that some functions needed to be compiled. When I compiled it it started to work.
Sun likes this.
nnvoro is offline   Reply With Quote

Old   January 29, 2015, 02:02
Default
  #3
New Member
 
刘涛
Join Date: Oct 2014
Posts: 1
Rep Power: 0
shandongliutao is on a distinguished road
Hi, nnvoro!
I am also trying to simulate blood flow with resistance boundary condition,
but i use openfoam.The problem is that with patient-specific model openfoam didn't converge well .So i want to have a try with fluent. Did your result converge well and is reasonable? Thank you.
shandongliutao is offline   Reply With Quote

Old   August 24, 2022, 10:53
Default compiled udfs don't print values in console
  #4
New Member
 
Ahmad Koolivand
Join Date: Aug 2022
Location: Shiraz,Iran
Posts: 3
Rep Power: 4
AhmadKoolivand is on a distinguished road
Send a message via Skype™ to AhmadKoolivand
Quote:
Originally Posted by nnvoro View Post
I think I found the solution to this problem. Before I was interpreting this UDF and it didn't work. It seems that some functions needed to be compiled. When I compiled it it started to work.
Hi. When I compile below UDF, it does not print value n but when I interpret it, value n gets printed. How can I fix this problem with compiled UDFs?

#include"udf.h"

DEFINE_ADJUST(cellcounter,domain)
{
#if !RP_HOST
Thread *t;
cell_t c;
int n=0;


thread_loop_c(t,domain)
{
begin_c_loop_int(c,t)
{
n+=1;
}
end_c_loop_int(c,t)
}
printf("n: %d\n", n);
#endif
}
AhmadKoolivand 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
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 11:51
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27
C_NNODES UDF 'function' problem Matthew Brannock FLUENT 2 June 21, 2000 23:46


All times are GMT -4. The time now is 22:09.