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

Parabolice velocity profile for multiple inlet structure

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2023, 07:26
Default Parabolice velocity profile for multiple inlet structure
  #1
New Member
 
seo
Join Date: Nov 2023
Posts: 2
Rep Power: 0
SeoYeonKim is on a distinguished road
Hello, I am new to FLUENT and currently working on fluid simulation with the model consists of multiple inlets and outlets.

I'm trying to apply parabolic velocity profile of a laminar flow using the below UDF code and keep failing it.
-----------------------------------------------------------------------
#include "udf.h"
#include <math.h>


DEFINE_PROFILE(parabolic_flow,t,i) /* t = therad, i = position */
{
real x[3];
real r, Umax;
real Umean = 150;
real R =0.3;
face_t f;

Umax = 2 * Umean;
r = sqrt(pow(x[0],2)+pow(x[1],2)+pow(x[2],2));

begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
F_PROFILE(f,t,i) = Umax * (1 - (pow(r,2)/pow(R,2)));
}
end_f_loop(f,t)
}
--------------------------------------------------------------------------
please look through the code and any help will be appreciated.

Thank you in advance
SeoYeonKim is offline   Reply With Quote

Old   November 29, 2023, 20:33
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
r = sqrt(pow(x[0],2)+pow(x[1],2)+pow(x[2],2));
should be inside the loop
SeoYeonKim likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   December 2, 2023, 07:02
Default
  #3
New Member
 
seo
Join Date: Nov 2023
Posts: 2
Rep Power: 0
SeoYeonKim is on a distinguished road
Thank you for the reply

Now I'm testing the code with a simple cylinder structure but keep getting the velocity contour as below, literally similar to the flat velocity profile rather than parabolic velocity profile.. (I've used low enough velocity to apply laminar flow )

I believe if I apply parabolic velocity profile, contour inside the cylinder should be red in the middle and gradually become blue as it reaches the boundary layer unlike the figure below.

would this be the problem resulted due to the code or any setting that I'm using for the simulation?
Attached Images
File Type: png figure1.png (96.7 KB, 4 views)
SeoYeonKim is offline   Reply With Quote

Reply

Tags
laminar flow, parabolic inlet, udf code


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
combining parabolic inlet velocity profile with time varying velocity vector values jawapasu OpenFOAM 3 July 10, 2023 06:41
UDF - Inlet Velocity Profile (Ansys Fluent) vinayak4399 Fluent UDF and Scheme Programming 3 August 25, 2020 15:15
Velocity inlet BC profile antonio.c FLUENT 1 November 1, 2017 15:22
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 12 August 7, 2017 07:25
Export & Import Velocity profile as Inlet eRzBeNgEl STAR-CCM+ 6 March 26, 2012 06:16


All times are GMT -4. The time now is 01:40.