CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   periodic, unsteady, non-constant mass flow rate (http://www.cfd-online.com/Forums/fluent/29454-periodic-unsteady-non-constant-mass-flow-rate.html)

Lee March 6, 2002 01:16

periodic, unsteady, non-constant mass flow rate
 
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

ac2011 September 26, 2011 09:05

Hi,

I'm interested to know whether you found a way to do this. I want to do something very similar.

sbrCFD September 27, 2011 15:57

Hello,

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

Thanks!

Amir September 27, 2011 16:07

Quote:

Originally Posted by ac2011 (Post 325635)
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 (Post 325833)
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,

ac2011 September 28, 2011 05:06

Thanks for the response. But then how exactly do you read in the journal file and where?

Amir September 28, 2011 08:37

Quote:

Originally Posted by ac2011 (Post 325874)
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,

ac2011 September 28, 2011 10:37

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

Amir September 28, 2011 11:23

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,

m2montazari September 29, 2011 16:10

Quote:

Originally Posted by Amir (Post 325944)
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

Amir September 29, 2011 16:19

Quote:

Originally Posted by m2montazari (Post 326126)
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,

m2montazari September 29, 2011 16:38

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

Amir September 29, 2011 16:43

Quote:

Originally Posted by m2montazari (Post 326137)
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)

m2montazari September 29, 2011 16:57

Quote:

Originally Posted by Amir (Post 326138)
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!!

Amir September 30, 2011 01:57

Quote:

Originally Posted by m2montazari (Post 326139)
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? :confused:

Bests,

m2montazari September 30, 2011 03:19

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,

Amir September 30, 2011 03:51

Quote:

Originally Posted by m2montazari (Post 326180)
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!

m2montazari September 30, 2011 10:44

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,,

Amir September 30, 2011 11:36

Quote:

Originally Posted by m2montazari (Post 326261)
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,

m2montazari September 30, 2011 15:23

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,

Amir September 30, 2011 16:37

Dear Mohammad,
I'll be glad if you can elaborate these points which may lead to clear this discussion:
Quote:

Originally Posted by m2montazari (Post 326294)
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 (Post 326294)
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,


All times are GMT -4. The time now is 20:33.