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

"Define_Profile" UDF for parallel solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2007, 09:31
Default "Define_Profile" UDF for parallel solver
  #1
Antoine
Guest
 
Posts: n/a
Hi

I'm trying to make a simulation using a parabolic velocity profile (detailed at the end of this message) and in order to reduce computing time, I want to use Fluent parallel solver. This UDF works using Fluent serial solver but it doesn't work anymore when I choose the parallel solver. Could anybody help me to rewrite this "Define Profile" UDF for Fluent parallel solver?

Thanks

Antoine

---------------------------------------------------------

#include "udf.h"

DEFINE_PROFILE(parabole,thread,nv)

{

real x[ND_ND];

real r ;

real vmax ;

face_t f;

begin_f_loop (f,thread)

{ r=10;

vmax=0.001;

F_CENTROID(x,f,thread);

F_PROFILE(f,thread,nv)=vmax*(1.-((x[1]*x[1])/(r*r)));

}

end_f_loop(f,thread)

}
  Reply With Quote

Old   February 7, 2007, 00:15
Default Re: "Define_Profile" UDF for parallel solver
  #2
py
Guest
 
Posts: n/a
you should modify this udf for parallel solver...see fluent udf help
  Reply With Quote

Old   February 7, 2007, 02:33
Default Re: "Define_Profile" UDF for parallel solver
  #3
Bogdan
Guest
 
Posts: n/a
try like this:

#include "udf.h"

DEFINE_PROFILE(parabole,thread,nv)

{

#if !RP_HOST

real x[ND_ND];

real r ;

real vmax ;

face_t f;

begin_f_loop (f,thread)

{ r=10;

vmax=0.001;

F_CENTROID(x,f,thread);

F_PROFILE(f,thread,nv)=vmax*(1.-((x[1]*x[1])/(r*r)));

}

end_f_loop(f,thread)

#endif

}
  Reply With Quote

Old   February 7, 2007, 13:04
Default Re: "Define_Profile" UDF for parallel solver
  #4
Antoine
Guest
 
