# Rotating Disc in a Volume of Air

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 24, 2009, 14:06 Rotating Disc in a Volume of Air #1 New Member   Daniel McGregor Join Date: Aug 2009 Location: Denver, Colorado Posts: 5 Rep Power: 9 Hello All- I am new to CFD solvers therefore would like benefit from the knowledge base this forum represents. Can OpenFOAM solve the following test case? Physical Problem Description/Definition: a) Define a disc in a volume of air. The disc would of negligible thickness, but rigid. Since I intend to spin the disc about its central axis, I am thinking that it would be a good idea to take advantage of symmetry and define both the volume of air and the disc in a cylindrical coordinate system (not a requirement, but it would make pre- and post-processing easier, so software that makes this easy would be desirable). Initial Conditions: a) Assign a rotational velocity to the disc, i.e., assign a tangential (to the axis of rotation) surface velocity to the individual mesh elements of the disc. once again a preprocessor that would use a cylindrical coordinate system would be desirable... b) the air in the volume (the cylindrical "can") is initially at rest and, if need be, the air in contact with the boundary of the volume would be zero. Solving: a) solve for a steady state solution. the spinning disc should cause the air in the volume to spin as well. the steady state solution should be where the rotation of the air reaches equilibrium with the spinning disc. (At least this what I think should happen!!) Post Processing: a) have a look at the normal forces on the surface of the disc (induced by the Bernoulli effect) as a function of radius b) have a look at how the air in the volume rotates as a function of the rotating disc That's It! Can OpenFOAM do this problem? Any help in narrowing my search for a solver (and pre- and post-processor) is appreciated!!

August 25, 2009, 04:12
#2
Senior Member

Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,702
Rep Power: 27
Hi Daniel

I believe I can answer all of your questions except the one related to cylindrical coordinate system. However many threads does exist on that topic.

Quote:
 Originally Posted by alcesalces Initial Conditions: a) Assign a rotational velocity to the disc, i.e., assign a tangential (to the axis of rotation) surface velocity to the individual mesh elements of the disc. once again a preprocessor that would use a cylindrical coordinate system would be desirable... b) the air in the volume (the cylindrical "can") is initially at rest and, if need be, the air in contact with the boundary of the volume would be zero.
ad a) you should definitely consider the add-on "groovyBC", which allows you to specify spatial varying boundary conditions easily. Look at the wiki or elsewhere on this forum.

ad b) With respect to setting the wall velocity to zero look into any of the tutorials or if the boundary layer at the far walls are of no interest simply use slip conditions.

Quote:
 Originally Posted by alcesalces Solving: a) solve for a steady state solution. the spinning disc should cause the air in the volume to spin as well. the steady state solution should be where the rotation of the air reaches equilibrium with the spinning disc. (At least this what I think should happen!!)
ad a) I believe as well that you can achieve some kind of (at least in a time averaged sence) equilibrium, and if this is what you are looking for, you could benifite from simpleFoam, which solves for steady state problems. If you are also interested in the transient solution, then look into turbFoam. Both solves the RANS equations.

Quote:
 Originally Posted by alcesalces Post Processing: a) have a look at the normal forces on the surface of the disc (induced by the Bernoulli effect) as a function of radius b) have a look at how the air in the volume rotates as a function of the rotating disc That's It! Can OpenFOAM do this problem? Any help in narrowing my search for a solver (and pre- and post-processor) is appreciated!!
Look into the functionObject called forces. Search on this forum and you will find lots of information. If it does not completely fulfill your requirements it would at least be a could platform to start off from while building your own functionality.

I hope this helps. Good luck,

Niels

 August 30, 2009, 16:17 #3 Senior Member   Steve Hansel Join Date: Jun 2009 Location: Colorado, USA Posts: 112 Rep Power: 9 This could also be done using the -dev version of openFoam and the ggi features which allow you to spin a mesh. See http://www.youtube.com/watch?v=qr-HUpWKPsM if you want to see an example of what can be done with the spinning mesh. In your case you'd just replace the plate with a cylinder.

 September 1, 2009, 16:10 #4 Senior Member   Vincent RIVOLA Join Date: Mar 2009 Location: France Posts: 281 Rep Power: 10 Hi everybody, I need some advice about groovyBC boundary condition. I am also simulating a disc. So far I used cyclic boundary condition in order to impose a difference in pressure through the disc. However I'd like to also impose a tangential and radial velocity as well as a deltaP depending on the position on the disc. GroovyBC looks like a good choice, but I'm not sure if it can replace the cyclic boundary condition. I tried to impose a deltaP using the groovyBC but I don't know how to write it correctly in the p file. Thanks a lot for any help you can provide. Vincent

