|
[Sponsors] |
How to change flow direction during a transient analysis? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 17, 2017, 05:04 |
How to change flow direction during a transient analysis?
|
#1 |
New Member
Join Date: May 2017
Posts: 9
Rep Power: 9 |
Hello forum community,
I want to reverse the direction of flow of water in a pipe after a certain time. At the beginning water flows from the inlet through the tube to the outlet for 20 seconds. Afterwards the flow direction turns and it flows water 40 seconds from the outlet to the inlet. That is what I want. I have tried whether I can enter negative values for the speed at the velocity-inlet. That's no problem. As a result, the water flows from the outlet towards inlet. I also tried to interrupt the calculation and during this break I changed the boundary conditions of the velocity_inlet into a pressure_outlet and the pressure_outlet into a velocity_inlet. Then I have the calculation run further. When I look at the result in the CFD postprocessor the velocity vectors change according to the direction - so this works also. Although I do not have streamlines in the animation to look at. For some reason the calculation of the streamlines takes eternally. After these tests and the realization that it seems possible to change the flow direction, I have tried to use a customized UDF for it: Code:
#include "udf.h" DEFINE_PROFILE (inlet_velocity, thread, position) { Real t, v; Face_t f; begin_f_loop (f, thread) { T = RP_Get_Real ("flow-time"); { If (t> 0 && t <= 20) { V = 1.5; } Else if (t> 20 && t <= 60) { V = -1.5; } } F_PROFILE (f, thread, position) = v; } end_f_loop (f, thread) } I would be very happy if you can help me to adjust the UDF. Thanks and regards Kauf |
|
May 17, 2017, 19:17 |
|
#2 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
Try to use lowercase 'v' and 't' everywhere?
|
|
May 18, 2017, 05:51 |
|
#3 |
New Member
Join Date: May 2017
Posts: 9
Rep Power: 9 |
Sorry, this is a spelling error. In the source text I have noticed the case sensitivity.
The code I use is: Code:
#include "udf.h" DEFINE_PROFILE(inlet_velocity, thread, position) { real t, v; face_t f; begin_f_loop(f,thread) { t = RP_Get_Real("flow-time"); { if(t > 0 && t <= 20) { v = 1.5; } else if(t > 20 && t <= 60) { v = - 1.5; } } F_PROFILE(f,thread,position) = v; } end_f_loop(f,thread) } Any ideas? Last edited by kaufparkangucker; May 21, 2017 at 10:09. |
|
May 28, 2017, 04:12 |
|
#4 |
New Member
Join Date: May 2017
Posts: 9
Rep Power: 9 |
As a beginner, I have no idea if it is possible to reverse the flow direction during a transient analysis in Fluent. Maybe there is also a solution other than UDF?
Is it possible, for example, to first solve a transient solution for the flow direction in +x direction through a pipe and then use this solution as the starting condition of a new transient solution, where I change the position of the inlet and outlet so the new flow direction is now in -x direction? I would like to see how the liquid behaves in a tube when the flow direction turns suddenly by 180°. I am grateful for all tips and hints. |
|
May 29, 2017, 09:04 |
|
#5 |
New Member
D. N. Venturi
Join Date: Jan 2013
Location: Brazil
Posts: 25
Rep Power: 13 |
Are you trying to look the streamlines at CFD-Post?
If so, a possible problem could occur if you select the inlet as starting point for the streamlines and tried to integrate "forward" while the flow is reversed. Try making the streamlines in a center plane, or uniformly distributed in all the domain if this is the problem. |
|
May 30, 2017, 12:41 |
|
#6 |
New Member
Join Date: May 2017
Posts: 9
Rep Power: 9 |
Thanks Venturi - but that's not what I'm trying.
I would like to see the turbulence image that is produced when the direction of flow in the pipe change the direktion. For that, I'm trying to make a flow simulation through a simple pipe. The entrance is say "left" and the exit is "right". The input e.g. a Velocity input and the output is a pressure output. At the beginning the flow velocity should be + 2m / s for 10 seconds. Subsequently, the flow velocity should be -2 m/s for 10 seconds. The velocity in the pipe should be: 10 secounds +2 m/s and than 10 secounds - 2 m/s Has some of you an idea how to do that? |
|
May 30, 2017, 12:58 |
|
#7 | |
New Member
D. N. Venturi
Join Date: Jan 2013
Location: Brazil
Posts: 25
Rep Power: 13 |
Oh I'm sorry then. That is what I understood from your first post.
Quote:
|
||
May 31, 2017, 07:48 |
|
#8 |
New Member
Join Date: May 2017
Posts: 9
Rep Power: 9 |
Yes, I have certainly expressed something ambiguous. I hope you understand my problem now and have an idea how I can solve it.
|
|
June 22, 2017, 12:24 |
|
#9 |
New Member
Join Date: May 2017
Posts: 9
Rep Power: 9 |
Nobody any idea how to change flow direction during a simulation in ansys fluent?
|
|
June 22, 2017, 21:29 |
Add x, F_CENTROID
|
#10 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
This version works for me with added x variable and F_CENTROID function call,
Code:
#include "udf.h" DEFINE_PROFILE(inlet_velocity, thread, position) { real x[ND_ND]; // added real t, v; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); // added t = RP_Get_Real("flow-time"); { if(t > 0 && t <= 20) { v = 1.5; } else if(t > 20 && t <= 60) { v = - 1.5; } } F_PROFILE(f,thread,position) = v; } end_f_loop(f,thread) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can I change flow direction using UDF? | newcfdone | Fluent UDF and Scheme Programming | 4 | April 6, 2016 23:49 |
Low Mixing time Problem | Mavier | CFX | 5 | April 29, 2013 01:00 |
Transient flow in fluent | linyx | FLUENT | 15 | April 24, 2013 10:54 |
beginner: how to change flow behaviour? | yvar | CFX | 6 | July 28, 2011 15:54 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |