CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Swirl at inlet boundary (https://www.cfd-online.com/Forums/openfoam-solving/71541-swirl-inlet-boundary.html)

kjetil January 6, 2010 18:05

Swirl at inlet boundary
 
Dear foamers :)

I would like to have a swirl as inlet condition for a single phase flow, preferably when using simpleFoam. I can only find engineSwirl, and no proper documentation - it there any other way to get this property to an inlet BC?

olesen January 7, 2010 03:00

1 Attachment(s)
Quote:

Originally Posted by kjetil (Post 241687)
Dear foamers :)

I would like to have a swirl as inlet condition for a single phase flow, preferably when using simpleFoam. I can only find engineSwirl, and no proper documentation - it there any other way to get this property to an inlet BC?

Attached is a swirl inlet velocity boundary condition that I have kicking around. Unfortunately I don't actually know in what condition it is (I haven't needed it for several years), but you might give it a try anyhow.

francescomarra January 7, 2010 05:20

I would also suggest the lecture of the excellent wiki page of the Sig Turbomachinery at the following link:

http://www.openfoamwiki.net/index.ph...Turbomachinery

Following the link to the Validation test cases you will find explanation about an alternative way to set swirling boundary conditions.

Hope this help.

Franco

kjetil January 10, 2010 17:08

Thanks francescomarra, have you tried this one on OF 1.6(.x) ?

francescomarra January 10, 2010 17:29

I was able to compile and use the addSwirlAndRotation utility. It is simple and almost self explaining. It uses the constant/swirlAndRotationDict to define the angular velocity of swirl and the rotation vector.
After having defined the normal component of inlet velocity and interior initial velocity in the file 0/U , by running this utility you get the same file modified to take into account the swirling applied to the boundary and, if desired, to the initial conditions.

It was easy to modify this routine to get different swirling velocities for two coaxial annular jets.

Let me know if you need further details.

Regards,
Franco

kjetil January 10, 2010 17:37

Ok. Upon compiling, I get the error " cannot find -lincompressibleTurbulenceModels", also when doing a "full" build of the OSIG-dir.

Did you compile only the preProcessing-directory, or the entire OSIG-package found in the 'Breeder' directory in the SVN?

kjetil January 11, 2010 16:47

Problem solved using what's found in trunk 'Breeder_1.5', not just 'Breeder'.

stonehope May 13, 2010 17:12

Problems with compiling addSwirlAndRotation on OF 1.6.x
 
Hey foamers,

