CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to model a fan fixing the mass flow rate?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2010, 08:14
Default
  #21
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
Hi Mad,

sorry it was my fault. The definiton in the boundary file is correct, but in your U file the BC-type must be directMapped (not directMappedFixedValue).

Sorry again,
Stefan
herbert is offline   Reply With Quote

Old   October 5, 2010, 08:47
Default
  #22
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by herbert View Post
sorry it was my fault. The definition in the boundary file is correct, but in your U file the BC-type must be directMapped (not directMappedFixedValue).
Ah yes! I should have noticed by myself! There is an example among the tutorials...
Just as an information: do you know why the BC condition is directMapped and in the /OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/fields/fvPatchFields/derived folder there are:
  • directMappedFixedValue and
  • directMappedVelocityFluxFixedValue?
What is the difference between the two?

Cheers

mad

Last edited by maddalena; October 6, 2010 at 09:07.
maddalena is offline   Reply With Quote

Old   October 5, 2010, 09:26
Default
  #23
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
I think directMappedVelocityFluxFixedValue recyles the velocity and the flux whereas directMappedFixedValue (which we are using here) only patches velocity in this case.

The biggest disadvantage of the first one if you try to apply it to your case is that you can't set the average value there. My guess is, that you could need this BC for compressible simulations where phi is not only a function of U.

Regards,
Stefan
herbert is offline   Reply With Quote

Old   October 5, 2010, 09:32
Default
  #24
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by herbert View Post
The biggest disadvantage of the first one if you try to apply it to your case is that you can't set the average value there.
Yes, I saw that is not possible to fix the average value when using the directMappedVelocityFluxFixedValue. This means that I cannot fix the mass flux in my case.
I have the first simulation running. I will report as soon as I have some results.
Thanks for your support.

cheers

mad
maddalena is offline   Reply With Quote

Old   October 5, 2010, 16:49
Default
  #25
Member
 
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16
robingilbert is on a distinguished road
hello,

I have a heat source (constant heat addition using setFields) very next to the fan. i dont know the temperature at the fan. i just have a heat source befor it. how do i set up the temperature at the fan boundary?? do i use directMapped as well??

so its like:
fanOutlet=domain inlet
fanOutlet
{
type directMapped;
value uniform 0;
setAverage false;
}
what abt fanInlet??

Last edited by robingilbert; October 5, 2010 at 17:32.
robingilbert is offline   Reply With Quote

Old   October 6, 2010, 03:45
Default
  #26
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Robin,
are you using cht? If it is so,
Quote:
Originally Posted by robingilbert View Post
how do i set up the temperature at the fan boundary?
I think that you can use the fan as an interface coupling, indeed this is what you do when applying the directMapped. Why do not create the two fan faces in two different regions, and then couple them using a solidWallMixedTemperatureCoupled applied to T, while U and p are as described above.
Quote:
Originally Posted by robingilbert View Post
I have a heat source (constant heat addition using setFields) very next to the fan. i dont know the temperature at the fan. i just have a heat source before it.
maybe you can find this thread interesting: http://www.cfd-online.com/Forums/ope...egionfoam.html I believe the discussion can be applied to a heat source in general (even defined as a setField), since we traced back the problem to the coupling condition. But perhaps you will be luckier than me...

mad
maddalena is offline   Reply With Quote

Old   October 6, 2010, 04:18
Default
  #27
Member
 
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16
robingilbert is on a distinguished road
i am using simpleFoam.
robingilbert is offline   Reply With Quote

Old   October 6, 2010, 09:18
Default
  #28
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hello,
bad news: the following caused velocity instabilities (i guess due to the numerics) close to the fanOutlet,
  • fanOutlet = domain inlet
    • U: directMapped, setAverage: massFlowRate/Area
    • p: zeroGradient
  • fanInlet = domain outlet
    • U: zeroGradient
    • p: fixedValue p = 0
You can see the velocity field in the attached picture, while there is a brief explanation of my geometry in this post. the flow goes from left to right.
Note that at the moment turbulence is switched off to not include k and epsilon.
I used the fixedValue p = 0 BC since I usually fix velocity in one of the boundary and pressure in one of the other. However, Stefan suggested here a zeroGradient + pRefCell close to the outlet. How can I get its number? where should I check it? EDIT: answer here: http://www.cfd-online.com/Forums/ope...-pressure.html

