|
[Sponsors] |
Values of a volScalarField at the neighbor cells of a patch |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 6, 2014, 02:57 |
Values of a volScalarField at the neighbor cells of a patch
|
#1 |
New Member
Mhosein
Join Date: Aug 2014
Posts: 1
Rep Power: 0 |
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 |
|
December 6, 2014, 08:49 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21 |
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.
|
|
|
|
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 |
[swak4Foam] About groovyBC to set distributed fixedGradient values for each cell boundary patch | nwpukaka | OpenFOAM Community Contributions | 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 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 04:38 |