CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Set nonuniform boundary values (http://www.cfd-online.com/Forums/openfoam-solving/58268-set-nonuniform-boundary-values.html)

nikwin November 25, 2008 09:53

Hello, I would like to set
 
Hello,

I would like to set nonuniform boundary values for the pressurefield pP from a known pressureField p, which I have done as follows for the inlet boundary, (p's boundaryType is zeroGradient at the inlet)

label inletPatchID=mesh.boundaryMesh().findPatchID("inle t");
pP.boundaryField()[inletPatchID].replace(inletPatchID,p.boundaryField()[inletPat chID]);

By looking at the results for pP it seems like its boundaryField at the inlet is set from the internalField of the cells closest to the boundary of p and not from the faces of these cells, which should be the true boundary. Or is the value at the internalField actually equal to the value at the boundary due to the zeroGradient BC?

Could someone please give me a hint if the implementation is correct for setting the boundary values? If not, is there a better and more correct way to implement a known nonuniform boundary?

All the best
/NW

henrik November 30, 2008 08:12

Yes, zeroGradient will make th
 
Yes, zeroGradient will make the face value equal to the cell value.

Not sure the above is correct because it might set the value and not the boundary condition. I would recommend

pP.boundaryField()[inletPatchID] == p.boundaryField()[inletPatchID]);

Note the "==" and read this thread

http://www.cfd-online.com/OpenFOAM_D...ges/1/202.html

Henrik


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