Is it correct to not fix pressure anywhere and use zeroGradient only? May the pressure fixedValue be the reason of these instabilities?

cheers

mad
Attached Images
File Type: jpg umag.jpg (32.6 KB, 186 views)

Last edited by maddalena; October 6, 2010 at 12:16.
maddalena is offline   Reply With Quote

Old   October 7, 2010, 03:41
Default
  #29
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
No way. Simulation crashed after few time steps using the zeroGradient condition at the inlet and at the outlet. Ideas?

mad
maddalena is offline   Reply With Quote

Old   October 8, 2010, 05:47
Default
  #30
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
If you have switched off turbulence, what is your Re and viscosity? If you do not have a reasonably high nu and Re is high as well, the solution will of course blow up (especially if you are using 2nd order numerics).

The flow is behaving very strangely downstream of the fan. Do you have any idea why this is? I suggest you look at the velocity values at the inlet in a bit more detail.
eugene is offline   Reply With Quote

Old   October 8, 2010, 06:26
Default
  #31
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Eugene,
I used a laminar model only on the first 100 time steps, just to help the solver. Then I switched on the turbulence.
My schemes are the following:
  • gradSchemes faceMDLimited Gauss linear 0.5;
  • divSchemes Gauss linearUpwindV cellLimited Gauss linear 1;
  • laplacianSchemes Gauss linear limited 0.5;
and the strange behaviour of the outlet is due to the BC suggested above (k and epsilon fixedValue at the fanOutlet patch, I guess). Now I changed them in the following way:
  • fanOutlet = domain inlet:
    • U: directMapped, average massflow/Area
    • p: zeroGradient;
    • k, epsilon: inletOutlet
  • fanInlet = domain outlet:
    • U: zeroGradient;
    • p: fixedValue 0; pRefCell close to the outlet;
    • k, epsilon: inletOutlet
As you can see, the velocity field looks better now, even close to the fan.
In order to make the simulation more stable, I also lowered relaxation factor:
  • p 0.15;
  • U 0.5;
  • k 0.3;
  • epsilon 0.3;
This worked. After 550 time steps the velocity field does not shows any particular problems. However, pressure residual convergence is not nice, see the attached file.
What parameters should I change to tune my simulation?

mad
Attached Images
File Type: jpg uMagVeg.jpg (43.4 KB, 145 views)
Attached Files
File Type: pdf pConv.pdf (15.4 KB, 86 views)
maddalena is offline   Reply With Quote

Old   October 10, 2010, 19:46
Default
  #32
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
Hi Maddalena,

I'm not sure how to proceed next. You numerics looks stable. You could try mapping your turbulence properties as well and use pure upwind convection for turbulence. I guess you are having stability problems because there is a discontinuity in your pressure field over the fan while your velocity field is continuous. You could try reverse mapping your pressure field with a prescribed mean, but this might just make things worse. You could also try zero gradient p at the outlet, but again this will not necessarily improve stability. There is a "fixedMeanValue" boundary type in OpenFOAM-Extend that might be a better fit for your problem.
eugene is offline   Reply With Quote

Old   October 11, 2010, 03:50
Default
  #33
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Eugene and thank you for your answer.
Quote:
Originally Posted by eugene View Post
I guess you are having stability problems because there is a discontinuity in your pressure field over the fan while your velocity field is continuous.
Yes, that sounds a logical explanation. But this is a fan indeed!
Quote:
Originally Posted by eugene View Post
You could also try zero gradient p at the outlet, but again this will not necessarily improve stability.
Already tried that (some posts above, but it is "hidden"). You are right, stability does not improve.
Quote:
Originally Posted by eugene View Post
There is a "fixedMeanValue" boundary type in OpenFOAM-Extend that might be a better fit for your problem.
Ok, this will be my following step. I will try this solution as soon as my processors will be free. Thanks once again.
Cheers

mad
maddalena is offline   Reply With Quote

Old   October 12, 2010, 10:45
Default
  #34
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Quote:
Originally Posted by eugene View Post
There is a "fixedMeanValue" boundary type in OpenFOAM-Extend that might be a better fit for your problem.
Tried that, without success...
maddalena is offline   Reply With Quote

Old   June 27, 2011, 11:35
Default
  #35
Member
 
