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

3D Inlet Profile UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2020, 07:27
Question 3D Inlet Profile UDF
  #1
New Member
 
Join Date: Sep 2020
Posts: 2
Rep Power: 0
Meicoomon101 is on a distinguished road
Hi everyone,

I am currently trying to create a UDF that creates an inlet profile that mimics the equation (x^2 + z^2), but will also need to have other profiles which change the apex of the parabola (i.e. shift apex up or down a select height). I have gone through various ANSYS manuals to try and understand and create one. However, I have had no success thus far. Attached are the codes which I have used based on various research into this matter as well as photo's of the vectors that come out from each respective code once the simulation was run and the global coordinate (for reference to the axis directions). Any help is greatly appreciated.
Attached Images
File Type: jpg Code101 - Inlet Vectors.jpg (35.7 KB, 16 views)
File Type: jpg Code204 - Inlet Vectors.jpg (41.6 KB, 13 views)
File Type: png Inlet with Global coordinate.PNG (26.2 KB, 12 views)
Attached Files
File Type: c Code101.c (518 Bytes, 13 views)
File Type: c Code204.c (491 Bytes, 17 views)
Meicoomon101 is offline   Reply With Quote

Old   September 10, 2020, 12:08
Default
  #2
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
The easiest way does not requiere UDF:
Create some extra mesh at the entrance of your geometry, meaning that you can extrude the mesh in your inlet, creating an "auxiliar cilinder" before your inlet. This "pre inlet" will develop your flow, and by the time it reaches your inlet, velocity flow will be already developed in a parabolic flow. This cilinder (I see from your pictures your inlet is a circle, so your "pre inlet will be a cilinder) must be long enough to develop your fluid. Theoretically, you can obtain an estimation of the lenght of the entrance region using the number of Graetz, for example, but I will recomend you to just use a lenght of around 5 or 10 times the diameter of your inlet. You can use the same idea in your outlet.

If you don't like my solution, another way for your particular case is to make your velocity profile as a function of the distance to the wall, with the function C_WALL_DIST(c,t). Note this is a function of a cell, and not a face like you want in your code. Just make it work.

Greetings.
upeksa is offline   Reply With Quote

Old   September 13, 2020, 21:52
Default
  #3
New Member
 
Join Date: Sep 2020
Posts: 2
Rep Power: 0
Meicoomon101 is on a distinguished road
Quote:
Originally Posted by upeksa View Post
The easiest way does not requiere UDF:
Create some extra mesh at the entrance of your geometry, meaning that you can extrude the mesh in your inlet, creating an "auxiliar cilinder" before your inlet. This "pre inlet" will develop your flow, and by the time it reaches your inlet, velocity flow will be already developed in a parabolic flow. This cilinder (I see from your pictures your inlet is a circle, so your "pre inlet will be a cilinder) must be long enough to develop your fluid. Theoretically, you can obtain an estimation of the lenght of the entrance region using the number of Graetz, for example, but I will recomend you to just use a lenght of around 5 or 10 times the diameter of your inlet. You can use the same idea in your outlet.

If you don't like my solution, another way for your particular case is to make your velocity profile as a function of the distance to the wall, with the function C_WALL_DIST(c,t). Note this is a function of a cell, and not a face like you want in your code. Just make it work.

Greetings.

Thanks for your response upeksa. Your first solution seems ideal, however, I was asked to use UDF's, so I can not use the first solution. I will try your second solution soon when I get the chance and post the results.

Thanks.
Meicoomon101 is offline   Reply With Quote

Old   September 16, 2020, 10:00
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
logic in your second UDF is correct.
Just find equation which fits with your coordinate system
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
[OLAFLOW] The OLAFLOW Thread Phicau OpenFOAM Community Contributions 459 September 12, 2024 12:47
(ask) how to create UDF for inlet velocity profile sincity Fluent UDF and Scheme Programming 83 May 16, 2022 14:04
UDF - Inlet Velocity Profile (Ansys Fluent) vinayak4399 Fluent UDF and Scheme Programming 3 August 25, 2020 15:15
UDF parbolic inlet velocity profile for 3D channel flow. srv537 FLUENT 0 August 6, 2016 03:21
How to apply an outlet velocity profile to another inlet? siw FLUENT 4 April 10, 2013 12:19


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