|
[Sponsors] |
November 8, 2017, 13:04 |
Zeytoonian
|
#1 |
New Member
hassan zeytoonian
Join Date: Feb 2016
Posts: 5
Rep Power: 10 |
Hi
I am modeling a laminar flow in cylindrical coordinate. My problem boundary condition are as follow: 1. Direkhlrt boundary condition as: Pin=15Mpa, Pout=0 2. numan boundary condition as: velocity derivative in normal direction to inlet and outlet boundary is zero. i am trying to define a UDF that include both two above boundary condition. I could not find any UDF or macros relate to numan boundarey condition. Please help me to know can l found a UDF for my problem boundary condition? Thanks |
|
November 8, 2017, 22:05 |
|
#2 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Quote:
Best regards |
||
November 8, 2017, 23:12 |
|
#3 |
New Member
hassan zeytoonian
Join Date: Feb 2016
Posts: 5
Rep Power: 10 |
Thank you AlexanderZ
I don't understand what is your means. The only default boundary conditions in fluent Which all variable derivative (like velocity) are zero Is just outflow boundary condition. But with select outflow boundary condition the inlet pressure can not be choice at the same time. |
|
November 9, 2017, 00:17 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Ansys Fluent Customization manual
3.2.3.9. Derivative Macros The macros listed in Table 3.14: Macros for Cell Velocity Derivatives Defined in mem.h (p. 258) can be used to return real velocity derivative variables in SI units. The variables are available in both the pressure-based and the density-based solver. Best regards |
|
November 9, 2017, 03:54 |
|
#5 |
New Member
hassan zeytoonian
Join Date: Feb 2016
Posts: 5
Rep Power: 10 |
Dear Mr. AlexanderZ
Thank you for your useful help. The main problem Is that i am a beginer in fluent udfs use. I do not know how uses and how arrange my Boundary condition in velocity derivative macro. Other problem is related to my cylindrical geometry. My velocity derivative boundary condition should write in cylindrical coordinate. Can you please help me to prepare it? Thank you for all help Best regards |
|
November 9, 2017, 11:08 |
|
#6 |
New Member
hassan zeytoonian
Join Date: Feb 2016
Posts: 5
Rep Power: 10 |
Mr Alexander
As i said i need to apply both direkhlet boundary Condition (Pin=15Mpa and Pout=0) and also numan boundary condition (velocity derivatives=0) on my boundaries. With your help i could find a velocity derivative macro mem.h. Now i need to define a udf to include both direkhlet and numan boundary condition on my boundry. Is it correct? Thanks again |
|
November 13, 2017, 20:54 |
|
#7 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
what do you mean under velocity derivative, write an expression.
Regarding pressure, you may define Pin/Pout using pressure inlet/oulet boundary condition Best regards |
|
November 18, 2017, 02:09 |
zeytoonian
|
#8 |
New Member
hassan zeytoonian
Join Date: Feb 2016
Posts: 5
Rep Power: 10 |
Dear Alexanserz
i need to define a UDF for my boundary conditions which include the following equation:<br><br> dV/dn=0. v is the velocity on boundary and n is the normal vector on boundary.<br><br> bests |
|
March 28, 2018, 03:17 |
|
#9 | |
New Member
David
Join Date: Nov 2017
Posts: 14
Rep Power: 9 |
Quote:
I am wondering whether you found a solution to this boundary condition setting? In velocity inlet bc, you may hook the UDF for u, v and p. Thanks, Dv |
||
March 28, 2018, 06:32 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If you want to have a boundary with:
1. Fixed pressure (Pout=0 MPa) 2. Zero velocity gradient in normal direction. Then it is very easy in Fluent: set a Pressure outlet, with pressure 0 Pa. This will automatically give the second condition, because this is default. This is what AlexanderZ already said when he mentioned "By default velocity derivatives in normal direction to inlet and outlet boundary are zero." So you don't need a UDF here. It is much more simple than you think. |
|
March 28, 2018, 21:36 |
|
#11 | |
New Member
David
Join Date: Nov 2017
Posts: 14
Rep Power: 9 |
Quote:
Thank you so much for your reply. This problem bothered me a long time. For sure, by default, pressure outlet can satisfy the two conditions mentioned above. In my case, however, I would like to simulate a flow over a curved surface. I have p_out=zero (through pressure outlet bc); a Blasius velocity profile inlet (through velocity inlet bc); a wall bc. At top of domain, I would like to implement the du/dy=0; dv/dy=0; dp/dy=0 (since my domain is fixed, I cannot move the top surface further away from the wall). I found Outflow b.c. in Fluent will give me these zero gradient conditions. However, Outflow and Pressure Outlet b.c. will not work at the same time by Fluent. Also, Symmetry b.c. also gives these zero gradient conditions, however, the normal velocity at the boundary is zero by default which I would not like to see. I don't know how to implement it unless using UDF to give velocity inlet profile at the top surface. For the time being, it goes to the correct direction, but the convergence of continuity is not quite good (residual to 10e-6). If you have any insights, please let me know. I hope to have simpler way to get b.c.'s I want. Thank you in advance. Dv |
||
March 29, 2018, 04:36 |
|
#12 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Is the "top of the domain" also your outlet?
In that case, you are trying to specify the pressure and the pressure gradient in the same boundary. The Navier-Stokes equations are first-order in pressure, so you should only have one boundary condition for pressure. In other words: spend less time on thinking how to implement your BCs, but spend more time thinking about if they are the correct BCs. |
|
March 29, 2018, 06:24 |
|
#13 | |
New Member
David
Join Date: Nov 2017
Posts: 14
Rep Power: 9 |
Quote:
Many thanks for your reply. I totally agree with you. The physics of the problem should be the most important when doing simulation. I really have two outlets since I'd like to see the profile of y-velocity at the top surface. And, the main flow comes from inlet(left) to outlet(right). In this case, the pressure outlet at the right surface of domain is much more important than the top surface. You mentioned that I was trying to specify the pressure and pressure gradient on the same top boundary. However, for the time being, I just use UDF to get dp/dy is zero (hook to the "Supersonic/Initial Gauge Pressure" dialogue box) and do not specify any value for the pressure. Now, I'm thinking about if it is reasonable to have a zero pressure gradient at the top boundary, because the y-velocity is not zero. If dp/dy is zero, the y-velocity should be also zero, right? Finally, here is the UDF I'm using to get zero gradient boundary, could you please take a look at it to see if it is feasible? It is the first time I write a UDF by just following some example in the manual. It doesn't converge well. Any insights would be appreciated. Best, Dv # include "udf.h" DEFINE_PROFILE(top_u_gradient,t,i) /* du/dy */ { real xf[ND_ND], xc[ND_ND]; face_t f; cell_t c0; Thread *t0; begin_f_loop(f,t) { F_CENTROID(xf,f,t); c0 = F_C0(f,t); t0 = THREAD_T0(t); C_CENTROID(xc,c0,t0); F_PROFILE(f,t,i) = C_U(c0,t0); /* not confident */ } end_f_loop(f,t) } DEFINE_PROFILE(top_v_gradient,t,i) /* dv/dy */ { real xf[ND_ND], xc[ND_ND]; face_t f; cell_t c0; Thread *t0; begin_f_loop(f,t) { F_CENTROID(xf,f,t); c0 = F_C0(f,t); t0 = THREAD_T0(t); C_CENTROID(xc,c0,t0); F_PROFILE(f,t,i) = (-1) * C_V(c0,t0); /* not confident if need to change the sign of y-velocity */ } end_f_loop(f,t) } DEFINE_PROFILE(top_p_gradient,t,i) /* dp/dy */ { real xf[ND_ND], xc[ND_ND]; face_t f; cell_t c0; Thread *t0; begin_f_loop(f,t) { F_CENTROID(xf,f,t); c0 = F_C0(f,t); t0 = THREAD_T0(t); C_CENTROID(xc,c0,t0); F_PROFILE(f,t,i) = C_P(c0,t0); /* not confident */ } |
||
March 29, 2018, 06:40 |
|
#14 | ||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Going back to your setup: I don't know what you are simulating, but it looks like wind blowing past some obstacle.
Quote:
Quote:
|
|||
October 22, 2021, 03:52 |
|
#15 |
New Member
Join Date: Oct 2016
Posts: 2
Rep Power: 0 |
God bless you.
|
|
|
|