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/)
-   -   CellZons and MRFSimpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/58821-cellzons-mrfsimplefoam.html)

vinz June 5, 2008 02:48

Hi everybody, I would like
 
Hi everybody,

I would like to run a rotating propeller using MRFSimpleFoam.

It looks like I need to create a cellZone file in polymesh directory. The problem is I don't know how to do that.

I created my mesh using GridPro, but gridpro2FOAM does not incorporate a feature to create this file. Do I have to modify the converter and create this feature or is there a tool in OpenFOAM to create this file from the common files (points,faces,owner, neighbour..)?

Thanks in advance for any help.

Vincent

dmoroian June 5, 2008 03:09

Hi Vincent, Check the cellSet
 
Hi Vincent,
Check the cellSet and setsToZones utilities.
With cellSet you can define a set of cells that rotate, and then convert this set into a zone with setsToZones.

I hope this is helpful,
Dragos

vinz June 5, 2008 04:23

Hi Dragos, And thank you fo
 
Hi Dragos,

And thank you for your quick answer.
I saw the cellSet utility is using a cellSetDict in which different things have to be entered:
- name: should it be one of the patch which is in boundary file
- action: is "new" the right choice to create the cellZone file I want.
- topoSetSources: I have no idea what to put there.

Is there an explanation of this tool somewhere? I didn't find anything interesting in the user guide.
Thanks again for your help.

Vincent

dmoroian June 5, 2008 04:35

Hello Vincent, Few explanator
 
Hello Vincent,
Few explanatory remarks:
- name is the name of the rotating cell set. If you want, it can be the same as the rotating patch, but is not mandatory.
- action new, indeed, you create a new set of cells.
- topoSetSources, here you choose a method of selecting the cells. Probably boxToCell is the one you want, in which the set is defined by the cells contained in a rectangular box.

I hope this is helpful,
Dragos

vinz June 5, 2008 05:36

Hello again, You helped me
 
Hello again,

You helped me a lot! Your advices were very usefull.
I managed to get a cellSetdict working.
Here it is:

name rotor;

// One of clear/new/invert/add/delete|subset/list
action new;

// Actions to apply to cellSet. These are all the topoSetSource's ending
// in ..ToCell (see the meshTools library).

topoSetSources
(
// Cells in cell zone
boxToCell
{
box (-1.2 -0.6 -1.2) (1.2 2.3 1.2); // name of cellZone
}

);

I still have some doubts about what I should put into topoSetSources. boxToCell is selecting all the cell in a certain rectangular right? But, I just want certain surfaces to rotate, so is it the right thing to do here?


Then I tried to run the case. It was saying that cellZone rotor was not resent in polymesh directory. So I just copied the file from the tutorial case and replaced the values of the cell inside by the values I had in the "rotor" file in sets directory. Hope this is what I should do. Is there a best way to obtain the file?

And finally, I run my case but I get the followinf error for which I have no idea how to solve it:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : MRFSimpleFoam . rotatingPropeller
Date : Jun 05 2008
Time : 10:48:46
Host : bigbrain.rtech.fr
PID : 26139
Root : /home/vincent/OpenFOAM/vincent-1.4.1/run/tutorials/MRFSimpleFoam
Case : rotatingPropeller
Nprocs : 1
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model laminar

Starting time loop

Time = 1

