# Related to UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 12, 2021, 04:09 #2 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,639 Rep Power: 23 right before line: Qfinal = Q; you need to add global summation macro to make code works in parallel Code: `Q = PRF_GRSUM1(Q);` also I'm not sure if you need to use full outlet area of each finite are (as you did) here: Code: `Q = Q + (Ar*V);` check it __________________ best regards ****************************** press LIKE if this message was helpful

 April 12, 2021, 08:16 #3 Member   Yasser Selima Join Date: Mar 2009 Location: Canada Posts: 52 Rep Power: 16 Code: ` q += a[0] * v` q += a[0] * v; Last edited by Yasser; April 12, 2021 at 08:19. Reason: correcting

 April 12, 2021, 10:32 #4 New Member   Heer Join Date: Oct 2020 Posts: 25 Rep Power: 2 @Yasser, while inculcating this change, should I not calculate the magnitude of the area vector?

 April 12, 2021, 10:38 #5 Member   Yasser Selima Join Date: Mar 2009 Location: Canada Posts: 52 Rep Power: 16 Hello, If you are considering F_U, you should be multiplying this time the area in the x-direction only!

 April 12, 2021, 10:39 #6 New Member   Heer Join Date: Oct 2020 Posts: 25 Rep Power: 2 Thanks, Yasser for your input, I will check it.

 April 12, 2021, 10:40 #7 New Member   Heer Join Date: Oct 2020 Posts: 25 Rep Power: 2 Thank you Alexander for your input, I will check if it works.

April 13, 2021, 05:51
#8
New Member

Heer
Join Date: Oct 2020
Posts: 25
Rep Power: 2
Quote:
 Originally Posted by AlexanderZ right before line: Qfinal = Q; you need to add global summation macro to make code works in parallel Code: `Q = PRF_GRSUM1(Q);` also I'm not sure if you need to use full outlet area of each finite are (as you did) here: Code: `Q = Q + (Ar*V);` check it
Dear Alexander,

I tried incorporating the change suggested by you and the modified code is as follows:
#include "udf.h"

#define R 12e9 /*Value taken from literature*/

#include "mem.h"
#include "metric.h"
#include "prf.h"

{
real A[ND_ND];
face_t f;
real Ar, V, Qfinal;
real Q, P;

{
Ar = NV_MAG(A); /* Used for the computation of the magnitude of the area vector */
Q = Ar*V;
}

Q = PRF_GRSUM1(Q);
Qfinal = Q;

{
}
}

But I have a couple of questions, as in will the final pressure obtained be the same all over the face or some more modification is required? Also, I don't know why my relation is still not getting satisfied.

Thanks!

 April 13, 2021, 11:30 #9 New Member   Heer Join Date: Oct 2020 Posts: 25 Rep Power: 2 Dear Alexander, I am facing one more problem, the volumetric flow rate calculated by the UDF (as I printed and checked the value), and the surface integral is coming different and it is differing by a value of order 10^(-3). But the relation is satisfied by the value of the volumetric flow rate obtained from the UDF and not from surface integral. Can you please tell what can be the possible reason behind it? Thanks in advance!

 April 17, 2021, 11:26 #10 Senior Member   Join Date: Nov 2013 Posts: 1,781 Rep Power: 22 Code: `Q = Ar*V;` This is wrong, you only keep the value of the last cell. Code: `Q += Ar*V;` msd likes this. __________________ "The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".

April 19, 2021, 02:23
#11
New Member

Heer
Join Date: Oct 2020
Posts: 25
Rep Power: 2
Quote:
 Originally Posted by pakk Code: `Q = Ar*V;` This is wrong, you only keep the value of the last cell. Code: `Q += Ar*V;`
Thank you, I will try incorporating the changes.

 Tags average outlet pressure, udf