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

3D velocity profile UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By ghost82
  • 1 Post By ghost82

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 16, 2012, 18:31
Default 3D velocity profile UDF
  #1
New Member
 
Hadi
Join Date: Nov 2012
Location: Netherlands
Posts: 2
Rep Power: 0
hadiCFD is on a distinguished road
Hi guys

I would like to define a 3D velocity profile but I don't know how. I read lots of 2D examples, but I am still confused about 3D. Is there any one who can help me?
It is one of the samples for 2D How can I add the third dimension to this code?

The desired velocity is
Vz = (1-(x^2+y^2)/25)

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
face_t f;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20.;
}
end_f_loop(f, thread)
}
hadiCFD is offline   Reply With Quote

Old   November 17, 2012, 05:46
Default
  #2
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
Quote:
Originally Posted by hadiCFD View Post
Hi guys

I would like to define a 3D velocity profile but I don't know how. I read lots of 2D examples, but I am still confused about 3D. Is there any one who can help me?
It is one of the samples for 2D How can I add the third dimension to this code?

The desired velocity is
Vz = (1-(x^2+y^2)/25)

I think this should work:

Code:
#include "udf.h"

DEFINE_PROFILE(my_velocity, thread, position)
{
  face_t f;
  real x[ND_ND];

  begin_f_loop(f, thread)
    {
    F_CENTROID(x,f,t);
    F_PROFILE(f, thread, position) = (1.-(x[0]*x[0]+x[1]*x[1])/25.);
    }
  end_f_loop(f, thread)
}
Verify the position of your geometry; as an example I centered a parallelepiped in 0,0,0.
Attached Images
File Type: jpg 1.jpg (52.8 KB, 27 views)
hadiCFD likes this.

Last edited by ghost82; November 17, 2012 at 06:40.
ghost82 is offline   Reply With Quote

Old   November 18, 2012, 08:23
Default
  #3
New Member
 
Hadi
Join Date: Nov 2012
Location: Netherlands
Posts: 2
Rep Power: 0
hadiCFD is on a distinguished road
Thank you ghost82
How can I verify the position of my geometry?

I upload my geometry. Thank you

hadiCFD is offline   Reply With Quote

Old   November 18, 2012, 10:03
Default
  #4
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
Quote:
Originally Posted by hadiCFD View Post
Thank you ghost82
How can I verify the position of my geometry?

I upload my geometry. Thank you
Imagine this simple example: a parallelepiped with its base centered in xy plane (figure on the left) and a parallelepiped not centered in the xy plane (figure on the right); imagine also that this base is the inlet velocity.

Your Vz velocity is a function of x and y coordinate, so each of the two cases will have different profiles, because x and y coordinates are different; according to this, you have to take into account the position of your inlet face in respect to the origin;

Eventually, you can translate your geometry in pre-processing, or alternatively you can modify your Vz formula, considering a translation transformation.

Daniele
Attached Images
File Type: png Immagine.png (7.3 KB, 16 views)
hadiCFD likes this.
ghost82 is offline   Reply With Quote

Old   December 4, 2012, 02:32
Default
  #5
New Member
 
jianglei
Join Date: May 2012
Location: xiamen
Posts: 12
Rep Power: 14
dragonship2011 is on a distinguished road
ghost82,
I have a question to ask for you .In a non-regulation shape, for example ,ships , how can I get the center of gravity and buoyant coordinates in the Fluent software ?
Please help me.
Regards
dragonship2011 is offline   Reply With Quote

Old   December 4, 2012, 02:32
Default
  #6
New Member
 
jianglei
Join Date: May 2012
Location: xiamen
Posts: 12
Rep Power: 14
dragonship2011 is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
Imagine this simple example: a parallelepiped with its base centered in xy plane (figure on the left) and a parallelepiped not centered in the xy plane (figure on the right); imagine also that this base is the inlet velocity.

Your Vz velocity is a function of x and y coordinate, so each of the two cases will have different profiles, because x and y coordinates are different; according to this, you have to take into account the position of your inlet face in respect to the origin;

Eventually, you can translate your geometry in pre-processing, or alternatively you can modify your Vz formula, considering a translation transformation.

Daniele
ghost82,
I have a question to ask for you .In a non-regulation shape, for example ,ships , how can I get the center of gravity and buoyant coordinates in the Fluent software ?
Please help me.
Regards
dragonship2011 is offline   Reply With Quote

Old   December 5, 2012, 04:13
Default
  #7
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
Quote:
Originally Posted by dragonship2011 View Post
ghost82,
I have a question to ask for you .In a non-regulation shape, for example ,ships , how can I get the center of gravity and buoyant coordinates in the Fluent software ?
Please help me.
Regards
Hi,
specify in details your problem, you may better open a new thread.
ghost82 is offline   Reply With Quote

Old   December 5, 2012, 06:39
Default
  #8
New Member
 
jianglei
Join Date: May 2012
Location: xiamen
Posts: 12
Rep Power: 14
dragonship2011 is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
Hi,
specify in details your problem, you may better open a new thread.
hi,thank you very much for reply. You know , A ship is running in the water,it is carried by buoyant .In the software of Fluent ,how can I get the center coordinate of buoyant .
dragonship2011 is offline   Reply With Quote

Old   December 5, 2012, 10:16
Default
  #9
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
Quote:
Originally Posted by dragonship2011 View Post
hi,thank you very much for reply. You know , A ship is running in the water,it is carried by buoyant .In the software of Fluent ,how can I get the center coordinate of buoyant .
ok understand, but unfortunately I haven't an answer..
ghost82 is offline   Reply With Quote

Old   December 5, 2012, 20:29
Default
  #10
New Member
 
jianglei
Join Date: May 2012
Location: xiamen
Posts: 12
Rep Power: 14
dragonship2011 is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
ok understand, but unfortunately I haven't an answer..
thank you all the same.
dragonship2011 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 problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 11:38
Velocity profile UDF egge24 Fluent UDF and Scheme Programming 2 May 10, 2012 14:03
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 20:09
How to specify the Velocity profile (eqn) by UDF Anant FLUENT 1 February 27, 2008 15:54
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47


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