# sinusoidal velocity inlet tube

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 25, 2011, 18:41 sinusoidal velocity inlet tube #1 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 Sponsored Links Dear all I am modeling sinusoidal velocity in a tube.My frequency is 0.2116, and I used a udf to define my velocity inlet. I chose time step size=1.237237182(s) with number of time steps=24 for one cycle. my problem is that after velocity amplitude becomes invariant, I plot velocity in outlet of pipe in phase between 180 to 360 degree, the profile is wrong and don't conform the true profile.Despite in phase 0 to 180 degree I got good velocity profile but in phase 180 to 360 degree it was wrong. I changed my mesh and time step size but I still got wrong answer. I really stick in this problem and I don't know what to do. Can anybody suggest me some guideness in this modeling. Thanks for your compassionate help in advance. mohammad jzc likes this.

September 26, 2011, 03:12
#2
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 16
Quote:
 Originally Posted by mohammadkm Dear all I am modeling sinusoidal velocity in a tube.My frequency is 0.2116, and I used a udf to define my velocity inlet. I chose time step size=1.237237182(s) with number of time steps=24 for one cycle. my problem is that after velocity amplitude becomes invariant, I plot velocity in outlet of pipe in phase between 180 to 360 degree, the profile is wrong and don't conform the true profile.Despite in phase 0 to 180 degree I got good velocity profile but in phase 180 to 360 degree it was wrong. I changed my mesh and time step size but I still got wrong answer. I really stick in this problem and I don't know what to do. Can anybody suggest me some guideness in this modeling. Thanks for your compassionate help in advance. mohammad
If your results seem reasonable between 0-180 and after that they don't, I guess there would be a problem in your outlet boundary condition because between 180-360 the direction of flow changes.

Bests,
__________________
Amir

 October 2, 2011, 16:01 #3 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 Dear amir Thanks for your reply, I changed my outlet boundary condition from pressure outlet to outflow, but still didn't get right answer. Thanks again for your help.

October 2, 2011, 16:11
#4
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 16
Quote:
 Originally Posted by mohammadkm Dear amir Thanks for your reply, I changed my outlet boundary condition from pressure outlet to outflow, but still didn't get right answer. Thanks again for your help.

I don't know details of your case, when inlet velocity oscillate around a fixed value the flow stream change its direction or not?

Bests,
__________________
Amir

 October 3, 2011, 02:47 #5 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 Dear amir thanks again for your help, yes the flow stream changes its direction. I used an UDF to define the velocity inlet. here is my UDF #include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) =0.013*sin(0.2116*t); } end_f_loop(f, thread) } Chong070940103 and jzc like this.

October 3, 2011, 04:20
#6
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 739
Blog Entries: 1
Rep Power: 16
Quote:
 Originally Posted by mohammadkm Dear amir thanks again for your help, yes the flow stream changes its direction. I used an UDF to define the velocity inlet. here is my UDF #include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) =0.013*sin(0.2116*t); } end_f_loop(f, thread) }
Hi,
Probably the issue origins from your outlet BC, outflow in not proper for this purpose because it doesn't proper in reversing direction (refer to Fig. 7.10.1- case A of manual); pressure outlet makes sense but it seems that were your first selection and it faces covergency issues in changing direction. (7.8 second paragraph of manual)
My suggestions:
1) I'm not sure but it may be possible to achieve converged result with pressure outlet (with increasing sub-iterations)
2) You may want to change BCs when the direction changes
3) You can easily do that in other software like OpenFOAM.

Bests,
__________________
Amir

Last edited by Amir; October 3, 2011 at 05:01.

October 3, 2011, 05:04
#7
New Member

behnam
Join Date: Sep 2011
Location: Iran
Posts: 20
Rep Power: 7
Quote:
 Originally Posted by mohammadkm Dear amir thanks again for your help, yes the flow stream changes its direction. I used an UDF to define the velocity inlet. here is my UDF #include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) =0.013*sin(0.2116*t); } end_f_loop(f, thread) }
why you don't use profile for creating sinusoidal velocity.you can do this like this example:
((sampleprofile transient 5 1)
(time
1
2
3
4
5
)
(u
10
20
30
-20
-10
)
)
the first number(5) in "(sampleprofile transient 5 1)" indicate number of time step in one period, and the second number indicate periodic or nonperiodic boundary condition(1 for periodic and 0 for nonperiodic).
note that when you use sinusoidal velocity ur velocity inlet magnitude becomes negative in some time range so i think u must change your BCs in this range.

Last edited by Behnam Ghadimi; October 3, 2011 at 07:59.

 October 3, 2011, 06:40 Outflow is not compatible with transient case #8 New Member   mannu Join Date: Aug 2011 Posts: 3 Rep Power: 8 Hallo all, I am dealing with similar problem. What i know for sure (atleast fluent manual ) that outflow is not to be used with transient case. A pr outlet is more appropriate but then you are imposing a restriction at boundary. I would go for pr-outlet with mass flow rate as density do not change. But in this case you have to write a udf to know the mass flow (equal to velocity inlet) and impose it at the out. I hope this works though i dont know for sure. Let me know if this works

 October 3, 2011, 10:26 #9 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 Dear amir,behnam, and mannudakamal Thank you very much for your reply and help. I also checked pressure outlet boundary condition but it didnt work. mannudakamal, would you please expain what you said? "But in this case you have to write a udf to know the mass flow (equal to velocity inlet) and impose it at the out." which BC I should use? I used an UDF to define the velocity inlet and imposed it to the inlet. Thanks again for your compassionate help.