Nicolas
Join Date: Apr 2011
Location: Biarritz / France
Posts: 33
Rep Power: 15
NicolasB is on a distinguished road
Hi Maddalena,

Sorry for digging out this old post.

I'd like to set the mass flow rate on a fan. But I've a problem with my mesh, and I think you could help me.
I made my mesh with Gambit, setting the fan as "fan". I import it with the "fluent3DMeshToFoam" utility. The fan become a cyclic patch, and when I give the next BC:
type flowRateInletVelocity;
patchType cyclic;
flowRate 8.79;
value uniform (2 0 0);
it's applied on both sides of the fan... with external normal
Could you, please, teach me how to use the mesh utilities in order to have a "fan_inlet" and a "fan_outlet"? unless there is an other solution, like giving a vector.
I've successfully tried to give a velocity, but that's not what I need.

Regards,
Nicolas
NicolasB is offline   Reply With Quote

Old   June 28, 2011, 04:06
Default
  #36
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hi Nicolas,
of course this will not work:
Quote:
Originally Posted by NicolasB View Post
type flowRateInletVelocity;
patchType cyclic;
flowRate 8.79;
value uniform (2 0 0);
You cannot define something as cyclic and than apply to it a standard BC! Cyclic wants something that requires cyclic, i.e. cyclic or fan. Not something else.

As for concluding my discussion above, I used a modified simpleFoam version in such a way that some properties may be given to specific cellSets. robingilbert made this solver, so you should ask to him to have a copy of it.

mad
maddalena is offline   Reply With Quote

Old   June 30, 2011, 09:09
Default
  #37
Member
 
Nicolas
Join Date: Apr 2011
Location: Biarritz / France
Posts: 33
Rep Power: 15
NicolasB is on a distinguished road
Hi Maddalena,

Thank you very much for your answer.
I gave up this option and dug a bit more the standard "fan" BC. In fact I had a problem since I regrouped 3 fans in the same patch. I fixed it by splitting my patch and setting up the pressure jump with the right sign for each fan.

Now this is working, I'd like to complicate.
I described my case in this thread, in which you wrote a lot

Regards,
Nicolas
NicolasB is offline   Reply With Quote

Old   October 27, 2011, 06:10
Default same problem
  #38
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 15
dhruv is on a distinguished road
Hi Maddalena,

I am trying to simulate a fan in a channel, and I am having the same problem. The pressure at the inlet of the fan is higher than the pressure at the outlet. How did you correct it?

Regards,

Dhruv.

Quote:
Originally Posted by maddalena View Post
Hi,
Just to say I have solved this:

and now pressure has the expected distribution. However, the simulation is not stable and residual never get low. My fvScheme and fvSolution should not be the problem: they are tuned for similar cases. I guess the BC are not set correctly to simulate what I want to solve. Is there anyone that can help me to understand what my errors can be?
Regards

maddalena
dhruv is offline   Reply With Quote

Old   October 27, 2011, 08:41
Default
  #39
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hello,
Quote:
Originally Posted by dhruv View Post
I am having the same problem. The pressure at the inlet of the fan is higher than the pressure at the outlet.
what is the same problem? unstable simulation or flow going on the opposite direction you want to?
What OF version are you using? starting from 2.0.0 there is a new bc to simulate fan properly: http://www.cfd-online.com/Forums/ope...essure-bc.html

mad
maddalena is offline   Reply With Quote

Old   November 2, 2011, 04:41
Default flow in opposite direction
  #40
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 15
dhruv is on a distinguished road
Hi Maddalena,

thanks for the reply. The problem was flow going in opposite direction, which I have solved now, by changing the order for the patches in the boundary file.

Regards,
Dhruv

Quote:
Originally Posted by maddalena View Post
Hello,
what is the same problem? unstable simulation or flow going on the opposite direction you want to?
What OF version are you using? starting from 2.0.0 there is a new bc to simulate fan properly: http://www.cfd-online.com/Forums/ope...essure-bc.html

mad
dhruv is offline   Reply With Quote

Reply

Tags
closed loop, directmappedpatch, fan, flowrateinletvelocity, fluxcorrectedvelocity, mass flow rate


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
Mass flow rate: calculation v/s computation beguxa FLUENT 5 December 2, 2018 22:02
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 15:10
Target mass flow rate Saturn FLUENT 0 December 10, 2004 05:18
Mass flow rate Neser CFX 4 February 14, 2004 01:27


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