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