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

periodic, unsteady, non-constant mass flow rate

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2002, 01:16
Default periodic, unsteady, non-constant mass flow rate
  #1
Lee
Guest
 
Posts: n/a
Hello.

In a periodic, unsteay, 3-D flow simulation, I'd like to set a non-constant mass flow rate condition varying with time, for example;

Mass flow rate at periodic boundaries = function of time = m * Sin(a*t)

Would you please send me the method?

Thank you.

Lee
  Reply With Quote

Old   September 26, 2011, 10:05
Default
  #2
New Member
 
ac
Join Date: Sep 2011
Posts: 4
Rep Power: 15
ac2011 is on a distinguished road
Hi,

I'm interested to know whether you found a way to do this. I want to do something very similar.
ac2011 is offline   Reply With Quote

Old   September 27, 2011, 16:57
Post
  #3
New Member
 
Join Date: Sep 2011
Posts: 6
Rep Power: 15
sbrCFD is on a distinguished road
Hello,

I'm also very interested if anyone could help us with this question.

Thanks!
sbrCFD is offline   Reply With Quote

Old   September 27, 2011, 17:07
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 ac2011 View Post
Hi,

I'm interested to know whether you found a way to do this. I want to do something very similar.
Quote:
Originally Posted by sbrCFD View Post
Hello,

I'm also very interested if anyone could help us with this question.

Thanks!
Dear friends,

If you cannot hook any UDF for this purpose, you can write a journal file for that.

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   September 28, 2011, 06:06
Default
  #5
New Member
 
ac
Join Date: Sep 2011
Posts: 4
Rep Power: 15
ac2011 is on a distinguished road
Thanks for the response. But then how exactly do you read in the journal file and where?
ac2011 is offline   Reply With Quote

Old   September 28, 2011, 09:37
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 ac2011 View Post
Thanks for the response. But then how exactly do you read in the journal file and where?
First you have to prepare your desired journal file, then you can easily read it in FLUENT (file->read->journal)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   September 28, 2011, 11:37
Default
  #7
New Member
 
ac
Join Date: Sep 2011
Posts: 4
Rep Power: 15
ac2011 is on a distinguished road
Hi Amir,

I will write down exactly what I'm doing:

I have a 2D channel. I want to vary the velocity with time in this channel. I can do this by having a very long channel and a profile file which I read in. The profile file contains this:

((rampup transient 3 0 0)
(time
0.000000e+000 5.000000e+000 1.000000e+001)
(u
3.524500e-002 2.014000e-001 2.014000e-001)
)

Once that is read in, I can go to my velocity inlet boundary and pick this profile instead of 'constant'. That works fine.

However, I don't want to use such a long channel. I can get fully developed flow by using a short section of channel and using periodic boundary at inlet (mesh/modify-zones/make-periodic). Once I do this my inlet velocty boundary only lets me input a constant value of mass flow - i.e. I can't read in my profile as I did before.

If I can do this with a journal file, then where do I specify the journal file to give me the velocity variation? There seems to be no option in the velocity boundary once it's periodic. Also, if that is possible, then what is the format of the journal file?

I would appreciate more information.

Many thanks,
C
ac2011 is offline   Reply With Quote

Old   September 28, 2011, 12:23
Default
  #8
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
Hi,
The journal files help you to automate manual procedures. Consider you've set a value for mass flow rate and after one time step you've change the mass flow rate and run for another time step. you can automate this procedure with a journal file. You can generate a journal file in two way: 1) TUI commands 2) FLUENT journal writing
Finally, you'll need to extend journal file for your time zone with a simple fortran code ... (for more info refer to manual)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   September 29, 2011, 17:10
Default
  #9
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
Quote:
Originally Posted by Amir View Post
Hi,
The journal files help you to automate manual procedures. Consider you've set a value for mass flow rate and after one time step you've change the mass flow rate and run for another time step. you can automate this procedure with a journal file. You can generate a journal file in two way: 1) TUI commands 2) FLUENT journal writing
Finally, you'll need to extend journal file for your time zone with a simple fortran code ... (for more info refer to manual)

Bests,
hi,
not a good solution!
if you want to have a fully developed flow inside a duct or pipe and you want to model short length, forget about periodic BCs and simply set inlet and outlet as pressure BCs. then by a udf you can change pressure difference between inlet and outlet and then massflowrate would change. I have done it in another software(OpenFOAM) and the results were exactly the same as analytic solution.
be aware that pressure inlet sets total pressure and pressure outlet static pressure.
yours,
mohammad
m2montazari is offline   Reply With Quote

