CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

boundary cells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2010, 05:36
Default boundary cells
  #1
Member
 
Join Date: Aug 2010
Posts: 31
Rep Power: 16
Martin80 is on a distinguished road
Hi,

I have given a volVectorField U. U contains a boundaryField.

I want to set the values of U at the cellcenter of the cells next to the boundary eqal to the values of U on the boundaryField.

U.internalField()[?]=U.boundaryField()[wall][i]

Illustration:

1 0 | 0 | 0 --> 1 1 | 0 | 0
2 0 | 0 | 0 --> 2 2 | 0 | 0
3 0 | 0 | 0 --> 3 3 | 0 | 0

Maybe someone has a useful hint,
thanks, Martin.
Martin80 is offline   Reply With Quote

Old   September 29, 2010, 08:13
Default
  #2
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
Hi Martin,

you get the adjacent cell of a boundary face by using mesh.owner(). Take care, that owner is not defined for local face numbers inside a patch but for global face numbers.

Example that should do your job:
Code:
forAll(U.boundaryField()[wall], iFaceLocal)
{
    label iFaceGlobal = iFaceLocal + mesh.boundaryMesh()[wall].start();
    label adjacentCell = mesh.owner()[iFaceGlobal];
    U[adjacentCell] = U.boundaryField()[wall][iFace];
}
Regards,
Stefan
herbert is offline   Reply With Quote

Old   September 29, 2010, 10:13
Default
  #3
Member
 
Join Date: Aug 2010
Posts: 31
Rep Power: 16
Martin80 is on a distinguished road
Hi Stefan,

great, this is exactly what I was seeking for. Thanks a lot!
(Just in case someone else also uses it: the last iFace is a iFaceLocal, of course).

Best wishes,
Martin.
Martin80 is offline   Reply With Quote

Old   January 5, 2012, 11:43
Default boundary face owning cell
  #4
Senior Member
 
Join Date: Dec 2009
Posts: 112
Rep Power: 16
heavy_user is on a distinguished road
Hey Foamers,

im am a little stuck here..
I am looping over faces in my boundary patch.
I need to check for a property in the cell belonging to the face.

So I do something like:

Code:
In the loop: 
forAll(boundaryPatchI, faceI)
.....
Info << "###jet- ownercell:"<< mesh_.owner()[faceI] << " ,face: "  << faceI  << " ,current population:" <<  cellOccupancy_[mesh_.owner()[faceI]].size() << endl;
....
The result is e.g.:

Code:
###jet- ownercell:37 ,face: 129 ,current population:5
###jet- ownercell:37 ,face: 130 ,current population:5
###jet- ownercell:37 ,face: 131 ,current population:5
So one cell is the owner for three faces.
The number of faces for the patch is correct (145) but i have way less owners (and dividing 145 by three does not give me an integer anyways).

The manual says:

Code:
In the case of boundaries, the connected cell is the owner and the neighbour is assigned the label ‘-1’. With this in mind, the I/O specification consists of the following files
In the case of faces in my boundary patch I have a hard time imagining three different faces being connected to one cell.
So why do three faces belong to one cell? And how do I adress the 145 cells above my 145 boundary faces?

Thanks a bunch!
heavy_user is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Using snappyHexMesh to fill cells within predefined boundary kev4573 OpenFOAM Meshing & Mesh Conversion 4 May 21, 2010 05:09
CFX doesn't continue calculation... mactech001 CFX 6 November 15, 2009 22:25
Concentric tube heat exchanger (Air-Water) Young CFX 5 October 7, 2008 00:17
dynamic mesh + boundary layer cells Geri FLUENT 0 November 1, 2007 17:27
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


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