CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing Format & General Technical (http://www.cfd-online.com/Forums/openfoam-meshing-technical/)
-   -   How to identify cell neighbours (http://www.cfd-online.com/Forums/openfoam-meshing-technical/61906-how-identify-cell-neighbours.html)

booz February 14, 2009 11:31

Hello, i am new in openFoam
 
Hello,

i am new in openFoam and i donŽt know how to identify and output the neighbours of a cell[i]!

Is it possible in openFaom?

I hope someone can help me!

Thanks and kind regards
Khaled

su_junwei February 14, 2009 14:52

Hi Khaled mesh.cellCell
 
Hi Khaled

mesh.cellCells()[cellI] gives the neighbours of cell cellI

su junwei

booz February 15, 2009 05:58

Hi su junwei, thanks very m
 
Hi su junwei,

thanks very much.

And with "Info<< mesh.cellCells()[celli]<< endl;" I put out the neighbours of celli?

Regards,
Khaled

su_junwei February 15, 2009 06:16

Yes, Khaled, you can print the
 
Yes, Khaled, you can print them out. This is a list of cell index in the neighbourhood.
Junwei

booz February 15, 2009 06:30

Thanks Su. IŽll try it now.
 
Thanks Su. IŽll try it now.

Btw. do you know how to integrate over a special patch or is it possible with openfoam?

Thanks and regards
khaled

su_junwei February 15, 2009 06:41

Hi Khaled patchIntegra
 
Hi Khaled

patchIntegrate can be used to integrate over a special patch, you can use it like this

patchIntegrate fieldname patchname.

This is a postprocessing utility.

Junwei

booz February 15, 2009 07:07

Hi Su Junwei, oh ok, thanks
 
Hi Su Junwei,

oh ok, thanks.

But mybe i hope you ask my last question here.

Exactly i want to integrate over the patch "outlet" of the pressure field "p". So then i only write

patchIntegrate p [1]

if the patchname is [1]?

Thanks,
Khaled

su_junwei February 15, 2009 14:19

Hi khaled yes. That's Ok.
 
Hi khaled
yes. That's Ok. Just test it.
Junwei

Ritu Marpu June 2, 2010 11:24

number of cell neighbours
 
Hi Su,

Thanks for the hint, it was very helpful. I was wondering if there is a command to find the number of cell neighbours for a cell.

mesh.cellCells()[cellI] gives <no. of neighbouring cells>(<neighbours>)

If I want just the <no. of neighbouring cells> alone, how do I get it ?

Thanks.

su_junwei June 6, 2010 02:04

Hi Ritu

Just using the size function like this
label neighbourCount=mesh.cellCells()[cellI].size()

sorry for late response
Junwei

Pascal_doran November 16, 2010 17:31

closest cell from point
 
Hi Su Junwei and Khaled,

Does anyone know how to select the closest cell near the point (x,y,z)?

Thank you,

Pascal

su_junwei November 17, 2010 01:16

Hi Pascal
you can use the following code

meshSearch ms(mesh);
label nearestCellIndex = ms.findNearestCell(p);

p is your point for searching nearest cell. nearestCellIndex is the cell index that you want.
Don't forget to include "meshSearch.H"

Junwei

kathrin_kissling November 17, 2010 02:58

Hi Pascal,

alternatively you can use

label labelOfClosestCell mesh.findCell(c y z);


Best Kathrin

arkangel December 9, 2010 10:38

Hi

I was looking in the forum and I hope you might help me?

I want to identify cells whose face(s) are in a patch and give them a value

what would it the the best way ?

Thanks


O. R.

yashar.afarin December 9, 2010 17:33

post processing
 
Hi everybody,

I am trying to model a free turbulent jet with LES. In part of my project I have to determine value of some variables along a specific line inside my domain to compare my results with my refrences results but I dont know how I can do that?
I would appreciate any help.

best regards,
Yashar

su_junwei December 10, 2010 09:42

Quote:

Originally Posted by yashar.afarin (Post 286783)
Hi everybody,

I am trying to model a free turbulent jet with LES. In part of my project I have to determine value of some variables along a specific line inside my domain to compare my results with my refrences results but I dont know how I can do that?
I would appreciate any help.

best regards,
Yashar

Just use sample tool in OpenFOAM. see Openfoam's user's guide

su_junwei December 10, 2010 09:45

Quote:

Originally Posted by arkangel (Post 286705)
Hi

I was looking in the forum and I hope you might help me?

I want to identify cells whose face(s) are in a patch and give them a value

what would it the the best way ?

Thanks


O. R.


Just use faceCells in polyPatch class.

faceCells give you the index of a cell who owns the current patch face.

Regards, Junwei

yashar.afarin December 10, 2010 13:14

Quote:

Originally Posted by su_junwei (Post 286898)
Just use sample tool in OpenFOAM. see Openfoam's user's guide

Hi Su,

thank you very much for your response.
indeed, I want to compute my jet width along the jet centreline. for that reason, I have to determine the centreline velocity(u(x,0,0)) that is function of x-axis then compute distance from jet centreline in y-direction where the x component of velocity become half of the centreline velocity.
is there any utility that can do that for me or I have to write a code?

su_junwei December 11, 2010 04:50

Quote:

Originally Posted by yashar.afarin (Post 286939)
Hi Su,

thank you very much for your response.
indeed, I want to compute my jet width along the jet centreline. for that reason, I have to determine the centreline velocity(u(x,0,0)) that is function of x-axis then compute distance from jet centreline in y-direction where the x component of velocity become half of the centreline velocity.
is there any utility that can do that for me or I have to write a code?

A possible way can be described as follows:
1) Cut several planes along centreline transversely.
2) select points on these planes. These points are not necessary on the cell center.
3) interpolate values to the selected points
4) find the point who has maximum velocity on each plane, and this point is on the cenerline
5) loop all the planes. In each planes, fix Y, and change z from min to maximum, and find the two points who has the most approaching value to half the maximum velocity. Distance between these two points is the jet width on this line. In 3D the wide should be different for different Y.

The points you selected shoud cover your jets. The algorithm is an approximated method.

If you have problem in implementation, please let me know.

Regards, Junwei

yashar.afarin December 11, 2010 10:40

Quote:

Originally Posted by su_junwei (Post 286995)
A possible way can be described as follows:
1) Cut several planes along centreline transversely.
2) select points on these planes. These points are not necessary on the cell center.
3) interpolate values to the selected points
4) find the point who has maximum velocity on each plane, and this point is on the cenerline
5) loop all the planes. In each planes, fix Y, and change z from min to maximum, and find the two points who has the most approaching value to half the maximum velocity. Distance between these two points is the jet width on this line. In 3D the wide should be different for different Y.

Hi Su

I really appreciate all the help you gave me.
basically, I think that it would better for me to export my result to a .dat file and write a separate(from OF) code to digest in my data but I would appreciate if you could answer my question:
how I could export my data so that I could specify and link for each point(cell centre) , the position(x,y,z) and velocity(u,v,w) variables of that point as a same file?


Best regards,
Yashar


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