CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > 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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 6, 2014, 03:57
Default Values of a volScalarField at the neighbor cells of a patch
  #1
New Member
 
Mhosein
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:

1.
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;
}

2.
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
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
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

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 16:49
[swak4Foam] About groovyBC to set distributed fixedGradient values for each cell boundary patch nwpukaka OpenFOAM Community Contributions 6 August 12, 2014 07:34
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 03:01
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 10:34
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38


All times are GMT -4. The time now is 18:19.