CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

sinusoidal velocity inlet tube

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 1 Post By mohammadkm
  • 2 Post By mohammadkm
  • 1 Post By mannudakamal
  • 1 Post By mohammadkm
  • 1 Post By m2montazari
  • 1 Post By mohammadkm
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2011, 19:41
Default sinusoidal velocity inlet tube
  #1
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
mohammadkm is offline   Reply With Quote

Old   September 26, 2011, 04:12
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by mohammadkm View Post
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
Amir is offline   Reply With Quote

Old   October 2, 2011, 17:01
Default
  #3
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
mohammadkm is offline   Reply With Quote

Old   October 2, 2011, 17:11
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by mohammadkm View Post
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.
Dear mohammad,

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
Amir is offline   Reply With Quote

Old   October 3, 2011, 03:47
Default
  #5
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
mohammadkm is offline   Reply With Quote

Old   October 3, 2011, 05:20
Default
  #6
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by mohammadkm View Post
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 06:01.
Amir is offline   Reply With Quote

Old   October 3, 2011, 06:04
Default
  #7
New Member
 
behnam
Join Date: Sep 2011
Location: Iran
Posts: 20
Rep Power: 15
Behnam Ghadimi is on a distinguished road
Quote:
Originally Posted by mohammadkm View Post
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 mohammad,
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 08:59.
Behnam Ghadimi is offline   Reply With Quote

Old   October 3, 2011, 07:40
Wink Outflow is not compatible with transient case
  #8
New Member
 
mannu
Join Date: Aug 2011
Posts: 3
Rep Power: 15
mannudakamal is on a distinguished road
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
mannudakamal is offline   Reply With Quote

Old   October 3, 2011, 11:26
Default
  #9
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
mohammadkm is offline   Reply With Quote

Old   October 3, 2011, 18:14
Cool
  #10
New Member
 
mannu
Join Date: Aug 2011
Posts: 3
Rep Power: 15
mannudakamal is on a distinguished road
Quote:
Originally Posted by mohammadkm View Post
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.
jzc likes this.
mannudakamal is offline   Reply With Quote

Old   October 4, 2011, 07:40
Default
  #11
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
Dear mannudakamal
I'm so thankful for your reply. I wrote this UDF and hooked in velocity inlet and target mass flow rate, but I still could'nt get right answer in 270 and 360 degree. In 90 and 180 degree velocity profile is right but in 270 and 360 degree it is wrong.
#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)
}
DEFINE_PROFILE(targetmassflowrate, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) =998.403*1.256637061*0.001*0.013*sin(0.2116*t);
}
end_f_loop(f, thread)
}

Thanks again for your reply.
jzc likes this.
mohammadkm is offline   Reply With Quote

Old   October 5, 2011, 16:46
Default
  #12
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
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.
m2montazari is offline   Reply With Quote

Old   October 6, 2011, 03:16
Default
  #13
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
mohammadkm is offline   Reply With Quote

Old   October 6, 2011, 04:34
Default
  #14
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
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
m2montazari is offline   Reply With Quote

Old   October 6, 2011, 06:49
Default
  #15
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
mohammadkm is offline   Reply With Quote

Old   October 6, 2011, 15:37
Default
  #16
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
hi,
fluent has two user interface. one is graphical user interface(GUI) which is the menus and buttons usually we use, and the other is text user interface. you can use TUI by pressing enter in main menu and the text menus will be printed out in it. then typing menu names is what you need. be aware that the categories of TUI and GUI has some differences. check that and read text user interface help of fluent if needed. when you learned how to use TUI to change your BC and other tasks you want to do at the middle of solve procedure, then you can easily type all in a text file(all the things you type in main window of fluent). then go to file->read->journal and read it. it would do all the operations step by step. check and give your results.
yours,
mohammad
m2montazari is offline   Reply With Quote

Old   October 17, 2011, 17:00
Default
  #17
Member
 
mohammad
Join Date: Apr 2010
Posts: 42
Rep Power: 16
mohammadkm is on a distinguished road
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.
ksang likes this.
mohammadkm is offline   Reply With Quote

Old   March 17, 2020, 00:27
Default
  #18
New Member
 
M.Asif
Join Date: Mar 2020
Location: Islamabad ,Pakistan
Posts: 11
Rep Power: 6
Muhammad Asif is on a distinguished road
Dear Respected all,
i have to impose two opposite sinosoidal travelling thermal waves across opposite walls of the 2D geometry of the pipe in CFX. Can anyone help me that by CEL of thermal expression
T=T0+ΔT sin(1/λ(2πx1+itVth))
how can i set BCs across walls of channel?
This would be better or by compiling UDF thermal profile in Fluent?
Thanks in Advance.
Muhammad Asif is offline   Reply With Quote

Old   March 17, 2020, 05:15
Default CFX or Fluent
  #19
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
First of all, it needs to be clear whether you wish to use CFX or Fluent. In Fluent, you can use either the expression or the UDF. And it is same in CFX; you can use either the Expression or the UPF.
Muhammad Asif likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 9, 2021, 06:01
Default Sinusoidal inlet velocity inlet for CFX
  #20
New Member
 
theSO
Join Date: Feb 2021
Posts: 3
Rep Power: 5
theSO is on a distinguished road
Dear Vineram, I want to write the above UDF code for use in CFX. Is this possible ?

"#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)
}"

Thanks so much in Advance.
theSO is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected difference between velocity / mass-flow inlet jpo FLUENT 8 December 10, 2010 08:20
Transient sinusoidal velocity inlet mrestrepo30 FLUENT 2 September 27, 2010 13:03
inlet velocity BC ahsan FLUENT 3 July 22, 2009 05:17
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 03:13
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


All times are GMT -4. The time now is 01:31.