CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Values of a volScalarField at the neighbor cells of a patch

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

LinkBack Thread Tools Display Modes
Old   December 6, 2014, 03:57
Default Values of a volScalarField at the neighbor cells of a patch
New Member
Join Date: Aug 2014
Posts: 1
Rep Power: 0
MHosein is on a distinguished road
Dear Foamers

As I'm new to openfoam, I've became so confused to find values of neighbor cells of a patch for a volScalarField.

These two ways I thought can be useful give me wrong values:

My volScalarField is CH and patch name is interface:

const label patchInterface=mesh.boundaryMesh().findPatchID("In terface");
fvPatchScalarField& CHface=CH.boundaryField()[patchInterface];
const labelList cl=CHface.patch().faceCells();
forAll(CHface, facei)
Info << CH[cl[facei]] <<endl;

scalarField CHF=CH.boundaryField()[patchInterface].patchInternalField();
forAll(CHface, facei)
Info << CHF[facei] <<endl;

These two codes give me correct value for 2 or 3 first iterations but after that they start to grow in a wrong way and diverging after about 10 iterations.

Would you be kind enough to suggest me a new solution?
Thanks in advance
MHosein is offline   Reply With Quote

Old   December 6, 2014, 09:49
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 421
Rep Power: 12
jherb is on a distinguished road
The first version our the values on the face cells whereas the second version should give you the values of the cell centers for the cells next to the face.
jherb is offline   Reply With Quote


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting patch field values equal to internal field values leroyv OpenFOAM Programming & Development 1 October 21, 2014 15:49
About groovyBC to set distributed fixedGradient values for each cell boundary patch nwpukaka OpenFOAM 6 August 12, 2014 06:34
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 02:01
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38

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