Old   September 29, 2011, 17:19
Default
  #10
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 m2montazari View Post
hi,
not a good solution!
if you want to have a fully developed flow inside a duct or pipe and you want to model short length, forget about periodic BCs and simply set inlet and outlet as pressure BCs. then by a udf you can change pressure difference between inlet and outlet and then massflowrate would change. I have done it in another software(OpenFOAM) and the results were exactly the same as analytic solution.
be aware that pressure inlet sets total pressure and pressure outlet static pressure.
yours,
mohammad
Dear Mohammad,
In OpenFOAM, you have to set boundary conditions for both velocity and pressure, so you've set zeroGradient for velocity @ inlet and outlet and implicitly generate a periodic zone, am I right? But here, there is no guarantee for velocity gradients @ pressure boundary conditions and some deviations may exist even for short pipes.

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   September 29, 2011, 17:38
Default
  #11
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
hi,
no. I think using pressure BC in fluent is similar to fixedValue of p and zeroGradient of U in OpenFOAM. if I remember correctly, one of my friend do exactly the same problem in fluent. and another one solved this in cfx. all used pressure-pressure BC and got the answer.
yours,
mohammad
m2montazari is offline   Reply With Quote

Old   September 29, 2011, 17:43
Default
  #12
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 m2montazari View Post
hi,
no. I think using pressure BC in fluent is similar to fixedValue of p and zeroGradient of U in OpenFOAM. if I remember correctly, one of my friend do exactly the same problem in fluent. and another one solved this in cfx. all used pressure-pressure BC and got the answer.
yours,
mohammad
So, why did you talk about short section?! Or, why ability of translational periodic boundary condition with pressure loss is added to FLUENT? (As what you said, it can be easily handled via pressure-pressure BC)
__________________
Amir
Amir is offline   Reply With Quote

Old   September 29, 2011, 17:57
Default
  #13
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
Quote:
Originally Posted by Amir View Post
So, why did you talk about short section?! Or, why ability of translational periodic boundary condition with pressure loss is added to FLUENT? (As what you said, it can be easily handled via pressure-pressure BC)
consider a duct and some small boxes inside it. boxes are at the centre and they are placed in the duct with some space between each other(spaces are even). then you can run the flow with a periodic BC in fluent with just solving for a piece of duct containing one box. in this case you have the wake of the box in velocity at the inlet as well as outlet(as you set peridic BC). but if you forget periodic and simply set pressure BC, you have a fully developed flow at the inlet section with no wake effect in velocity. but you have a wake in outlet and as inlet and outlet were not set periodic, this change in velocity profile doesn't change the velocity profile at the inlet.
this is an example of why fluent added periodic BC!!
m2montazari is offline   Reply With Quote

Old   September 30, 2011, 02:57
Default
  #14
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 m2montazari View Post
consider a duct and some small boxes inside it. boxes are at the centre and they are placed in the duct with some space between each other(spaces are even). then you can run the flow with a periodic BC in fluent with just solving for a piece of duct containing one box. in this case you have the wake of the box in velocity at the inlet as well as outlet(as you set peridic BC). but if you forget periodic and simply set pressure BC, you have a fully developed flow at the inlet section with no wake effect in velocity. but you have a wake in outlet and as inlet and outlet were not set periodic, this change in velocity profile doesn't change the velocity profile at the inlet.
this is an example of why fluent added periodic BC!!
Dear Mohammad,

That's exactly what I was trying to say! In your example, consider a special case; if we consider a control volume in which the block is located in the middle and consequently, inlet and outlet are in the middle of two blocks, it makes sense that as a result of periodic velocity profile, normal velocity gradients are zero on both inlet and outlet, we also know the pressure difference; here we've set zeroGradient for velocity and fixedValue for pressure @ inlet and outlet which seams proper to use pressure-pressure BC upon your definitions, how do you justify this?

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   September 30, 2011, 04:19
Default
  #15
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
hi,
I didnt understand your answer very well, but I think for any case setting pressure-pressure BC (which means zero Gradient of velocities) results a fully developed velocity profile at inlet. but setting periodic BC with pressure gradient results exactly the same inlet velocity profile as the outlet profile. this is the differernce of these two options. simply you can create a simple model and run it in two ways and see the differences in results. even if you want to solve this example in OpenFOAM setting pressure fixedValue and velocity zeroGradient results false results. you must use directMapVelocity or cyclic+fan BC to achieve correct results(periodic results)
yours,
m2montazari is offline   Reply With Quote

Old   September 30, 2011, 04:51
Default
  #16
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 m2montazari View Post
hi,
I didnt understand your answer very well, but I think for any case setting pressure-pressure BC (which means zero Gradient of velocities) results a fully developed velocity profile at inlet. but setting periodic BC with pressure gradient results exactly the same inlet velocity profile as the outlet profile. this is the differernce of these two options. simply you can create a simple model and run it in two ways and see the differences in results. even if you want to solve this example in OpenFOAM setting pressure fixedValue and velocity zeroGradient results false results. you must use directMapVelocity or cyclic+fan BC to achieve correct results(periodic results)
yours,
I elaborate it now!
In a control volume in which block is located in a middle, velocity gradients are zero @ both inlet and outlet and we reach closure for defining boundary condition (both velocity and pressure) and we don't need extra BCs, so why pressure-pressure BC cannot lead to physical results; that's exactly the same case you defined for pressure boundary condition!
__________________
Amir
Amir is offline   Reply With Quote

