|
[Sponsors] |
Can't interpret my udf (MPT_gisum1: no function prototype) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 14, 2014, 14:46 |
Can't interpret my udf (MPT_gisum1: no function prototype)
|
#1 |
New Member
Join Date: Apr 2013
Posts: 17
Rep Power: 13 |
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: where - outlet, v - velocity, and n - normal vector. P and p are scalars. Using these formulas I get pressure 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 |
|
September 17, 2014, 14:28 |
|
#2 |
New Member
Join Date: Apr 2013
Posts: 17
Rep Power: 13 |
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.
|
|
January 29, 2015, 02:02 |
|
#3 |
New Member
刘涛
Join Date: Oct 2014
Posts: 1
Rep Power: 0 |
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. |
|
August 24, 2022, 10:53 |
compiled udfs don't print values in console
|
#4 | |
New Member
|
Quote:
#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 } |
||
|
|
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 |