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/)
-   -   How to define cells which belongs to ratating patch in MRFSImpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/58499-how-define-cells-belongs-ratating-patch-mrfsimplefoam.html)

bharat May 6, 2008 12:25

hii.. i am working on a 3D c
 
hii..
i am working on a 3D case of francis turbine (rotor+stator+draft tube). i have successfully converted the Mesh from fluent to foam. Now the problem is inside the constant/polymesh i do not have blockMeshDict file, instead of that i have separate files defining cells, faces and points.
How do i define the cells which belongs to the rotating patches ??
In Mixervessel2D case it is defined in the makeMesh file,as i dont have blockMeshDict how can i go ahead ??

regards
bharat

jaswi May 6, 2008 12:35

Hi Bharat The process is ve
 
Hi Bharat

The process is very simple if you have created your mesh in the gambit. Please let me know about your meshing software as we can take onwards from there.

Regards
Jaswinder

bharat May 6, 2008 15:53

hii jaswinder The mesh was
 
hii jaswinder
The mesh was initially created in ICEM and then saved in fluent format i.e. with extension .msh
. after that it's transported in FoamX.

regards
bharat

jaswi May 6, 2008 19:45

Hi Bharat As far as I know
 
Hi Bharat

As far as I know, for the MRF appraoch to work you have to define the rotating and stationary zones and when you mesh such a geometry you have an internal surface which defines this interanl boundary between the zones.

The ICEM does not let you assign the interface between the two region as internal. It does has the BC interface but when you assign it to the internal surface, the conversion gives an error.

I wonder what BC you assigned for the thin surface dividing the two zones while saving the mesh for fluent. Please let me know as we can take on form there.

Regards
Jaswi

kati May 7, 2008 08:20

Hi, For I know, all you nee
 
Hi,

For I know, all you need from the meshing program is a Fluent type cell zone for the rotating part in the .msh file, and also ICEMCFD can create those, if I remember correctly. You might find something about it in ICEMCFD documentation.

When you have a zone for the rotating part in the Fluent mesh, fluent3DMeshToFoam converts it into OF format, and then you can use the Makemesh script to extract also faces of the rotating zone.

Regards,
Kati

bharat May 8, 2008 05:22

Thanx Jaswi & Kati, Yesterd
 
Thanx Jaswi & Kati,
Yesterday I looked in to the ICEM and found that I have to define BC while converting mesh from ICEM to Fluent. Today I will do it and let you know the BC defined for the interface.

Regards
bharat

bharat May 8, 2008 11:49

hi I converted the mesh once
 
hi
I converted the mesh once again in to OpenFoam from ICEM via Fluent after defining the BCīs to the rotating blade. As the rotating blade has 6 surfaces i defined them like this:

a) interface (side 1)of rotating blade and guide vane :- wall
b) interface (side 1) of rotating blade and tripode :- wall
c) rotating blade lower surface :- wall
d) rotating blade upper surface :- wall
e) left side of blade: cyclic
f) right side of blade :- cyclic

As I am using FoamX, so i can change the BC if requires. So tell whether the BC are correct or need change ?

Also, i donīt have blockMeshDict file inside constant/polymesh. There are seperate files defining points, cellzones,faces etc.How to merge them to make a single blockMeshDict ??

Regards
bharat

kati May 8, 2008 15:04

bharat, You are creating th
 
bharat,

You are creating the mesh with Icem, not with blockMesh. You don't need blockMeshDict, which includes instructions for blockMesh to create the mesh files. You already have the necessary mesh files.

I didn't mean that you need interfaces in the Fluent mesh. Internal "boundaries" i.e. internal 2D surfaces that Fluent can use for postprocessing, porous jumps etc. create problems in OpenFoam. What you need is zone of cells. Those are the cells in which MRF models solves flow equations with the rotational acceleration terms. I don't remember how IcemCFD creates them for Fluent. It was something with naming the volumes...

Regards,
Kati

bharat May 9, 2008 07:19

Thanks kati, It means I hav
 
Thanks kati,
It means I have all the required mesh files with me. For defining the cell zones related to rotating blade, I added a file named MRFZones inside the constant folder and there I defined the zones which have cells belonging to rotating zone, like this

1
(
BB
{ patches (BB INT-BO-SIDE-1 INT-BT-SIDE-1 PER-B-SIDE-1 PER-B-SIDE-2 SB-E SB-I VB_DEFAULT);
origin origin [0 1 0 0 0 0 0] (0 0 0);
axis axis [0 0 0 0 0 0 0 ] (0 0 -1);
omega omega [0 0 -1 0 0 0 0] 19.625;
}
)

Tell me will it work now or not?
Also, tell me about makeMesh file. Is it necessary for running the simulation? or I can run the simulation directly without it.

Regards
bharat

jaswi May 9, 2008 08:33

Hi Bharat I am a bit busy t
 