*** glibc detected *** MRFSimpleFoam: malloc(): memory corruption: 0x0000000002c78310 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3a12472fec]
/lib64/libc.so.6(__libc_malloc+0x7a)[0x3a124748fa]
/home/vincent/OpenFOAM/linux64/gcc-4.2.1/lib64/libstdc++.so.6(_Znwm+0x1d)[0x2aaa ac4be16d]
/home/vincent/OpenFOAM/linux64/gcc-4.2.1/lib64/libstdc++.so.6(_Znam+0x9)[0x2aaaa c4be289]
MRFSimpleFoam[0x4327e4]
MRFSimpleFoam[0x414b67]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3a1241e074]
MRFSimpleFoam(_ZN4Foam11regIOobject14readIfModifie dEv+0x201)[0x412ff9]
======= Memory map: ========
00400000-00459000 r-xp 00000000 fd:00 45793285 /home/vincent/OpenFOAM/vincent-1.4.1/applications/bin/linux64GccDPOpt/MRFSimpleF oam
00659000-0065b000 rw-p 00059000 fd:00 45793285 /home/vincent/OpenFOAM/vincent-1.4.1/applications/bin/linux64GccDPOpt/MRFSimpleF oam
0065b000-04b80000 rw-p 0065b000 00:00 0 [heap]
3a12000000-3a1201b000 r-xp 00000000 fd:00 41107457 /lib64/ld-2.7.so
3a1221a000-3a1221b000 r--p 0001a000 fd:00 41107457 /lib64/ld-2.7.so
3a1221b000-3a1221c000 rw-p 0001b000 fd:00 41107457 /lib64/ld-2.7.so
3a12400000-3a1254d000 r-xp 00000000 fd:00 41107458 /lib64/libc-2.7.so
3a1254d000-3a1274d000 ---p 0014d000 fd:00 41107458 /lib64/libc-2.7.so
3a1274d000-3a12751000 r--p 0014d000 fd:00 41107458 /lib64/libc-2.7.so
3a12751000-3a12752000 rw-p 00151000 fd:00 41107458 /lib64/libc-2.7.so
3a12752000-3a12757000 rw-p 3a12752000 00:00 0
3a12800000-3a12802000 r-xp 00000000 fd:00 41107465 /lib64/libdl-2.7.so
3a12802000-3a12a02000 ---p 00002000 fd:00 41107465 /lib64/libdl-2.7.so
3a12a02000-3a12a03000 r--p 00002000 fd:00 41107465 /lib64/libdl-2.7.so
3a12a03000-3a12a04000 rw-p 00003000 fd:00 41107465 /lib64/libdl-2.7.so
3a12c00000-3a12c82000 r-xp 00000000 fd:00 41107464 /lib64/libm-2.7.so
3a12c82000-3a12e81000 ---p 00082000 fd:00 41107464 /lib64/libm-2.7.so
3a12e81000-3a12e82000 r--p 00081000 fd:00 41107464 /lib64/libm-2.7.so
3a12e82000-3a12e83000 rw-p 00082000 fd:00 41107464 /lib64/libm-2.7.so
3a13000000-3a13016000 r-xp 00000000 fd:00 41107461 /lib64/libpthread-2.7.so
3a13016000-3a13215000 ---p 00016000 fd:00 41107461 /lib64/libpthread-2.7.so
3a13215000-3a13216000 r--p 00015000 fd:00 41107461 /lib64/libpthread-2.7.so
3a13216000-3a13217000 rw-p 00016000 fd:00 41107461 /lib64/libpthread-2.7.so
3a13217000-3a1321b000 rw-p 3a13217000 00:00 0
3a1ba00000-3a1ba15000 r-xp 00000000 fd:00 41107479 /lib64/libnsl-2.7.so
3a1ba15000-3a1bc14000 ---p 00015000 fd:00 41107479 /lib64/libnsl-2.7.so
3a1bc14000-3a1bc15000 r--p 00014000 fd:00 41107479 /lib64/libnsl-2.7.so
3a1bc15000-3a1bc16000 rw-p 00015000 fd:00 41107479 /lib64/libnsl-2.7.so
....


Do you have some idea on this problem?
Thanks again,


Vincent

jaswi June 5, 2008 05:55

Hi Vincent Please take a l
 
Hi Vincent

Please take a look in the:

/home/openfoam/OpenFOAM/OpenFOAM-1.4.1/applications/utilities/mesh/manipulation/ cellSet

You will find a file cellSetDict. This file shows
all the possible topSetSources one could use to define a cellSet. It also shows how a particular option can be put to use.

Hope that it will of some use...

Regards
Jaswi

