CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Suggestions for a fan (

fra76 April 7, 2006 05:20

Hi! I'd like to simulate a fa
I'd like to simulate a fan rotating within a bigger mesh with OpenFOAM.
The question is: which is the best way to do this? I mean, sliding meshes, or defining a rotating part of the grid, or setting a prevalence and a swirl as boundary condition...

hjasak April 7, 2006 06:19

Depends whether the outer stat
Depends whether the outer static part influences the solution around the fan. In mixer vessels for example, the outside part will have baffles etc. and for an accurate simulation you need a sliding interface. On the other hand, if your case is something like a ceiling fan in a room, just mesh it statically and spin the whole thing.



lillberg April 7, 2006 06:32

Hi Hrvoje, What do you mee
Hi Hrvoje,

What do you meen by "spin the whole thing"?


hjasak April 7, 2006 06:35

I mean add the centrifugal and
I mean add the centrifugal and Coriolis force into the momentum/pressure coupling and specify the conditions in the rotating frame of reference.

Does that sound OK?


lillberg April 7, 2006 06:43

Oh, of course... For a whil
Oh, of course...

For a while I thought you had implemented even more ingenious ways to transform the mesh :-)


fra76 April 11, 2006 09:53

Hi again! I've decided to try
Hi again!
I've decided to try perhaps the hardest way, but I'd like to simulate the fan with a sliding interface.
Is there a tutorial which explains how to use this feature?
Thanks a lot

guido_adriaensen April 14, 2006 02:12

Hello, You probably already

You probably already found this one, but anyway. You could have a look at the mixer2D case inside icoTopoFoam.

I am currently trying to simulate a fan with sliding meshes as well in 3D that is, but I keep having problems with the convergence. I tried several b.c.'s but it did not help. After a while the solution blows up, courant no's go to infinity. I also tried to increase my domain but, this did help either. I thought it might be a problem with my mesh, so I made another testcase, but also for this case the courant no blows up. The mesh I'm using is not of perfect quality, by far not. Could this be the reason for the solution to blow up? Is it possible to get the solution to convergence even on a not so good mesh?
Background info for this simulation is that I would like to simulate a helicopter. So I wanted to start by simulating a rotating fan :-)

kind Regards

guido_adriaensen April 19, 2006 05:49

Hello, If you'are intereste

If you'are interested I now have made a mixer3D case, based upon the mixer2D case. It is not exactly the 2D case extracted in the third dimension, it only has a fan. I have done simulations for 10RPM, but also for 3000RPM.

I would now like to expand the simulation to turbFoam, I would like to create something like turbTopoFoam. Could anybody instruct me where to start looking, what do I need to modify?

kind regards

giampippetto April 19, 2006 14:09

Hi guido, I've already buil
Hi guido,

I've already built a turbTopoFoam application somehow (i'm not very expert in CFD), but in my tests it always diverges, so for the moment I've put it aside. Moreover the dynamic mesh thing seems to have changed from 1.2 to 1.3, I aven't had time yet to look into 1.3 so I'm not sure that my code is still valid. However if you're interested I can send you my source code, let me know.


guido_adriaensen April 20, 2006 01:54

Hello Andrea, I would be ve
Hello Andrea,

I would be very interested in your application. As I understand it has been written for OF1.2, I'm currently still working with that version as well, so that should not cause any problem.

I haven't made the switch to OF1.3 yet, so I cannot yet comment on the changes regarding dynamic meshes. Maybe some of the experts around here? Is it recommended to make the switch to OF1.3, if so why?

thank you

gschaider April 20, 2006 06:35

Guido: If you want to increase
Guido: If you want to increase the speed of your calculations by 10% without increasing the clock-rate of your computer, then I would recommend OF. For other reasons to upgrade: see the README-file.

(and so far I've seen no bad effects of upgrading)

guido_adriaensen May 3, 2006 09:22

Hello, I have added mixerFv

I have added mixerFvMesh to rhoTurbFoam and created a kind of rhoTurbTopoFoam. The application runs, but I would like to know whether I should make adjustments to the equations that are being solved, or is this automagically oke?
If have run the mixer2D tutorial and it works, at least the propellor rotates and the solution does not diverge.
I don't know if it is relevant, but I'm using OF1.2
Is it really this simple? If so, great job guys! If not where to start? Any hints?

kind regards

hjasak May 3, 2006 09:38

Yup, it is that simple. If you
Yup, it is that simple. If you're getting the solution and using the pressure-velocity bits like in icoTopoFoam, the turbulence will just slot into place.



guido_adriaensen May 3, 2006 09:59

Hi Hrv. That is what I have
Hi Hrv.

That is what I have been doing!
You have done a great job, my compliments. OF keeps on amazing me :-)