September 2, 2009, 08:42
#5
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,951
Rep Power: 41
Quote:
 Originally Posted by vinz Hi everybody, I need some advice about groovyBC boundary condition. I am also simulating a disc. So far I used cyclic boundary condition in order to impose a difference in pressure through the disc. However I'd like to also impose a tangential and radial velocity as well as a deltaP depending on the position on the disc. GroovyBC looks like a good choice, but I'm not sure if it can replace the cyclic boundary condition. I tried to impose a deltaP using the groovyBC but I don't know how to write it correctly in the p file. Thanks a lot for any help you can provide. Vincent
Currently the groovyBC can only replace boundary conditions that are based on the the mixedFvPatchField-class (or fixedValue or fixedGradient). You are talking about a boundary condition that is based on cyclicFvPatchField, right?

- no, you can't specify the deltaP using the vanilla-groovyBC
The good news is:
You can write your own boundary condition (based on the one you want to extend). Just derive your own boundary-condition from it. Add a parameter that would look like
deltaPExpression "pos().x > 0.5 ? 20 : 10";
Have look at the orignal groovyBC how such a string is read and parsed (giving you back a scalarField) using that field let the super-class set the actual boundary condition (provided the superclass allows non-homogenous pressureJumps, otherwise you'll have to adapt it)

Basically any boundary condition that accepts fields can be groovyfied in such a way

Bernhard

 September 3, 2009, 08:35 #6 Senior Member   Vincent RIVOLA Join Date: Mar 2009 Location: France Posts: 281 Rep Power: 10 Thanks for those information Bernhard. I decided to extend the solver simpleFoam into acSimpleFoam. I did this only by adding a source term in the U equation. Then, I create a new vector field named force in order to be able to impose a force into a zone of my domain. Basically this force is zero everywhere except around the disk in order to create a flow through the disk.This gives me the possibility to impose a force with the direction I want and the amplitude I want on the disk. I use GridPro as a mesh generator, I impose some block conditions and I use the gridpro2Foam converter to extract the cells close to the disk on which I want to impose my force. This creates a cellZone file with these cells. I tried to use funkySetFields in order to set the force field at a specific value only for the points in the cellZone. However I get an error when I try to do this: in funkysetfielddict I write this : expressions ( force { field force; //field to initialise create true; expression "vector(0,0,-100)"; condition "zone(boundaryZone)"; //impose force only on boundaryZone } ); but I get this error: Part: force Creating field force Putting "vector(0,0,-100)" into field force at t = "0" if condition "zone(boundaryZone)" is true No set "boundaryZone" at t="0" falling back to 'constant' Parser Error at "1.5-16" :"cell/zone id boundaryZone not existing or of wrong type" "zone(boundaryZone)" " ^^^^^^^^^^^^ " From function parsingValue in file ValueExpressionDriver.C at line 74. FOAM exiting my cellZone file looks like this: FoamFile { version 2.0; format ascii; root "OpenFoamFiles/run/tutorials/icoFoam"; case "actuatorDisk"; instance ""constant""; local "PolyMesh"; class regIOobject; object cellZones; } 1 ( boundaryZone { type cellZone; cellLabels List

September 3, 2009, 13:56
#7
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,951
Rep Power: 41
Quote:
 Originally Posted by vinz I tried to use funkySetFields in order to set the force field at a specific value only for the points in the cellZone. However I get an error when I try to do this: in funkysetfielddict I write this : expressions ( force { field force; //field to initialise create true; expression "vector(0,0,-100)"; condition "zone(boundaryZone)"; //impose force only on boundaryZone } ); but I get this error: Part: force Creating field force Putting "vector(0,0,-100)" into field force at t = "0" if condition "zone(boundaryZone)" is true No set "boundaryZone" at t="0" falling back to 'constant' Parser Error at "1.5-16" :"cell/zone id boundaryZone not existing or of wrong type" "zone(boundaryZone)" " ^^^^^^^^^^^^ " From function parsingValue in file ValueExpressionDriver.C at line 74. FOAM exiting my cellZone file looks like this: FoamFile { version 2.0; format ascii; root "OpenFoamFiles/run/tutorials/icoFoam"; case "actuatorDisk"; instance ""constant""; local "PolyMesh"; class regIOobject; object cellZones; } 1 ( boundaryZone { type cellZone; cellLabels List
I tried it. It works for me.

No idea. Except one: you talk about the cellZone-file. Surly you mean cellZones and forgot the "s"? Check with checkMesh how many cell-zones OpenFOAM recognizes for your mesh. Otherwise rename the file

Bernhard

 September 4, 2009, 01:49 #8 Senior Member   Vincent RIVOLA Join Date: Mar 2009 Location: France Posts: 281 Rep Power: 10 Thanks a lot Bernhard. In fact my file was named cellzones instead of cellZones! Stupid me! So now it works. I am going to play with funkySetFields. I'll try to post some pictures of the results later. Thanks again. Regards, Vincent

 September 4, 2009, 08:27 #9 Senior Member   Vincent RIVOLA Join Date: Mar 2009 Location: France Posts: 281 Rep Power: 10 Dear Bernhard, Is there a way to specify variables in funkySetFields like in groovyBC? Also I am using the folowing dict: force { field force; //field to initialise create true; expression "vector(100000*sqrt(pos().x*pos().x+pos().y*pos(). y),100000*sqrt(pos().x*pos().x+pos().y*pos().y),-100000)"; condition "zone(boundaryZone)"; //impose force only on boundaryZone dimension [0 1 -2 0 0 0 0]; } However the dimension is not set in force field which is created. In the file I still have a dimension [0 0 0 0 0 0 0] that I have to change by hand. Is it done on purpose or am I doing something wrong here? Thanks for your precious help. Regards, Vincent

September 7, 2009, 14:02
#10
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,951
Rep Power: 41
Quote:
 Originally Posted by vinz Dear Bernhard, Is there a way to specify variables in funkySetFields like in groovyBC?
I'm sorry: no
Quote:
 Originally Posted by vinz Also I am using the folowing dict: force { field force; //field to initialise create true; expression "vector(100000*sqrt(pos().x*pos().x+pos().y*pos(). y),100000*sqrt(pos().x*pos().x+pos().y*pos().y),-100000)"; condition "zone(boundaryZone)"; //impose force only on boundaryZone dimension [0 1 -2 0 0 0 0]; } However the dimension is not set in force field which is created. In the file I still have a dimension [0 0 0 0 0 0 0] that I have to change by hand. Is it done on purpose or am I doing something wrong here?
No. You're doing nothing wrong. The problem seems to be, that in
Code:
```                dimensionSet dim(0,0,0,0,0);

if (part.found("dimension")) {
dim=dimensionSet(part.lookup("dimension"));
}```
the assignment doesn't work the way I expected it to. I'll have a closer look and see what can be done

Bernhard

 March 16, 2011, 12:30 #11 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 211 Rep Power: 10 I am sorry to reopen this thread, but I tried to use the dimension statement in a funkySetFieldDict and it did not work. Giving it as an option to the funkySetField command works well and the dimensions a set correctly but as an entry in the dictionary it do not work. Did you fixed this problem? thx, fs82

March 16, 2011, 13:23
#12
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,951
Rep Power: 41
Quote:
 Originally Posted by fs82 I am sorry to reopen this thread, but I tried to use the dimension statement in a funkySetFieldDict and it did not work. Giving it as an option to the funkySetField command works well and the dimensions a set correctly but as an entry in the dictionary it do not work. Did you fixed this problem? thx, fs82
Which version of FSF are you using? I quickly checked the version that is in swak4Foam and there is code there that should take care of this. Are you sure the dimension entry is read? (insert a syntax error and watch FSF fail)

Bernhard

 March 17, 2011, 04:21 #13 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 211 Rep Power: 10 I think the entry is right, because funkySetFields complain about a wrong dimension entry. The entry in the funkySetFieldDict looks like this: example { create 1; field test; dimension [0 -1 0 0 0 0 0]; expression "0"; } But as a result the field has dimension [0 0 0 0 0 0 0]. The version is difficult to find out, but in funkySetField.C the header says: ICE Revision: \$Id: funkySetFields.C 7567 2007-06-20 12:38:50Z bgschaid \$ Thx for your help :-D By the way, what is swak4Foam? kind regards, Fabian

March 17, 2011, 06:33
#14
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,951
Rep Power: 41
Quote:
 Originally Posted by fs82 I think the entry is right, because funkySetFields complain about a wrong dimension entry. The entry in the funkySetFieldDict looks like this: example { create 1; field test; dimension [0 -1 0 0 0 0 0]; expression "0"; } But as a result the field has dimension [0 0 0 0 0 0 0]. The version is difficult to find out, but in funkySetField.C the header says: ICE Revision: \$Id: funkySetFields.C 7567 2007-06-20 12:38:50Z bgschaid \$
May I ask which version of OF you use? That version of OF is ancient history (seems to be the 1.5-version). I think the problem was fixed in the meantime (using >> instead of assignment) in the 1.6 version

Quote:
 Originally Posted by fs82 Thx for your help :-D By the way, what is swak4Foam?

 March 17, 2011, 08:40 #15 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 211 Rep Power: 10 I am using OpenFoam 1.6.x but as far as i know funkySetFields isn't part of the OpenFOAM package and I installed it separatly. But as google -- never heard of it till today, but now its my new bff -- tells me swak4Foam is a newer version of funkySetFields and groovyBC combined, so I will try it out to get rid of this problem :-D kind regards, Fabian

 March 18, 2011, 09:08 #16 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 211 Rep Power: 10 Allright using funkySetFields installed by swak4Foam is the solution. thx, Fabian

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post alcesalces FLOW-3D 5 August 28, 2009 17:04 alcesalces CD-adapco 0 August 24, 2009 13:59 xujjun CFX 9 June 9, 2009 07:59 paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

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