vinz June 5, 2008 06:02

Hi Jaswinder, Thanks for yo
 
Hi Jaswinder,

Thanks for your help, but I actually already saw this dict. Maybe, it's coming from me but I don't find it very clear.

I keep looking at it but I don't see which option would be the best for my case.

And the error I posted above is very strange. Actually I don't know if it comes from the definition of the rotating parts or the boundary conditions which I chose like this:

p:
dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
blade1
{
type zeroGradient;
}
blade2
{
type zeroGradient;
}
blade3
{
type zeroGradient;
}
tube
{
type zeroGradient;
}
external
{
type symmetryPlane;
}

outlet
{
type fixedValue;
value uniform 0;
}

inlet
{
type zeroGradient;
}
}

U:
dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
blade1
{
type fixedValue;
value uniform (0 0 0);
}
blade2
{
type fixedValue;
value uniform (0 0 0);
}
blade3
{
type fixedValue;
value uniform (0 0 0);
}
tube
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type zeroGradient;
}

inlet
{
type inletOutlet;
inletValue uniform (0 10 0);
value uniform (0 10 0);
}

external
{
type symmetryPlane;
}
}

Regards,

Vincent

jaswi June 5, 2008 06:12

Hi Vincent I can't say muc
 
Hi Vincent

I can't say much from the backtrace given in the last post.

If you have no copyright related issues then send over the testCase and I can take a look.

mail it to me.

Regards
Jaswi

dmoroian June 5, 2008 07:07

Hello Vincent, Did you run se
 
Hello Vincent,
Did you run setsToZones after you obtained your sets?
MRFSimpleFoam needs a zone to be defined, not a set!

Quote:

I still have some doubts about what I should put into topoSetSources. boxToCell is selecting all the cell in a certain rectangular right? But, I just want certain surfaces to rotate, so is it the right thing to do here?
Yes you did right. Later you will specify inside the MRFZones dictionary which wall/patch is rotating inside the defined zone.

Dragos

dmoroian June 5, 2008 07:11

Oh, now I see what you did. It
 
Oh, now I see what you did. It is wrong to just copy the cellZones file from the tutorial directory!!! You have to get it right from the sets, using setsToZones

Dragos

vinz June 5, 2008 07:17

Actually yes I ran setsToZones
 
Actually yes I ran setsToZones since I ran the makeMesh script and it is inside with the option -noflipmap (I don't know what it is but I just kept it as it was).
This is the output of setsToZones:
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : setsToZones . rotatingPropeller -noFlipMap
Date : Jun 05 2008
Time : 12:40:18
Host : bigbrain.rtech.fr
PID : 26186
Root : /home/vincent/OpenFOAM/vincent-1.4.1/run/tutorials/MRFSimpleFoam
Case : rotatingPropeller
Nprocs : 1
Create time

Create polyMesh for time = 0

Seached : "constant/polyMesh/sets"
Found :
2
(
rotor
rotor_old
)


pointSets:
0
(
)

cellSets:
0
(
)

faceSets:
1
(
rotor
)

Writing mesh.

End

Thanks you dragos for the explanation about MRFzones, I now better understand how it works.

Regards,


Vincent

vinz June 5, 2008 07:22

Ok Dragos, So I deleted ev
 
Ok Dragos,

So I deleted everything and I get back to the start.
I just used the right cellSetDict and ran makeMesh.
Everything is going fine.

But, when I want to run the case I get this:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : MRFSimpleFoam . rotatingPropeller
Date : Jun 05 2008
Time : 12:43:20
Host : bigbrain.rtech.fr
PID : 26194
Root : /home/vincent/OpenFOAM/vincent-1.4.1/run/tutorials/MRFSimpleFoam
Case : rotatingPropeller
Nprocs : 1
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model laminar


--> FOAM FATAL ERROR : cannot find MRF cellZone rotor

From function Foam::MRFZone::MRFZone(const fvMesh& , const dictionary&)
in file cfdTools/general/MRF/MRFZone.C at line 59.

FOAM exiting


This is the reason why earlier I copied the tutorial cellZone and changed it. But it looks like a wrong solution. What should I do from here?

dmoroian June 5, 2008 07:42

Do you have in the constant/po
 
Do you have in the constant/polyMesh/cellZones file an entry like this?
rotor
{
<blockquote>type cellZone;
cellLabels List<label>
....
</blockquote>


If you don't, then you did not produce the right zone.
Why do you use makeMesh utility? In your case, I think all you need is to run first cellSet and second setsToZones.

Dragos

vinz June 5, 2008 07:58

Thank you, I finally did it
 
Thank you,

I finally did it!
Here is what I finally did:

1)cellset . rotatingPropeller
2)setsToZones . rotatingPropeller
3)faceSet . rotatingPropeller
4)setsTozones . rotatingPropeller