Hi Bharat

I am a bit busy today, Please wait until tomorrow, I will send you all the details and the explanation to the makeMesh file.

Perhaps you know that its just a script file and executes a number of steps to get the cellzones and face zones you need for the successful execution of the MRF solver.

Regards
Jaswinder

PS: It will be nice if you could post a couple of pictures of your geometry as then we can talk refering to it directly. The whole setup is very simple and easy to understand.

kati May 9, 2008 08:36

You'll need to run the makeMes
 
You'll need to run the makeMesh script before it works. Read it and modify accordingly. It runs a few utilities that form face zones based on the cell zone that you already have. You'll need to change of course the case name in the script, and then the rotating zone name in the dictionaries, which you should copy from the MRFSimpleFoam tutorial.

Good luck,
Kati

bharat May 13, 2008 06:32

Thanx jaswi nd kati, Inside
 
Thanx jaswi nd kati,
Inside the polymesh folder, I have 9 files. Among which pointzones and facezones files are empty, rest all ( points , faces, cellzones, neighbour, owner, boundary) have values inside them.
Tell me how to run the makeMesh file to get the cellzones and facezones require for the MRFSimpleFoam ? I am not good with the Linux so tell me the proper commands nedded. I copied the makeMesh file from tutorial to my case and also I changed the case name in it.
I think I am very near to run my case successfully.

Regards
bharat

jaswi May 13, 2008 11:21

Hi Bharat Sorry for the del
 
Hi Bharat

Sorry for the delay. Below given is the description of makeMesh upto my understanding. it might have mistake and I hope forum experts will correct me if its wrong.

Provided you have the correct cellZone corresponding to your rotating domain, your makeMesh shall look like this:

(Note:replace mixerVessel2D with your case name everywhere.)
---------------------------------------------
cellSet .. mixerVessel2D
cp system/faceSetDict_rotorFaces system/faceSetDict
faceSet .. mixerVessel2D
cp system/faceSetDict_noBoundaryFaces system/faceSetDict
faceSet .. mixerVessel2D
setsToZones .. mixerVessel2D -noFlipMap

---------------
Now lets take a quick look what all these commands do. Its all very logical and easy....

1)cellSet .. mixerVessel2D

creates a cell set according to the definition given in the cellSetDict (this file lives in <case>/system). now the cellSetDict given for the mixerVessel2D has the following in it:

-----------------------------------
// Name of set to operate on
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
zoneToCell
{
name rotor; // name of cellZone
}

);
-------------------------
It says that create a cellSet (action new;) called
rotor (name rotor;) from a topological source. The source can be set by calling topoSetSources(). The argument which is passed to the topoSetSources() is the cellZone called rotor (name rotor;) hence the code

zoneToCell
{
name rotor; // name of cellZone
}

At the successfull execution of this step one will get a cellSet called rotor in the directory /polyMesh/sets

2)faceSet .. mixerVessel2D

This creates a face set according to the definition given in the faceSetDict (this file lives in <case>/system). One can clearly observe the analogy with the cellSet command and cellSetDict.

Now the faceSet creation for the rotor is a two step process.

2.1) create a face set corresponding to the cellSet rotor (created in step 1). Thus the faceSetDict for this step should look like this:

+++++++++++++++++++++++++++++++++++++
// Name of set to operate on
name rotor;

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

// Actions to apply to pointSet. These are all the topoSetSource's ending
// in ..ToFace (see the meshTools library).
topoSetSources
(
// Select based on cellSet
cellToFace
{
set rotor;
option all; // All faces of cells
}
);
++++++++++++++++++++++++++++++++++++++++++++++++++
One can see that its structure is similar to cellSetDict i.e. create a face set from a topological source which in this case is a cellSet named rotor. The "option all" implies that the created faceSet has all the faces of the cells in cellSet rotor

2.2) remove the faces corresponding to the boundary faces from the faceSet created in the step 2.1). and the faceSetDict for this step should look like this:
+++++++++++++++++
// Name of set to operate on
name rotor;

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

// Actions to apply to pointSet. These are all the topoSetSource's ending
// in ..ToFace (see the meshTools library).
topoSetSources
(
// Select boundary faces
boundaryToFace
{
}
);
++++++++++++++++++++++++
Now this faceSetDict says that delete the faces corresponding to the boundary, from the existing faceSet rotor and the topological source for this operation is the faceSet created in the previous step.

3)setsToZones .. mixerVessel2D -noFlipMap

the last command create the faceZone from the faceSet created in the step 2.2. what does the switch -noFlipMap does is not clear to me yet but no using it throws up error so use it.


Now if you still wonder what does this statement does :-) :
cp system/faceSetDict_noBoundaryFaces system/faceSetDict

then it should be clear by now.

I encourage you to try the easy step from the console. If at the end you still wonder whether you have the correct faceSet then you can use the following to visualize the set in paraFoam

