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

how to load UDF in parallel at linux platform

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2013, 21:56
Default how to load UDF in parallel at linux platform
  #1
New Member
 
maye
Join Date: Oct 2009
Posts: 9
Rep Power: 16
maye761 is on a distinguished road
The UDF is built and loaded well in windows platform by installing VC++. But when I do the same thing in suse linux or redhat linux, it works well in serial simulation but loading failed in parallel simulation. The hint shows:

The UDF library you are trying to load (libudf/inamd64/3d_host/libudf.so) is not compiled for parallel use on the current platform (lnamd64)
no error
/cae/maye/fluent/test/libudf/lnamd64/3d_host/libudf.so


All gcc (C++&Fortran) of x86_64 has been installed. How can I solve the problem? Shall I install more codes or set any environments? The UDF file is:

#include <stdio.h>
#include "udf.h"
DEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime)
{
if(time<=8.0)
{
vel[2]=-0.75*time;
}
if(time>8.0&&time<=14.0)
{
vel[2]=-6.0;
}
if(time>14.0&&time<=22.0)
{
vel[2]=-6.0+0.75*(time-14.0);
}
if(time>22.0)
{
vel[2]=0.0;
}
Message("\nUDF value: velx=%f",vel[2]);

}
maye761 is offline   Reply With Quote

Old   September 23, 2013, 06:58
Default
  #2
Member
 
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 14
Hershey is on a distinguished road
You need to add compiler directives into your UDF. These go something like this:

#if RP_HOST
/*enter code here*/
#endif

or

#if RP_NODE
/*enter code here*/
#endif

There are others, but I suggest reading through the manual first. This should help you too: http://aerojet.engr.ucdavis.edu/flue...df/node207.htm
Hershey is offline   Reply With Quote

Old   September 23, 2013, 21:44
Default
  #3
New Member
 
maye
Join Date: Oct 2009
Posts: 9
Rep Power: 16
maye761 is on a distinguished road
THX!
I tried to modify the UDF file as follows, but the error still there:

#include <stdio.h>
#include "udf.h"

DEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime)
{
#if RP_NODE
if(time<=8.0)
{
vel[2]=-0.75*time;
}
if(time>8.0&&time<=14.0)
{
vel[2]=-6.0;
}
if(time>14.0&&time<=22.0)
{
vel[2]=-6.0+0.75*(time-14.0);
}
if(time>22.0)
{
vel[2]=0.0;
}
#endif
#if RP_HOST
Message("\nUDF value: velx=%f",vel[2]);
#endif
}


How to solve it?
maye761 is offline   Reply With Quote

Old   September 23, 2013, 22:02
Default
  #4
New Member
 
maye
Join Date: Oct 2009
Posts: 9
Rep Power: 16
maye761 is on a distinguished road
When I click load, the following errors show:

Node 0: Doesn't have write permissions for libudf/lnamd64/3d_node. If using local disk, make sure UDF lib is synced up on all nodes.
Opening library "/mnt/test/libudf"...
Primitive Error at Node 1: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
/ansys_inc/v145/fluent/bin/libudf/lnamd64/3d_node/libudf.so

Primitive error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
/ansys_inc/v145/fluent/bin/libudf/lnam64/3d_node/libudf.so

Opening library "/ansys_inc/v145/fluent/bin/libudf"...
Opening library "/ansys_inc/v145/fluent/bin/libudf"...
Error: The UDF library you are trying to load (libudf/lnam64/3d_host/libudf.so) is not compiled for parallel use on the current platform (lnamd64).

no error
/mnt3/test/libudf/lnamd64/3d_host/libudf.so
Error Object: #f
maye761 is offline   Reply With Quote

Old   April 21, 2014, 14:04
Default
  #5
New Member
 
Join Date: Feb 2010
Posts: 27
Rep Power: 16
Virtual-iCFD is on a distinguished road
I am also experiencing the same issue. May I know have you figured out the solution?
Virtual-iCFD is offline   Reply With Quote

Old   April 6, 2018, 14:31
Default
  #6
FSM
New Member
 
Felipe
Join Date: Nov 2017
Location: Brazil
Posts: 16
Rep Power: 8
FSM is on a distinguished road
I am also experiencing the same issue. Have you figured out how to solve this problem?
FSM is offline   Reply With Quote

Old   April 10, 2018, 07:26
Default
  #7
FSM
New Member
 
Felipe
Join Date: Nov 2017
Location: Brazil
Posts: 16
Rep Power: 8
FSM is on a distinguished road
@maye761, were you using normal or superuser login when you experienced this problem?
I got the same error, even after inserting some compiler directives on the code.
If you solve this problem, could you share the way, please?

Thank you.
FSM is offline   Reply With Quote

Old   April 12, 2018, 07:53
Default
  #8
New Member
 
André Domingues
Join Date: Apr 2018
Posts: 5
Rep Power: 8
André_UFC is on a distinguished road
Hi, try like this. I'm not a coding expert but maybe it will work.

Code:
#include <stdio.h>
#include "udf.h"

DEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime)
{
#if !RP_HOST
 if(time<=8.0)
  { 
   vel[2]=-0.75*time;
 }
 if(time>8.0&&time<=14.0)
  { 
   vel[2]=-6.0;
 }
 if(time>14.0&&time<=22.0)
  { 
   vel[2]=-6.0+0.75*(time-14.0);
 }
  if(time>22.0)
  { 
   vel[2]=0.0;
 }
#endif 
#if !RP_HOST
 Message("\nUDF value: velx=%f",vel[2]);
#endif
}
André_UFC is offline   Reply With Quote

Old   April 13, 2018, 03:28
Default
  #9
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Regardless of anything else, this is a much better structure:
Code:
if(time<=8.0)
{
  vel[2]=-0.75*time;
}
else if(time<=14.0)
{
  vel[2]=-6.0;
}
else if(time<=22.0)
{
  vel[2]=-6.0+0.75*(time-14.0);
}
else
{
  vel[2]=0.0;
}
Ed
obscureed is offline   Reply With Quote

Old   April 13, 2018, 03:30
Default
  #10
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
And it does not take a lot of effort to add parameters that can be varied later:
Code:
#define PLATEAU_VEL -6.0
#define PLATEAU_TIME_START 8.0
#define PLATEAU_TIME_END 14.0
#define PLATEAU_DURATION_RAMPDOWN 8.0

if(time<=PLATEAU_TIME_START)
{
  vel[2]= time * (PLATEAU_VEL/PLATEAU_TIME_START);
}
else if(time<=PLATEAU_TIME_END)
{
  vel[2]= PLATEAU_VEL;
}
else if(time<= (PLATEAU_TIME_END+PLATEAU_DURATION_RAMPDOWN))
{
  vel[2]= PLATEAU_VEL * (1.0 - (time - PLATEAU_TIME_END)/PLATEAU_DURATION_RAMPDOWN);
}
else
{
  vel[2]=0.0;
}
obscureed 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
Problem in using UDF in parallel computing Yogini Fluent UDF and Scheme Programming 0 January 22, 2013 08:23
Dynamic Mesh- Parallel UDF DE HEART Fluent UDF and Scheme Programming 14 August 11, 2010 01:29
parallel udf problem in linux endlessfree Fluent UDF and Scheme Programming 0 April 13, 2010 10:19
Help with Define on Demand UDF in Parallel Mahesh FLUENT 2 August 7, 2007 05:34
CFX, NT parallel, Linux, best platform Heiko Gerhauser CFX 1 August 21, 2001 09:46


All times are GMT -4. The time now is 06:05.