And now it is running.
Really, thank you both of you for your facts answers. I'll try to post some pictures of the results.

Vincent

aganesan June 12, 2008 06:17

Hello, Actually I am trying
 
Hello,
Actually I am trying to run a Fluent Generated Mesh case using MRFSimpleFoam (my application is impeller in a tank with baffles very similar to mixerVessel2D but the outer cylinder's dimension is bigger than the inner one). But when I try to compile it, I am getting the following errors (very similar to the one that has been reported in this discussion forum):
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4.1 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : MRFSimpleFoam ./ impeller
Date : Jun 12 2008
Time : 15:43:01
Host : linux-02
PID : 18936
Root : /home/ang/OpenFOAM/ang-1.4.1/run/tutorials/MRFSimpleFoam/
Case : impeller
Nprocs : 1
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model laminar


--> FOAM FATAL ERROR : cannot find MRF patch rotor

From function Foam::MRFZone::MRFZone(const fvMesh& , const dictionary&)
in file cfdTools/general/MRF/MRFZone.C at line 86.

FOAM exiting

Actually I tried doing cellSet (successful) and setstoZones (unsuccessful, it basically complains of the some missing file called wallcells...).
It would be great if I can get help to run this case successfully.
Thanks.

Anand

ronaldo October 21, 2009 04:21

Help please!
 
1 Attachment(s)
Quote:

Originally Posted by dmoroian (Post 191825)
Hello Vincent,
Few explanatory remarks:
- name is the name of the rotating cell set. If you want, it can be the same as the rotating patch, but is not mandatory.
- action new, indeed, you create a new set of cells.
- topoSetSources, here you choose a method of selecting the cells. Probably boxToCell is the one you want, in which the set is defined by the cells contained in a rectangular box.

I hope this is helpful,
Dragos


Hi Dragos,

please use the attach picture "geometry" to explain me in more detail how to set the cellSetDict file before runing cellSet! Make please an example relevant to this case (picture)!

Thank you in advance!
(very important )

hm86 July 20, 2010 18:18

Rotor Question
 
This is just a general question about modelling rotors in openfoam. If I wanted to do just one blade and use periodic BCs, should I use the cyclic BC or the symmetryplane BC?

Thanks!

madad2005 July 21, 2010 04:53

Cyclic BC on the two "periodic" face zones.

sivakumar July 30, 2012 08:11

howToGet cellZone
 
Hi guys,
I have a problem, i am trying to run fan using MRFSimpleFoam, I have tried the same case in simpleFoam, it was running. then I have copied the same files to MRFSimpleFoam. now my question is what are the files, I need to have to run MRFSimpleFoam and how can I get it.
Please explain me some steps,


thanks and regards,
Siva

GKARIMI December 1, 2016 15:18

FOAM Error: cann't find MRF cellZone rotatingZone
 
Hi All,

I'm dealing with the same problem in version 4.0. I use snappyHexMesh and as I see I repeated all steps that training manual (CFD Direct Training Manual, Applied CFD, C.J.Greenshields, Chicago 2016) says, still there is an error says ", Could anyone help me? Thank you in advance! :(


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