foamToVTK root case -faceSet rotor

This will create a folder VTK and in there it saves your cellset rotor in VTK format which you can see with paraFOAM

I hope that you will now be able to execute the script and if required modify it to suit your needs.

Regards
Jaswi

P.S: For a detailed list of options for the topoSetSources() look in the sample cellSet, face set, pointSet dictionaries given in the

mesh/manipulation/cellSet
mesh/manipulation/faceSet
mesh/manipulation/poinTSet

bharat May 14, 2008 07:07

hii.. Thanx jaswi, your matt
 
hii..
Thanx jaswi, your matter is a great help for me. I tried with the comands given by you. It worked well till second comand and created the folder constant/sets with the rotating zone file which is having all cells related to rotating zones in it.

But when a applied the third comand i.e.

setsToZones .. Turbine2-noFlipMap ,

it gave me error

FOAM FATAL ERRORS: setsToZones: cannnot open case directory "../Turbine2-noFlipMap"
FOAM exiting

what could be the reason for this error ?? how do i eliminate this.

regards
bharat v

jaswi May 14, 2008 09:12

Hi Bharat You are missing t
 
Hi Bharat

You are missing the space before -noFlipMap

setsToZones .. mixerVessel2D -noFlipMap

Regards
Jaswi

PS: if you please take a look at the error message, its self explanatory :-)

bharat May 14, 2008 10:08

hi jaswi, Thanx again, its
 
hi jaswi,
Thanx again, its working now http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
So,finally my makeMesh file is ready. shall i run it now ??
Now, can I run it by using FoamX ?? or by using console only.

Regards
bharat

dmoroian May 14, 2008 10:16

Hi Bharat, Try to folow visua
 
Hi Bharat,
Try to folow visualy the 9 steps presented in this tutorial: MRFSimpleFoam Tutorial. The tutorial is using Gambit, but it seems to be similar in ICEM, too.
It is always a good idea to start with the simplest case and then go to a more complex one.

Dragos

jaswi May 14, 2008 10:37

Hi Bharat I repeat again:
 
Hi Bharat

I repeat again:

makeMesh is a script which does everything for the mixerVessel2D.

Provided your case has the neccessary
cellSetDict and faceSetDict in the system folder, edit the makeMesh(replace mixerVessel2D with your case name), it will do the job for you.

Now in you case you have done each of the individual steps (listed in makeMesh) from console so there is no need to execute the makeMesh anymore. You can run your case now as usual. Try to be more console oriented as FoamX will not help you in long run and that is just my opinion.

Also go through the tutorial Dragos mentioned in the previous post. it shows how easy it really is to rum such problems if you access to Gambit as fluentMeshToFoam does all the work during conversion and writes the required zones.

wish you a successful run

Jaswi

bharat May 19, 2008 06:36

Thanx a lot Dragos, for your s
 
Thanx a lot Dragos, for your simple tutorial and Jaswi for your all info about makemesh script.
sorry for the late reply. finally i run my simulation but i got lots of error. In last 3-4 days, I removed most of them and now left with one. I suppose this error is very simple but still I am not getting it. Its as follows:

Exec : MRFSimpleFoam ./ Turbine2
Date : May 13 2008
Time : 06:08:31
Host : localhost
PID : 22439
Root : /home/caelinux/
Case : Turbine2
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 kEpsilon


--> FOAM FATAL IO ERROR : wrong token type - expected word found on line 34 the punctuation token ')'

file: /home/caelinux//Turbine2/constant/MRFZones at line 34.

From function operator>>(Istream&, word&)
in file primitives/strings/word/wordIO.C at line 60.

FOAM exiting


and my file written for constant/MRFZones is like this :

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

FoamFile
{
version 2.0;
format ascii;

root "/home/caelinux";
case "Turbine2";
instance "system";
local "";

class dictionary;
object MRFZones;
}

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

8
(
VB
{
patches (BB INT-BO-SIDE-1 INT-BT-SIDE-1 PER-B-SIDE-1 PER-B-SIDE-2 SB-E SB-I VB-DEFAULT);
origin origin [0 1 0 0 0 0 0] (0 0 0);
axis axis [0 0 0 0 0 0 0] (0 0 -1);
omega omega [0 0 -1 0 0 0 0] 19.625;
}
)


please help me out with this problem.


regards
bharat

jaswi May 19, 2008 10:44

Hi Bharat Frankly speaking,
 
Hi Bharat

Frankly speaking, I have no clue why this error is showing up. In my opinion the error message indicates that it is looking for a word instead of the closing bracket ")" in the MRFZones dict.

My guess is that as you have more than 1 patch, it might be looking for another word for rest of the patches. But as I said before I have no idea why that error is there except that it leaves me scratching my head :-(.

Let me know if you find out the solution.

Regards
Jaswi


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