CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Question about volScalarField boundaryField set. (https://www.cfd-online.com/Forums/openfoam/135340-question-about-volscalarfield-boundaryfield-set.html)

Kelong Wang May 12, 2014 10:49

Question about volScalarField boundaryField set.
 
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

ngj May 12, 2014 12:33

Hallo Kelong,

Welcome to the forum.

If I understand correctly, then your problem is solved by using the zeroGradient boundary condition.

Kind regards,

Niels

Kelong Wang May 12, 2014 13:15

Quote:

Originally Posted by ngj (Post 491301)
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.

Thank you for your reply.

Kelong

ngj May 12, 2014 14:19

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


All times are GMT -4. The time now is 23:41.