![]() |
(ask) how to create UDF for inlet velocity profile
hi all
i have a question what should i do if i wanna go to use UDF for my inlet velocity profile 3D case how can i define it just a simple question, hope it will be answered by you.regards |
Hi,
refer to DEFINE_PROFILE macro in UDF-manual. |
hi amir thanks for attention
actually the UDF manual is not helping me at all because i want to create UDf for 3D case inlet velocity profile, but i dont know how to define the velocity function in 3D vector (x,y,z) maybe you have some tutorial or case example??regards. |
Hi Wibi,
here's a example for fully developed flow in a pipe: Code:
#include "udf.h" |
mmm...is it UDF for 3D case amir??
|
Quote:
you can also define three UDFs for each velocity components that are similar to above. it depends on the method that you want to set velocity in B.C. panel; magnitude normal or components. |
amir my friend,
i am very confuse about what were you talking about, since i'm new user for UDF so i hope you have more time to explain about this topic. amir in defining UDF should i plot my velocity data first to get the function or just go straight use your UDF example that you gave to me? please answer.regards |
Ok,
first you should decide what kind of velocity declaration you want to use.(in B.C. panel) e.g. you can use velocity magnitude normal to plane or setting individual velocity components. without UDF, you can set constant values for them in GUI. but for your case that three components change with coordinates(I think), you should write 3 UDF for velocity components and declare them as functions of x,y,z and hook them in respective places. it's obvious that you should have velocities as functions of x,y,z. if you post your velocity function, I may help you more. regards, Amir |
its going converging.. my question is i have no idea about that velocity function, that's what i want to talk about you. how can i extract my own velocity function, especially in my 3D case??
|
if your inlet velocity profile is obtained from another FLUENT calculation, it's easy to handle. else you need to use other post processing softwares like MATLAB or others to fit functions to them and then use obtained functions in UDFs.
|
could i just adapting the function from another velocity function and put it on my UDF??maybe your function? or maybe any general form of function that i could use
|
you can use any forms of explicit functions in UDfs.
e.g.: V_x=V_x(x,y,z),.... |
Quote:
|
Quote:
you can use (file->write->profile) in your previous results and the use (file->read->profile) in new case. (for more info, refer to manual) Bests, |
Hi,
My project is to perform CFD analysis on dissecting aneurismal aorta. I have to create pulsatile inlet velocity and pulsatile outlet pressure waveform at inlet and outlet of the aorta respectively. The example of pulsatile inlet velocity is as shown in the link below http://www.google.com.my/imgres?q=Ti...Wl_WbBw&zoom=1 May I know how to define this type of graph using UDF? Thank you so much |
Quote:
you have 2 choices: 1) you can prepare a file with special format which defines desires parameter at different time; it this method, you cannot specify spacial variation. (you can find further explanation in manual in setting unsteady BCs) 2) you can fit functions for different segments and write a UDF for it; this method doesn't have ant restrictions in special declaration. Bests, |
2) you can fit functions for different segments and write a UDF for it; this method doesn't have ant restrictions in special declaration.
May I know in details what is mean by fir functions for different segments and write a UDF for it? Thank you. REgards, Naimah |
Quote:
Bests, |
Hi Amir,
May I know how to do post processing in FLUENT? For example I would like to see the plotted graph (pressure/velocity) vs time. Besides, how to get the data for cross sectional area at certain parts of geometry at certain time? Thank you. Regards, Naimah |
Quote:
It depends, e.g. if you want to have pressure or velocity in a specified point, you can use "solve->monitor->surface ...."; if you didn't activate it before iteration, you have to write a simple journal file for this purpose. For extracting data of cross-sections; firstly you need to generate these cross-sections in "surface->quadratic or plane" then you can export desired data to other post processors in "file->export". But if you want to export these data for successive time steps; you have to choices: 1) there is such capability in ver. 13 in "file-> export" I think. 2) you can write a journal file to do what you want during iteration. Bests, |
Quote:
Dear Amir, Thank you for the info. Since I m a new user of FLUENT, may I know how to get to this command "surface->quadratic or plane" Is this thing read the result at the cross section? Besides, what is mean by read to journal file? I have tried to read data at certain interval that I set up. However, It come out with a lot of nodes number at 1 time interval. may I know how to extract this data? Thank you so much for your help. Regards, Naimah |
Quote:
Quote:
Bests, |
Quote:
My project is to perform CFD simulation for aortic dissecting aneurysm. I would like to see what happen in the geometry at particular time and location (cross section). To see how it changes from certain time to time. Therefore, I need to see the plot at different part of the aorta. Thank you Regards, Naimah |
Quote:
Bests, |
Dear Amir,
Thank you so much for the info. I still working on it. However, may i ask you question regarding how fluent function? Based on tutorial 4 : modeling compressible transient flow A steady state solution is run first before it used as the initial condition for transient. In the tutorial, after simulation for steady state is done, the next steps is to change the time from steady to transient. May I know how the software function/how the software read the result from steady state solution to be used as input/initial condition for transient simulation. I believe it is not just a simple click by changing the steady to transient. Thank you. Regards, Naimah |
Quote:
In contrast to your belief, it's done by simply changing steady to unsteady solver in current case. ;) I other words, FLUENT uses any data stored in computational domain which can be provided via direct initialization or any previous simulations as initial condition .... (Also, you can use results of one case for initialization of other case; for this purpose, you need to use "file->interpolate") Bests, |
Dear Amir,
Thank you so much for the info. I have another questions regarding the Fluent. 1. I have set the value at inlet boundary condition at : velocity inlet : 0.175 m/s At the solution initialization when I click compute from inlet, it will give diffrence value: Initial value: Gauge pressure : 0 Pa X velocity :- 0.036 m/s Y velocity: -0.0053 m/s Z velocity : 0.165821 m/s Why it give difference value? Are these value initial guess calculated by the Fluent? 2. Can I used different types of Solution methods for transient and steady case for the same case: Transient : PISO and second order upwind Steady : SIMPLE and first order upwind REgards, Naimah |
Hi,
1) Maybe you've set the velocity magnitude normal to the boundary and FLUENT computes its projections in required direction. I don't think this would be an important issue; this is just an initial guess which improved later. 2) Note that PISO, SIMPLE and ... are pressure velocity coupling methods and can be used with other interpolation schemes such as first order, .... Obviously, you cannot use 2 velocity-pressure coupling methods simultaneously! but you can use them separately and may used as initial values for others. Note that you can also use "SIMPLE and first order upwind" for transient and vice versa; although, the PISO algorithm is more preferable for unsteady simulations. (for more info regarding algorithms and schemes you can refer to the user manual) Bests, |
Hi Amir,
Thank you very much for the info. May I ask some more questions? I have real image from CT scan data. After smoothing, the inner part that I want to evaluate is lose. Therefore I would like to create this part in Design Modeler in ANSYS. Can it be done? Thank you. Regards, Naimah |
Quote:
I'm not sure it can be done via ANSYS Design Modeler. I heard mimics software can process these data for importing to grid generator softwares but I don't have further info in this field. Bests, |
Axial velocity
1 Attachment(s)
Hi Amir,
I would like to ask several questions regarding how to define and plot the axial velocity and how to define the rotation axis direction in Cell Zone Condition. Herewith I attached the figures that showed the plane in a curved tube. Based on my understanding, I need to define the rotation axis direction for the flow to select the axial velocity. Is it correct? How Im going to determine the rotation axis direction in the curved plane as per attached file? the rotation axis direction is not 90 degree (perpendicular) to the plane. How Im going to take/Define the result of axial velocity? Looking forward for your feedback. Thank you so much. naimah |
Quote:
I think you can create a custom field function in fluent (http://hpce.iitm.ac.in/website/Manua...g/node1364.htm) to decompose for example the x velocity into a velocity perpendicular to your plane (use sin and cos). Daniele |
UDF_logarithmic velocity profile
Hi everybody,
I'm studying, with Fluent, the model shown in the attached image. I've to impose a loarithmic velocity profile at the upwind boundary, that is: U(h)=Uo/k*ln(h/ho) where: Uo= 1,068 m/s ho=o,005 m k=0,41 (-) The questions are two: 1)In setting the boundary conditions,I've to select, for the upwind face, a UDF velocity profil (created on the basis of the formula: U(h)=Uo/k*ln(h/ho)). While, for the other three faces, which are also inlet faces, I have to select the same UDF or to create other ones? 2)I've imposted a possible code for UDF, that is: #include "udf.h" #DEFINE Uo 1,068 //unit m/s #DEFINE k 0,41 #DEFINE ho 0,005 //unit m DEFINE_PROFILE(inlet_x_velocity,t,i) { real x[ND_ND]; real y; face_t f; begin_f_loop(f,t) { F_CENTROID(x,f,t); y = x[1]; F_PROFILE(f,thread,index) = Uo/k*log(y/ho); } end_f_loop(f,t) } Is it correct in your opinion? I've never programmed in C language, so I don't know how to crate a UDF file, for loading it in FLUENT. Someone could please tell me how to do this? Or, eventually, could I copy the code directly within command lines of fluent? Thanks |
Quote:
1) Yes, you can hook this UDF to all three faces (like aerodynamic examples) 2) Your UDF needs few modifications, try this: Code:
#include "udf.h" Bests, |
Dear Amir,
Thanks for the corrections. Someone else has suggested to me to set the top, left and right faces as symmetry boundary conditions. But I can't understand what this means. I should not have a symmetry with respect to anything? Someone said that: "the problem with inlet BCs at the side walls is that the flow should be perpendicular to the face. In my case, the velocity is tangential to the surface. A symmetry boundary condition (zero shear stress) is the usual way to model such a boundary". I've seen that setting the boundary conditions at the other 3 faces, besides the upwind one, I can choose, within Velocity Inlet, the option "Magnitude and Direction" and, as Reference frame, the option "Relative to adjacent cell zone", and then select the UDF inlet_x_velocity as Velocity Magnitude. What do you think about this way?Should be more correct to use Symmetry BC, rather than velocity inlet?In which way? Finally, as regard the definition of UDF, since I don't have basis of C programmation, I've seen that I can write these simple boundary conditions in a txt file, then save it as c.file and intrerpret it in fluent. Thanks a lot. Bests |
Quote:
- Setting U velocity means: Specific U velocity, Zero lateral velocities - Setting Symmetry BC means: Zero shear stress, Zero lateral velocity (There is not any constrain on tangential velocity magnitude) If you're modelling a building among others, the symmetry bc in better but if it's the only building in a rather large domain, I suggest velocity bc. As I said this is a common choice in aerodynamic cases in incompressible flow field too where we want to set bc around a single wing. Quote:
Do not hesitate to ask if it's not clear or face any difficulties. Bests, |
Dear Amir,
I've done some simulations with the different boundary conditions, already discussed in the previous post. Finally my BC are: On the frontal face of the huge air parallelepiped: inlet velocity with a UDF imposing a velocity profile changing with a log-law. On the upper and side faces of the huge air parallelepiped: inlet velocity with the same UDF on x direction On the back face of the huge domain: pressure outlet=0 On the building walls, there is no slip and a roughness height=0 and roughness constant=0.5. While the basis of the huge air parallelepiped is a wall, with no slip and a roughness height of 5*10^(-5) and a roughness constant=0.5. Then, I've a k-epsilon RNG model, with Standard Wall Function It=4% and Lt=0.4 m Now, I've to calculate a Volume flow rate on an opening, located on the front wall of the building, so while meshing I've created a name selection on the surface of this opening, which is set as "Interior"on boundary condition in Fluent. The problem is that I obtain a Volume flow rate too small, and I can't understand the reason. The model converges, the mass conservation is respected. I've tried to change BC on the upper and side faces of the domain, to eliminate the roughness on the basis but nothing changes. What could be the problem? Thanks a lot |
Quote:
What is the calculated value and the real one? |
Hi everybody,
Probably the problem is not the mesh but the boundary conditions. I want to try to separate the outdoor air domain (the huge air parallelepiped) and the internal building air domain, setting the building window not as "interior" but as velocity inlet or pressure inlet for the domain constitutes of the interior air. This might be correct in your opinion? My aim is to evaluate the volume flow rate on the building window. Thanks a lot |
Dear Sir
I am working on fluent for last one year. I am familier with C++ and MATLAB. In writing UDF for inlet boundary or for moving wall I feel difficulty. From last few weeks only due to one error in my code I can not proceed further. Please help me or contact me on my personal mail id so we can discuss in detail: my mail id is : ashutoshverma194@ymail.com vermaashutosh143@gmail.com |
All times are GMT -4. The time now is 15:47. |