kind regards.

fra76 May 29, 2006 08:51

Hi, I'm still working on th

I'm still working on the fan, without sliding interfaces.
I'd like to build a turbulent, steady state solver for a still volume containing a rotating zone.
I don't know if I'm on the right way, but I've deduced this equations, in order to modify simpleFoam:

volVectorField Fcent = (Omega ^ (Omega ^ mesh.C()));
volVectorField Vtang = (Omega ^ mesh.C());


tmp<fvvectormatrix> UEqn
fvm::div(phi, U)
+ turbulence->divR(U)
+ (2*Omega ^ U)
+ Fcent
+ fvm::div(phi, Vtang)
+ turbulence->divR(Vtang)
+ (2*Omega ^ Vtang )


solve(UEqn() == -fvc::grad(p));


where Omega is a (constant) vector field read from an input file. The corresponding section in createField.H is:

Info << "Reading field Omega\n" << endl;
volVectorField Omega

Well, the error I get, after adding the entries corresponding to "(Omega^C)" in the divSchemes and laplacianSchemes sections in the fvSchemes file, is:

Starting time loop

Time = 0.01

--> FOAM FATAL ERROR : gradientInternalCoeffs cannot be called for a calculatedFvPatchField.
You are probably trying to solve for a field with a calculated boundary conditions.

From function calculatedFvPatchField<type>::gradientInternalCoef fs() const
in file fields/fvPatchFields/basicFvPatchFields/calculated/calculatedFvPatchField.C at line 172.

FOAM exiting

I read in the message board that this is an error related to some misdeclaration of a boundary, but I've checked all my input files...

What can be wrong?


hani July 4, 2006 05:51

Hi Guido, How can I get you
Hi Guido,

How can I get your mixer3D case?

I'm trying to understand how to set up a sliding grid interface in OF1.3. Did you port your code and case to OF1.3?

Can you show which lines you changed in icoTopoFoam to make it into turbTopoFoam?


francesco_b January 18, 2008 05:31

Hi Hrv, you wrote: "I
Hi Hrv,

you wrote:

"I mean add the centrifugal and Coriolis force into the momentum/pressure coupling and specify the conditions in the rotating frame of reference."

Which conditions should I specify? Can you better explain what is the rotating frame of reference?

I'm quite new to this kind of problems, so please be patient with me

Thank you in advance


jaswi January 18, 2008 10:57

Hi Francesco for the start
Hi Francesco

for the start please go through the material on this link. 552.htm

Once you know what rotating frame of reference means and how the momentum equations are modified for this purpose , you will be able to ask specific questions and believe me people do help on this forum.

Just be more specific.

Hope that helps

Start FOAMing NOW :-)

Best Regards

francesco_b January 23, 2008 12:58

Hi Jaswinder, Thank you for
Hi Jaswinder,

Thank you for the material, very interesting

My case is like the one in fig. 16.3.2; the problem is that I don't know how to impose the boundary condition on the interface between the two reference frames, I looked in the mixerVessel2D tutorial but I could not find the answer. I think I'm missing something, any hints?

Thanks in advance


jaswi January 29, 2008 07:41

Hi Francesco Sorry for the
Hi Francesco

Sorry for the late reply.

If there are no problems in revealing the geometry to others then mail me the case setup . I will take a look at it and try to resolve the issue.

As far as i have understood the mixer setup in openfoam, there is no need to define a boundary condition on the interface. The way you define your zones is important.

Regarding the mixerVessel2D case, which one are you using as it has been set up using two approaches in the Prof. Jasak's dev version.

- MRF using the static mesh approach
- icoDynFOAM using the dynamic mesh appraoch (look for mixerVessel2D case under the icoDynFOAM tutorials)

Best Regards

All times are GMT -4. The time now is 13:06.