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

3d parabolic Velocity profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2015, 15:54
Default 3d parabolic Velocity profile
  #1
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
Hello i have written a code for 3-d velocity profile at an inlet.But when i interpret the code it give me the following error:

cpp -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.7/src" -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.7/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.7/client/src" -I"C:\PROGRA~1\ANSYSI~1\v150\fluent\fluent15.0.7/multiport/src" -I. -DUDF
ONFIG_H="<udfconfig-host.h>" "C:\Working\jet.c"
Error: C:\\Working\\jet.c: line 13: subscripted expression is not an array or pointer: double.

Can any one suggest me the solution for it,It will be a huge favor to me thanks.

COde is as following:

#include "udf.h"

DEFINE_PROFILE(inlet_z_velocity, thread, index)
{
real z[ND_ND]; /* this will hold the position vector */
real x;
real y;
real a,n;
real Umax,Umean;
face_t f;
begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/
{
F_CENTROID(x,f,thread);
x =z[1];
y =z[1];

n = 7;
d = 0.001; /* m */
Umean = 15; /* m/s */

Umax = Umean*(((n+1)*(2*n+1))/(2*pow(n,2)));
a = pow((pow(y,2)+pow(z,2)),0.5);
F_PROFILE(f, thread, index) =-1(Umax*pow(1-sqrt(pow(x,2)+pow(y,2))/(d/2),(1/n)));
}
end_f_loop(f, thread)
}
mohibanwar is offline   Reply With Quote

Old   May 24, 2015, 18:17
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You've mixed up the position variables (possibly from copying the code over from a 2-D case), specifically:
  1. You've declared "z" as an array but used your variable "x" for the F_CENTROID macro.
  2. You're assigning the same position dimension to both your "x" and "y" variables (using "z[1]").

Try using another array for your position vector to avoid confusion, for example:
Code:
real posVector[ND_ND];
real x, y, z;
...
F_CENTROID(posVector,f,thread);
x = posVector[0];
y = posVector[1];
z = posVector[2];
`e` is offline   Reply With Quote

Old   May 25, 2015, 10:29
Default
  #3
Member
 
Mochibaru
Join Date: Jan 2015
Location: Japan
Posts: 41
Rep Power: 11
mohibanwar is on a distinguished road
Quote:
Originally Posted by `e` View Post
You've mixed up the position variables (possibly from copying the code over from a 2-D case), specifically:
  1. You've declared "z" as an array but used your variable "x" for the F_CENTROID macro.
  2. You're assigning the same position dimension to both your "x" and "y" variables (using "z[1]").

Try using another array for your position vector to avoid confusion, for example:
Code:
real posVector[ND_ND];
real x, y, z;
...
F_CENTROID(posVector,f,thread);
x = posVector[0];
y = posVector[1];
z = posVector[2];
Hello Respected Senior Member"e",
I am really thankful to you for your help and i really appreciate you to Answer our irritating immature posts as we are new users to the Fluent UDF programming and after your guidance and suggestions i have change my code but there are last error while compiling kindly figure it out what is the problem in it.Thanks

Error is,
..\..\src\modi1.c(22) : error C2064: term does not evaluate to a function taking -1000 arguments

May be it is in the 22 line of program as i already expected as i have change this according to my case.Kindly check my program once agian.I will be very thankful to you.
My modified code is;

#include "udf.h"
DEFINE_PROFILE(inlet_z_velocity, thread, index)
{
real posVector[ND_ND]; /* this will hold the position vector */
real x, y, z;
real a,n,d;
real Umax,Umean;
face_t f;
begin_f_loop(f, thread) /*loops over all faces in the thread passed in the DEFINE macro argument*/
{
F_CENTROID(posVector,f,thread);
x = posVector[0];
y = posVector[1];
z = posVector[2];

n = 7;
d = 0.001; /* m */
Umean = 15; /* m/s */

Umax = Umean*(((n+1)*(2*n+1))/(2*pow(n,2)));
a = pow((pow(x,2)+pow(y,2)),0.5);
F_PROFILE(f, thread, index) =-1(Umax*pow(1-sqrt(pow(x,2)+pow(y,2))/(d/2),(1/n)));
}
(PROBLEM IS HERE)
end_f_loop(f, thread)
}
mohibanwar is offline   Reply With Quote

Old   May 25, 2015, 19:02
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You've forgotten the multiplication operator "*" after the "-1". The outer brackets and "1" are unnecessary; try:

Code:
F_PROFILE(f, thread, index) = -Umax*pow(1-sqrt(pow(x,2)+pow(y,2))/(d/2),(1/n));
`e` 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
UDF for 3d inlet parabolic velocity profile ? shahzeb irfan Fluent UDF and Scheme Programming 10 March 28, 2016 15:00
unable to get parabolic velocity profile with pimplefoam houkensjtu OpenFOAM 4 October 8, 2012 04:41
Parabolic Profile of velocity Robbb FLUENT 5 October 1, 2012 07:03
Simulation with UDF for species mass fraction and velocity profile virgy Fluent UDF and Scheme Programming 8 February 7, 2012 04:30
Prescribed inflow velocity profile - how to? Alan Main CFD Forum 10 October 28, 2005 12:14


All times are GMT -4. The time now is 11:35.