CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Parallel UDF (https://www.cfd-online.com/Forums/fluent-udf/88884-parallel-udf.html)

sham83 May 29, 2011 07:39

Parallel UDF
 
Hi,

Can someone help me to modify my UDF below to parallel UDF. I am simulating oscillating cylinder and need to compile my UDF in Linux parallel.

#include "udf.h"

#define AA 0.03
#define TT 4.1667
#define OM (2.0*M_PI/TT)

DEFINE_CG_MOTION(updown,dt,vel,omega,time,dtime)
{
vel[1] = AA*OM*cos(OM*time);
}


thanks.

sham.

dmoroian May 31, 2011 04:04

The usual advice in the manual is to enclose the body of your udf in a directive:
Code:

#include "udf.h"

#define AA    0.03   
#define TT      4.1667
#define OM    (2.0*M_PI/TT)   

DEFINE_CG_MOTION(updown,dt,vel,omega,time,dtime)
{
#if !RP_HOST
  vel[1] = AA*OM*cos(OM*time);   
#endif
}

But in your case, I don't think that is necessary.

sham83 May 31, 2011 07:11

Thanks. I shall give it a try. My problem is I set up my case in Windows (serial) and run a few iterations there until it reaches a near steady solution. Then I transfer my case to Linux (parallel) and continue running there. However, when I continue my iterations there, the results (Cd and Cl) vary erratically unlike my run in Windows (serial). It runs ok and no error message given. Just the results are unexpected. Hence, I suspect the problem is in the UDF that need to be parallelize.

Would appreciate if you have more input to what my prob could be.

dmoroian May 31, 2011 07:23

Then the problem is not from DEFINE_CG_MOTION. How do you compute Cd and Cl, are you using fluent reports or you wrote your own udf?

sham83 May 31, 2011 07:39

Cl and Cd from Fluent Solve > Monitor panel.

I am simulating oscillating cylinder with dynamic mesh. I have tried the same with fixed cylinder (no UDF used) and it was fine when I transferred from Windows serial to Linux parallel and continue running it.

dmoroian May 31, 2011 07:55

Some differences should appear due to different mesh after remeshing in parallel compared to serial.


All times are GMT -4. The time now is 23:17.