CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Patch-> Cell-> Center - Face: Distance

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 25, 2014, 10:34
Default Patch-> Cell-> Center - Face: Distance
  #1
New Member
 
Martin K
Join Date: Jan 2013
Location: Germany
Posts: 28
Rep Power: 13
Martin_K_lalelu is on a distinguished road
Hi all,

I got stuck with a hopefully simple calculation. With a code sniplet out of this forum (dont remember where I found it) and some research, I try to calculate the distance of a cell center and face center, belonging to a patch cell called faceCelli.

Code:
forAll(myPatch, facei)
              {
              label faceCelli = myPatch.faceCells()[facei];
              wallList.resize(wallList.size()+1);
              wallList[wallList.size()-1]=faceCelli;

              // ...

              faceArea+=mesh.magSf()[faceCelli];
      
              cellMarker[faceCelli]=1.0;
              
              C[faceCelli]=mesh.C()[faceCelli];
              Cf[faceCelli]=mesh.Cf()[facei];     
              
              
              cellFaceDistanceVector[faceCelli] =C[faceCelli] - Cf[facei];  //Cf[faceCelli] wont work either
              cellFaceDistance[faceCelli]= mag(cellFaceDistanceVector[faceCelli]);

The distance between cell center and cell face center becomes way too large.
As I can see in my timeName.C and .Cf, they are both calculated on the correct cell ID. So why wont I get the correct distance?

Best regards
Martin
Martin_K_lalelu is offline   Reply With Quote

Reply


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
snappyhexmesh remove blockmesh geometry philipp1 OpenFOAM Running, Solving & CFD 2 December 12, 2014 10:58
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


All times are GMT -4. The time now is 10:57.