Posts: n/a
Thank you very much for your answer. I tried the udf you send but I still have the error below from Fluent, even if the udf has been compiled without problem (sorry, part of the message is in french; it means that Fluent doesn't find the path to udf library). Do you have an idea of its origin?

Opening library "libudf"... Primitive Error at Node 0: open_udf_library: Le chemin d'accès spécifié est introuvable.

Primitive Error at Node 1: open_udf_library: Le chemin d'accès spécifié est introuvable.

Error: open_udf_library: Le fichier spécifié est introuvable.

Error Object: #f

Thank you for your help

Antoine
  Reply With Quote

Old   February 7, 2007, 13:31
Default Re: "Define_Profile" UDF for parallel solver
  #5
Bogdan
Guest
 
Posts: n/a
check the following folder libudf/lnx86 you should have a 3d_host, 3d_node and a 3d folders (if you are using the 3d version of fluent). if youd don't see this three directories, what you can do is either make the directories 3d_host and 3d_node go back one level (now you are in the libudf directory) and launch the following commands:

touch src/*

make "FLUENT_ARCH=lnx86" (assuming you are using the linux version of FLUENT)

Then try again the parallel case.

The second way is to launch the parallel version of fluent, read your case and data and recompile the UDF.

Hope this help

  Reply With Quote

Old   February 9, 2007, 20:09
Default Re: "Define_Profile" UDF for parallel solver
  #6
Antoine
Guest
 
Posts: n/a
Sorry to give an answer so late... Thank you for you answer, it guided me toward the solution. I'm running Fluent on Window and the compilation with the multiprocessor machine wasn't complete because the environment variable for the "sed" command wasn't defined. I finally tried to compile manually the udf as you suggested me, and as I didn't find how to define the environment variable for the sed command, I simply copied the sed.exe (which is located in the same file as the fluent.exe) to each udf file (3d_host and 3d_node) to compile. The command nmake permitted then to compile without problem.

Thank you Bogdan for having helped me to solve successfully my problem.

Best regards

Antoine
  Reply With Quote

Old   February 5, 2012, 03:36
Default How to define velocity profile
  #7
New Member
 
Hamdi
Join Date: Oct 2011
Posts: 3
Rep Power: 15
hamdiengizanganah is on a distinguished road
Dear users
I would like to ask you how can I define the velocity profile and temperature profile at the ilet by defining the V profile equation and T profile equation? I read something about the UDF but how, I don't know?
Is there any helper?
TQ so much
hamdiengizanganah is offline   Reply With Quote

Old   February 26, 2013, 05:22
Default
  #8
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 16
Kanarya is on a distinguished road
Hi Bogdan,

I am using DEFINE_EXECUTE_AT_END in parallel to save outlet flow but it doesnt work properly.in serial I dont have any problem do you think it is because of the function or there is other reason?

thanks in advance!!

Kanarya
Quote:
Originally Posted by Bogdan
;138938
check the following folder libudf/lnx86 you should have a 3d_host, 3d_node and a 3d folders (if you are using the 3d version of fluent). if youd don't see this three directories, what you can do is either make the directories 3d_host and 3d_node go back one level (now you are in the libudf directory) and launch the following commands:

touch src/*

make "FLUENT_ARCH=lnx86" (assuming you are using the linux version of FLUENT)

Then try again the parallel case.

The second way is to launch the parallel version of fluent, read your case and data and recompile the UDF.

Hope this help
Kanarya is offline   Reply With Quote

Old   June 23, 2015, 11:23
Default
  #9
Member
 
Lida
Join Date: Apr 2015
Posts: 39
Rep Power: 11
chem engineer is on a distinguished road
Hi
I have the same problem with compiling my UDF. I can compile it in series mode but not in parallel mode. I don't know how to modify it. i will be thankful if anyone could help me do it. my UDF is as follows:


#include "udf.h"
#include "math.h"
DEFINE_PROFILE(unsteady_velocity_profile, t, i)
{
real current_time;
real x[ND_ND];
real y;
real z;
real a;
real n;
real Umax;
real Umean;
real R;
face_t f;
current_time = CURRENT_TIME;
begin_f_loop(f, t)
{
F_CENTROID(x,f,t);
y=x[1];
z=x[2];
n=7;
R=0.254; /* m */
Umean=10; /* m/s */
Umax=Umean*(((n+1)*(2*n+1))/(2*pow(n,2)));
a=pow((pow(y,2)+pow(z,2)),0.5);
if (current_time < 10)
{
F_PROFILE(f,t,i)=Umax*pow((1-sqrt(pow(z,2)+pow(y,2))/R),(1/n));
}
else
{
F_PROFILE(f,t,i)=0;
}
}
end_f_loop(f, t)
}
chem engineer is offline   Reply With Quote

Old   February 29, 2016, 07:09
Default
  #10
New Member
 
s.p.gupta
Join Date: Dec 2015
Posts: 3
Rep Power: 10
shri2802 is on a distinguished road
#include "udf.h"
#include "math.h"
DEFINE_PROFILE(unsteady_velocity_profile, t, i)
{
real current_time;
real x[ND_ND];
real y;
real z;
real a;
real n;
real Umax;
real Umean;
real R;
face_t f;
n=7;
R=0.254; /* m */
Umean=10; /* m/s */
current_time = CURRENT_TIME;
# if RP_NODE
begin_f_loop(f, t)
{
F_CENTROID(x,f,t);
y=x[1];
z=x[2];

Umax=Umean*(((n+1)*(2*n+1))/(2*pow(n,2)));
a=pow((pow(y,2)+pow(z,2)),0.5);
if (current_time < 10)
{
F_PROFILE(f,t,i)=Umax*pow((1-sqrt(pow(z,2)+pow(y,2))/R),(1/n));
}
else
{
F_PROFILE(f,t,i)=0;
}
}
end_f_loop(f, t)
#endif
}

It might work,
shri2802 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
Getting too many iterations by velocity solving (aborting). Changing U - Solver? suitup OpenFOAM Running, Solving & CFD 0 January 20, 2010 08:45
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 15:08
DEFINE_GEOM UDF Problems Pat FLUENT 0 August 14, 2003 14:16
Error during Solver cfd guy CFX 4 May 8, 2001 07:04
UDF : Chemical Reaction in Catalytic Converter adhimac FLUENT 1 March 27, 2001 15:04


All times are GMT -4. The time now is 14:53.