CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

3D udf parabolic inlet bc

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2016, 19:50
Red face 3D udf parabolic inlet bc
  #1
New Member
 
Hussam boujjat
Join Date: Jun 2016
Posts: 5
Rep Power: 9
houssame222 is on a distinguished road
Hi, As I just started using fluent, I am looking for someone who has or at least can help me to turn this code into a 3D code, In fact, I have found the 2D parabolic profile but as my simulation are in 3D, I will need a 3D profil ...

/* vprofile.c */
/* UDF for specifying steady-state velocity profile boundary condition */
/************************************************** *********************/
#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)
}

Thanking you ..
houssame222 is offline   Reply With Quote

Old   June 15, 2016, 22:47
Default
  #2
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
It is not very complicated. I can't give you a complete answer, because I don't know how your inlet is oriented. I've made a few changes to your code. Xf[] is the face centroid vector. x,y,z are the coordinates picked out of that vector. So, that is easy access to your location data. Then you just need to change the F_PROFILE function line to match your boundary conditions using the x, y, and/or z coordinates.
Code:
/* vprofile.c */
/* UDF for specifying steady-state velocity profile boundary condition */
/***********************************************************************/
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real Xf[ND_ND]; /* this will hold the position vector */
real x,y,z;
face_t f;
begin_f_loop(f, thread)
  {
  F_CENTROID(Xf,f,thread);
  x = Xf[0];
  y = Xf[1];
  z = Xf[2];
  F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20 - z*z/(....);
  }
end_f_loop(f, thread)
}
mprinkey is offline   Reply With Quote

Old   June 16, 2016, 03:32
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
It is not clear to me if you have a full confined 3D inflow or a 2D profile to repeat periodically in spanwise direction
FMDenaro is offline   Reply With Quote

Old   June 16, 2016, 08:27
Default
  #4
New Member
 
Hussam boujjat
Join Date: Jun 2016
Posts: 5
Rep Power: 9
houssame222 is on a distinguished road
Quote:
Originally Posted by mprinkey View Post
It is not very complicated. I can't give you a complete answer, because I don't know how your inlet is oriented. I've made a few changes to your code. Xf[] is the face centroid vector. x,y,z are the coordinates picked out of that vector. So, that is easy access to your location data. Then you just need to change the F_PROFILE function line to match your boundary conditions using the x, y, and/or z coordinates.
Code:
/* vprofile.c */
/* UDF for specifying steady-state velocity profile boundary condition */
/***********************************************************************/
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real Xf[ND_ND]; /* this will hold the position vector */
real x,y,z;
face_t f;
begin_f_loop(f, thread)
  {
  F_CENTROID(Xf,f,thread);
  x = Xf[0];
  y = Xf[1];
  z = Xf[2];
  F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20 - z*z/(....);
  }
end_f_loop(f, thread)
}
I thank you for your answer, indeed, my inlet is normal to the x direction and the profile of the velocity vectors is depending just on z that means that it is a 2D flow in 3D geometry
I have this but it still doesn't work ...

/* vprofile.c */
/* UDF for specifying steady-state velocity profile boundary condition */
/************************************************** *********************/
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND];
real z;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z = x[2]-0.6095;
F_PROFILE(f, thread, position) = 20*(1.0 - z * z / (0.6095*0.6095));
}
end_f_loop(f, thread)
}
houssame222 is offline   Reply With Quote

Old   June 16, 2016, 08:30
Default
  #5
New Member
 
Hussam boujjat
Join Date: Jun 2016
Posts: 5
Rep Power: 9
houssame222 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
It is not clear to me if you have a full confined 3D inflow or a 2D profile to repeat periodically in spanwise direction
Hi, Denaro, thank you for ur answer, indeed, it is a 2D profile in a 3D geometry, as I said, I inlet is normal to the x direction and the velocity depends on z,
/* vprofile.c */
/* UDF for specifying steady-state velocity profile boundary condition */
/************************************************** *********************/
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND];
real z;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z = x[2]-0.6095;
F_PROFILE(f, thread, position) = 20*(1.0 - z * z / (0.6095*0.6095));
}
end_f_loop(f, thread)
}

it still doesn't want to work I don't have a parabolic profile at the inlet and I don't understand why,
for the inlet, it is defined between z=0 to z=1.2
I really don't know why..
houssame222 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 Unsteady velocity parabolic profile Rashad FLUENT 3 October 1, 2018 15:27
3D velocity inlet UDF zumaqiong Fluent UDF and Scheme Programming 2 October 24, 2016 04:44
UDF fluent:Change boundary condition. determination inlet and outlet boundary in "t" gzamiri@gmail.com FLUENT 0 September 27, 2015 05:32
Parabolic Inlet velocity UDF parse error Musa Fluent UDF and Scheme Programming 1 August 29, 2012 01:37
simpleFoam Blows up with Parabolic Inlet Pipe Flow swahono OpenFOAM 0 December 6, 2010 19:37


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