Old   September 30, 2011, 11:44
Default
  #17
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
hi,
no. for the control volume you specified, if the space between box and inlet,outlet boundaries is large enough, both pressure-pressure and periodic results the same. but if the space is not so large, which causes a wake effect on outlet, defining pressure boundary condition is false because the pressure has some gradients at the outlet because of box wake. if you ignore these pressure gradient, you've accepted a simple fully developed flow and ignored the box wake effect on boundaries. the same is right about the inlet and pressure gradient on it because of box stagnation point. although wake effect is more effective relative to stagnation effect.
yours,,
m2montazari is offline   Reply With Quote

Old   September 30, 2011, 12:36
Default
  #18
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 m2montazari View Post
if you ignore these pressure gradient, you've accepted a simple fully developed flow and ignored the box wake effect on boundaries.
I guess you mean pressure variation @ inlet and outlet plane not normal to them because obviously we have normal pressure gradient in fully developed flow. Upon your definition of pressure BC, it should be lead to physical result if we have zero normal gradient of velocity and if we can set a pressure value over that (negligible in-plane pressure variation) which both can be seen even in large wake.(with approximation)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   September 30, 2011, 16:23
Default
  #19
Senior Member
 
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16
m2montazari is on a distinguished road
hi,
if you neglect pressure variation in plane of boundary, writing bernouli+headloss equation you see that for these two streamlines all variables are the same:
1-streamline starting from inlet and ending at outlet. start point and end point are both far from box location and both are far from the wake.
2-streamline starting from inlet and ending at outlet. start point and end point are both near the centre of duct. end point is in the wake of box.
for both, pressure diff. is the same. headloss is the same. so velocities should be the the same. as equations dont have anything to set at inlet for velocity but a simple fully developed flow profile, the this type of boundary forces outlet velocity to be the same as inlet, afully developed flow with no effect of wake. so by setting pressure-pressure bc you force the wake to end before the outlet. and this is wrong!
but if you specify periodic, these two streamlines have all variables the same and similarly the velocities should be the same. but now the software places velocity profile of outlet at the inlet and continue the solution. so instead of changing outlet velocity according to inlet velocity(in pressure-pressure case), the periodic case would change the inlet velocity according to outlet velocity. which is the thing we want and THIS is physical.
yours,
m2montazari is offline   Reply With Quote

Old   September 30, 2011, 17:37
Default
  #20
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
Dear Mohammad,
I'll be glad if you can elaborate these points which may lead to clear this discussion:
Quote:
Originally Posted by m2montazari View Post
for both, pressure diff. is the same. headloss is the same. so velocities should be the the same. as equations dont have anything to set at inlet for velocity but a simple fully developed flow profile, the this type of boundary forces outlet velocity to be the same as inlet, afully developed flow with no effect of wake. so by setting pressure-pressure bc you force the wake to end before the outlet. and this is wrong!
As you know, each zero velocity gradient is not necessarily fully developed condition which doesn't have wake effect!!! If you think that pressure BCs necessarily lead to fully developed flow, so they have restrictions more than zero normal gradient, is it the case?
Quote:
Originally Posted by m2montazari View Post
but if you specify periodic, these two streamlines have all variables the same and similarly the velocities should be the same. but now the software places velocity profile of outlet at the inlet and continue the solution. so instead of changing outlet velocity according to inlet velocity(in pressure-pressure case), the periodic case would change the inlet velocity according to outlet velocity. which is the thing we want and THIS is physical.
yours,
I'm not sure about the procedure which FLUENT uses in periodic zone calculation but I think it's better to focus on this question:
As you said, @ pressure BCs, normal velocity gradient is zero; fully developed flow is just an example but not all the cases! Let's move backward; we know the solution; we have a periodic flow which velocity gradient are zero @ inlet and outlet so it's compatible with pressure BC; otherwise we've reached two different results for a same case and BCs. (This doubt can be removed if we accept that pressure BC is not just a fixedValue @ pressure and zeroGradient @ velocity)

Bests,
__________________
Amir
Amir 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
mass flow rate not conserved in turbomachine, interface defined wrong? wildli FLUENT 3 September 15, 2022 13:19
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 15:10
Mass Flow Rate student87 CFX 4 January 2, 2010 05:45
ChannelOodles Correcting driving force for a constant mass flow rate maka OpenFOAM Running, Solving & CFD 3 September 21, 2005 06:18
Constant mass flow rate / choking outlet bounardy condition Min Zhu Main CFD Forum 1 September 29, 1998 16:33


All times are GMT -4. The time now is 07:40.