October 3, 2011, 17:14
#10
New Member

mannu
Join Date: Aug 2011
Posts: 3
Rep Power: 8
Quote:
 Originally Posted by mohammadkm mannudakamal, would you please expain what you said? "But in this case you have to write a udf to know the mass flow (equal to velocity inlet) and impose it at the out." which BC I should use? I used an UDF to define the velocity inlet and imposed it to the inlet. Thanks again for your compassionate help.

okey.. this is what i mean..

Put pr outlet and check the box target mass flow rate.
It will open a mass flow box where you can either put a constant value or a udf. The mass flow out must be equal to that of inlet.

thats where i said .. may be you need to write udf if the mass flow at inlet is fluctuating instead of constant.

 October 5, 2011, 15:46 #12 Senior Member   Mohammad Join Date: Feb 2010 Location: Shiraz, Iran Posts: 109 Rep Power: 9 hi all, I think setting velocity inlet for inverse flow direction is wrong. because the characteristics of velocity is toward domain and velocity value should not be set at outlets. because of this, fluent and other softwares dont have velocity outlet. and at the other hand fluent have some errors in setting pressure outlet for inflow direction(however it is theoretically true to set pressure at inlet). but my suggestion is: 1- use a journal to change boundary condition in 180 degree phase from pressure tp velocity and from velocity to pressure. however setting velocity at the end of the pipe(which should be inlet in phase 180-360) makes a constant value velocity profile. so you may need to change your profile (writing a new udf) to set velocity as a function of time and space. it should be sinusoidal in time and parabolic in space. 2- use periodic BC and use a journal to change the pressure gradient. it can be implemented in fully developed flow at both inlet and oulet. 3- use pressure outlet for both inlet and outlet and ignore some first and last cell threads results. cells of mid threads should have good results. and about using openfoam instead of fluent, which amir recommends, it has no error in setting static pressure at inlet, but setting velocity for outlet is not correct yet. and to Amir: گهی زین به پشت و گهی پشت به زین!!! yours, mohammad Amir likes this.

 October 6, 2011, 02:16 #13 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 Dear m2montazeri Thank you very much for your reply. I mailed to the author of paper who used fluent for modeling sinusoidal velocity inlet to the tube. He said I should consider Courant number criterion. I have not considered that because my model is pressure based and in density based courant number criteria is available.also, I iterate with density based with default courant number in control solution and I got solution diverge in residual monitor and mass flow rate at outlet is zero. can anyone explain what does meaning of Courant number criterion? I'm so thankful for your help in advance.

 October 6, 2011, 03:34 #14 Senior Member   Mohammad Join Date: Feb 2010 Location: Shiraz, Iran Posts: 109 Rep Power: 9 hi, courant no is a non-dimensional number which specifies stability criteria. it is Co=(U*dt)/dx which U is velocity in a cell, dt is timestep size and dx is cell length. in pressure base coupled pressure-velocity coupling model, default courant no in fluent is 200 and it defers with the courant no which is usually set as criteria. but in density based model for explicit model courants lower than 1 is required and for implicit model courant no can be anything theoretically. but as the equations are highly nonlinear, usually Co=2 is set as criteria. however in many cases, setting Co to values lower than 1 (ex. 0.5) for first iterations are needed and when some iterations have done, you can use higher Co upto some values about 20 or 30! but as I told in previous post, I think it is not the problem and boundary conditions should be changed to correct ones to achieve correct results. yours, mohammad

 October 6, 2011, 05:49 #15 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 I'm so thankful for your compassionate help. sorry , what do you from journal and how can I change my Bc? I used velocity inlet (with udf) ti the inlet of tube and pressure outlet at the outlet of pipe. in phase 90 and 180 degree I get right velocity profile but in 270 and 360 degree it is false. I also checked density based but the solution diverge. The flow is incompressible. It is my thesis and I stick in this problem. I really don't have any idea how to solve this problem.

 October 17, 2011, 16:00 #17 Member   mohammad Join Date: Apr 2010 Posts: 42 Rep Power: 9 Dear all mohammad thanks again for your reply and compassionate help.Fortunately, the problem was solved. The problem was the section that I plot the velocity profile. I plot the velocity at the exactly outlet of tube, while I should plot the profile before the outlet of pipe. I hope it would be usefull.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post jpo FLUENT 8 December 10, 2010 08:20 mrestrepo30 FLUENT 2 September 27, 2010 12:03 ahsan FLUENT 3 July 22, 2009 04:17 R P CFX 2 October 26, 2004 02:13 chong chee nan FLUENT 0 December 29, 2001 06:13