|
[Sponsors] |
UDF Parabolic Inlet Profile for Multiple Inlets |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2021, 08:46 |
UDF Parabolic Inlet Profile for Multiple Inlets
|
#1 |
New Member
Luis
Join Date: Dec 2021
Location: Santander
Posts: 6
Rep Power: 5 |
Hi!
I'm trying to simulate a water tank which has multiple inlets and applying to them a UDF to specify a parabolic inlet profile. The problem comes while calculating the distance from any point of the inlets surface to its centre because the inlets are not in point (0,0,0). I'm using a 3D version of the 2D example found in Fluent Manual: /************************************************** *********************/ /* 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) } I assume that I could change y = x[1] to y = x[1] - x0, being x0 the centre of every inlet. However, since I almost have 200 inlets it would be something very annoying if I do it manually. Could anyone give me a hint for obtaining the centre of each of the inlets automatically so I can easily make it work? Thank you everybody in advance! |
|
December 15, 2021, 18:53 |
|
#2 |
New Member
Chris
Join Date: Mar 2021
Posts: 23
Rep Power: 5 |
You know you can just attach a velocity profile without using a UDF? You can also use expressions. I would look into just using the profile. Solve the fully developed flow in a single inlet separate model. Then take that profile data at the boundary and apply it to all your inlets. Also you are using 3D so you would need a conical velocity inlet as parabolic is 2D. Thats going to be more challenging to implement in a UDF...
https://www.youtube.com/watch?v=DQYlnsAfs5s |
|
December 16, 2021, 04:50 |
|
#3 |
New Member
Luis
Join Date: Dec 2021
Location: Santander
Posts: 6
Rep Power: 5 |
Thank you for your reply!
Expressions have the same problem as UDF, you need to know the centre of each inlet in order to have the X,Y and Z coordinates relative to the centre of each inlet, right? I guess the same problem would arise while mapping the inlet with the Velocity Profile since position changes for each inlet. Regarding the conic inlet for 3D case, it is just straight forward to implement it based on the 2D UDF shown in the Fluent UDF Guide and it works properly for a simple geometry (e.g. one pipe). |
|
December 16, 2021, 06:17 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Something like this might work: calculate the average position in the UDF.
real ysum=0, yavg; int ycount=0; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; ysum +=y; ++ycount; } end_f_loop(f, thread) } yavg=ysum/ycount; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]-yavg; F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20.; } end_f_loop(f, thread) } I did not test it and wrote it on my phone, so typos might be there. This calculates the average position giving each face the same weight. It's better to make the weight proportional to the area. But if your mesh is not too weird, the error should be very small.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
December 21, 2021, 12:52 |
|
#5 | |
New Member
Luis
Join Date: Dec 2021
Location: Santander
Posts: 6
Rep Power: 5 |
Quote:
Best regards |
||
Tags |
#fluent, #parabolicprofileinlet, #udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
static Pressure profile using udf at velocity inlet | vivek123 | Fluent UDF and Scheme Programming | 0 | September 22, 2021 15:44 |
UDF parabolic velocity profile issue | Kenzhia3310 | FLUENT | 3 | April 7, 2020 12:20 |
UDF Parabolic 2D Velocity Profile Issue | chrislyn | FLUENT | 2 | December 11, 2018 13:11 |
UDF 2D inlet profile | Thomashoffmann | Fluent UDF and Scheme Programming | 3 | January 17, 2013 04:38 |
UDF writing: parabolic profile | Kwiaci | Fluent UDF and Scheme Programming | 11 | June 5, 2012 11:13 |