i am quiet new to OF and get in trouble by compiling addSwirlAndRotation following the wiki (http://openfoamwiki.net/index.php/Si...diffuser#Case1).
I am using Ubuntu and OF 1.6.x.
First i thought it depends on compiling under OF 1.6.x, but after using google i found this thread.
Can anyone maybe help me al little to fix the errors i get.

By typing:
stonehope@ubuntu:~/OpenFOAM/stonehope-1.6.x/applications_SIGturbo/utilities/preProcessing/addSwirlAndRotation$ wmake

I get the response:

Making dependency list for source file addSwirlAndRotation.C
could not open file geometricOneField.H for source file addSwirlAndRotation.C
SOURCE=addSwirlAndRotation.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -I/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/turbulenceModels/RAS -I/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/transportModels -IlnInclude -I. -I/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/addSwirlAndRotation.o
In file included from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvm.H:44,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvCFD.H:10,
from addSwirlAndRotation.C:33:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.H:41:31: error: geometricOneField.H: No such file or directory
In file included from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvm.H:44,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvCFD.H:10,
from addSwirlAndRotation.C:33:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.H:63: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.H:65: error: ISO C++ forbids declaration of ‘geometricOneField’ with no type
In file included from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.H:90,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvm.H:44,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvCFD.H:10,
from addSwirlAndRotation.C:33:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.C:63: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.C:65: error: ISO C++ forbids declaration of ‘geometricOneField’ with no type
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.C: In function ‘Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(int)’:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmDdt.C:67: error: ‘vf’ was not declared in this scope
In file included from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvm.H:47,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvCFD.H:10,
from addSwirlAndRotation.C:33:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.H: At global scope:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.H:88: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.H:91: error: ISO C++ forbids declaration of ‘geometricOneField’ with no type
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.H:96: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.H:98: error: ISO C++ forbids declaration of ‘geometricOneField’ with no type
In file included from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.H:188,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvm.H:47,
from /home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvCFD.H:10,
from addSwirlAndRotation.C:33:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:133: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:136: error: ISO C++ forbids declaration of ‘geometricOneField’ with no type
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C: In function ‘Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::laplacian(int)’:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:138: error: ‘vf’ was not declared in this scope
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C: At global scope:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:146: error: expected ‘,’ or ‘...’ before ‘&’ token
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:148: error: ISO C++ forbids declaration of ‘geometricOneField’ with no type
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:148: error: redefinition of ‘template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::laplacian(int)’
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:136: error: ‘template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::laplacian(int)’ previously declared here
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C: In function ‘Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::laplacian(int)’:
/home/stonehope/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude/fvmLaplacian.C:150: error: ‘vf’ was not declared in this scope
make: *** [Make/linuxGccDPOpt/addSwirlAndRotation.o] Error 1



I just got the files from:

svn checkout http://openfoam-extend.svn.sourcefor...y/applications applications_SIGturbo

and

svn checkout http://openfoam-extend.svn.sourcefor...oMachinery/src src_SIGturbo


that means the ../Breeder1_5/..-directories as mentioned above.

I am happy for any request(s).

Thanks.

stonehope

kjetil May 13, 2010 17:38

You just need the application dir in postProcessing called 'addSwirlAndRotation'. Make a svn checkout, and do "wmake", that's it.

And make sure you do this inside the OpenFOAM environment. I put this in an application folder under my "<user>-1.6.x" ...

stonehope May 13, 2010 18:23

hey kjetil,

greateful thanks for your quick help!!!

I tried as you told me, but finally it did not start working.

Searching for possible Reasons guided me to the problem with geometricOneField.H .

It is discussed at

http://www.cfd-online.com/Forums/ope...ion-error.html

and updating the corresponden link(s) solved my problem.

Compiling is no Problem anymore.

Thx.

stonehope

shajitah July 23, 2010 18:42

Dear foamers,

I really enjoyed your forum discussion about addSwirlAndRotation. Actually, I've compiled addSwirlAndRotation successfully, but it doesn't make any "swirlAndRotationProperties" dictionary file. So, I was just wondering if you could please provide me with a sample of "swirlAndRotationProperties" dictionary file or show me a link of download.

I look forward to hearing from you.

Thanks a lot,
Sina

stonehope July 24, 2010 05:28

Hi,

when you take a look to:

http://openfoamwiki.net/index.php/Si...se0:_Base_case

Here you can find something like this:

"....In the swirlAndRotationProperties dictionary you also specify the swirl/rotation in terms of the omega[radians per second] vector and the center of rotation vector. The switches modifyBoundaries and modifyInterior can be modified to control if both the boundaries and the interior should be modified, or only one of them.
An example of the swirlAndRotationProperties dictionary can be found in Case1."


According to this you can find the swirlAndRotationProperties under:

https://openfoam-extend.svn.sourcefo...tionProperties


What you see then should look like this:




/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object swirlAndRotationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

modifyBoundaries yes;

modifyInterior yes;

omega omega [0 2 -1 0 0 0 0] (0.0 0.0 52.646);

center center [0 0 0 0 0 0 0] (0.0 0.0 0.0);

rotatingPatches (
inlet
rotSwirlWall
);

// ************************************************** *********************** //



Use this to set your own rotating swirl.

PS: Don't forget to update the BC's for the use of addSwirlAndRotation.

universez August 31, 2010 15:41

Swirl and rotation does not work in compressible flow solver?
 
Hi, is this working with compressible flow?
I tried sonicFoam and rhoPisoFoam, none of them give reasonable results.

any suggestion?

Thanks,

Yu


Quote:

Originally Posted by stonehope (Post 268767)
Hi,

when you take a look to:

http://openfoamwiki.net/index.php/Si...se0:_Base_case

Here you can find something like this:

"....In the swirlAndRotationProperties dictionary you also specify the swirl/rotation in terms of the omega[radians per second] vector and the center of rotation vector. The switches modifyBoundaries and modifyInterior can be modified to control if both the boundaries and the interior should be modified, or only one of them.
An example of the swirlAndRotationProperties dictionary can be found in Case1."


According to this you can find the swirlAndRotationProperties under:

https://openfoam-extend.svn.sourcefo...tionProperties


What you see then should look like this:




/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object swirlAndRotationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

modifyBoundaries yes;

modifyInterior yes;

omega omega [0 2 -1 0 0 0 0] (0.0 0.0 52.646);

center center [0 0 0 0 0 0 0] (0.0 0.0 0.0);

rotatingPatches (
inlet
rotSwirlWall
);

// ************************************************** *********************** //



Use this to set your own rotating swirl.

PS: Don't forget to update the BC's for the use of addSwirlAndRotation.


kjetil August 31, 2010 15:50

The rotating inlet is changing your inlet velocity field only, shouldn't be any further problem with the solver itself.

universez September 1, 2010 13:58

2 Attachment(s)
Hi, Kjetil,

you are right, the solver is ok.

The problem i think is because paraview did not show correct results. See the attached pictures (Case1.3 from http://openfoamwiki.net/index.php/Si...nical_diffuser).

I plotted the z componet of vector U (U Z) and Uz calcualted from foamCalc (sliced by the plane in the z direction and passing point(0,0,0)). They are different. I checked U file and know the file is ok. I think there is something wrong with paraview.

Thanks,
yu

wiedangel December 10, 2012 09:14

Hi all,

I am trying to compile the addSwirlAndRotation utility but I get the followinf error, I guess about the decomposer metis:

Quote:

>> wmake
Making dependency list for source file addSwirlAndRotation.C
SOURCE=addSwirlAndRotation.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/turbulenceModels/RAS -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/transportModels -IlnInclude -I. -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc46DPOpt/addSwirlAndRotation.o
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/lnInclude -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/turbulenceModels/RAS -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/transportModels -IlnInclude -I. -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude -I/home/wi/OpenFOAM/OpenFOAM-1.6-ext/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64Gcc46DPOpt/addSwirlAndRotation.o -L/home/wi/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt \
-lincompressibleRASModels -lincompressibleTransportModels -lfiniteVolume -lmeshTools -lOpenFOAM -liberty -ldl -lm -o /home/wi/OpenFOAM/wi-2.1.1/applications/bin/linux64Gcc46DPOpt/addSwirlAndRotation
/usr/bin/ld: warning: libmetis-parmetis.so, needed by /home/wi/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt/openmpi-system/libparMetisDecomp.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libparmetis.so, needed by /home/wi/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt/openmpi-system/libparMetisDecomp.so, not found (try using -rpath or -rpath-link)
/home/wi/OpenFOAM/OpenFOAM-1.6-ext/lib/linux64Gcc46DPOpt/openmpi-system/libparMetisDecomp.so: undefined reference to `ParMETIS_V3_PartGeomKway'
collect2: ld returned 1 exit status
make: *** [/home/wi/OpenFOAM/wi-2.1.1/applications/bin/linux64Gcc46DPOpt/addSwirlAndRotation] Error 1
does any of you know how I can solve this compilation error?

Thank you in advance.

Regards,

widedangel

maciejaser September 17, 2013 12:24

Problem with addSwirlAndRotation
 
Hi,

This is my first post. I've problem with paraview or another. In my case (simple cylinder) I've swirl on face "inlet". Swirl is forced by utility named "applications_SIGturbo". My mesh is made in enGrid and it has boundary layer on cylindrical wall. Inlet velocity is 1 (one) m/s. I use simpleFoam (openFoam) to solve it. Problem is, when i start paraview (paraFoam 4.0) the velocity has very very big value (over 1000 m/s !!!) but behavior of a swirl is properly. Does anyone know what is wrong?

thanks for help.

kjetil January 7, 2014 04:52

Lower your relaxation factors in the beginning.

ggulgulia July 6, 2017 15:08

there is no mention of swirl here :(

tiwari October 19, 2017 02:46

How to add swirl at inlet BC
 
Hi, I am using openFoam4.1. I want to add swirl at my inlet to the axisymmetric jet but unable to implement.
I tries using
inlet
{
type swirlFlowRateInletVelocity;
flowRate constant 0.2;
rpm constant 100;
uniform value (1 0 0)
}
I saw the previous post but none were helpful.
Please suggest and guide.


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