# Question about volScalarField boundaryField set.

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

 May 12, 2014, 10:49 Question about volScalarField boundaryField set. #1 New Member   Join Date: Apr 2014 Posts: 3 Rep Power: 12 Dear FOAMers: I have a question about boundaryField set of a volScalarField object. I have the value of each cell center. So I can set the internalFiled with my existing value. But for the boundaryField, I want to set each boundaryField face center's value equals to cell center's value, which the boundary face belongs to. How could I find the cell ID that a particular boundary face belongs to? I hope the question is described clearly. Thank you! Kelong

 May 12, 2014, 12:33 #2 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Copenhagen, Denmark Posts: 1,901 Rep Power: 37 Hallo Kelong, Welcome to the forum. If I understand correctly, then your problem is solved by using the zeroGradient boundary condition. Kind regards, Niels __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

May 12, 2014, 13:15
#3
New Member

Join Date: Apr 2014
Posts: 3
Rep Power: 12
Quote:
 Originally Posted by ngj Hallo Kelong, Welcome to the forum. If I understand correctly, then your problem is solved by using the zeroGradient boundary condition. Kind regards, Niels
Dear Niels,

Sorry. My question is how to set the boundaryField value of each boundary face with the existing cell centers value. As you know, every boundary face belongs to a cell, I want to set the boundary face value's equals to the cell center's value. So for a boundary face, I need some code to find which cell the boundary face belongs to. And then read the cell center's value and set the boundary face's value.

Kelong

 May 12, 2014, 14:19 #4 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Copenhagen, Denmark Posts: 1,901 Rep Power: 37 Well, you are still describing a Neumann boundary condition. This is exactly what the Code: type zeroGradient; boundary condition does for you. Kind regards, Niels __________________ Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

 Tags boudary field, volscalarfield