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

magSf return twice the area size

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2023, 11:44
Default magSf return twice the area size
  #1
New Member
 
Muhd Jamil Al Hakim
Join Date: Feb 2015
Posts: 5
Rep Power: 11
Jamill1283 is on a distinguished road
Send a message via Yahoo to Jamill1283 Send a message via Skype™ to Jamill1283
Hi Foamers,

I am trying to use and understand magSf() function to calculate the individual surface area of a cell. I am constructed a simple code like this to understand the face area;

Code:
for (label cellI = 0;cellI < mesh.C().size(); cellI++)
  {
    if (cellI == 321)
    {
      for (label faceI = 0; faceI < mesh.Cf()[cellI].size(); faceI++)
        {
           Info << "The surface area for the faces of number " << mesh.Cf()[cellI].size() << " at face " 
                << faceI << " on " << " cell "<< cellI  <<" is: " << mesh.magSf()[faceI] << endl;
         
                
           Info << "Cell connectivity:  " << mesh.cellCells()[cellI] << endl;
                               
         }
     }
  }
However, when I run this code on a simple 2D Lid cavity case, I obtained a surface area that is twice as what I manually calculated. Moreover, the size() function also return only 3 faces for a simple hexahedral mesh, although mesh connectivity calculated return 4 cells surrounding the cells pointed.

For your information, the domain size is 0.1m x 0.1m and is discretized into (20 20 1). Taking one cell, the cell size is 5e-3m x 5e-3m, which means the area is 2.5e-5m2. However, magSf returned 5e-5m2 for the face pointed, which is essentially twice the face area.

Anyway, I tried this for 3D case and the area returned is correct, although the size() function still return 3 faces although mesh connectivity return 6 mesh surrounding cells pointed.

I am really confused with this behavior and hope someone can help me to understand it.


Thanks,
Jamill1283 is offline   Reply With Quote

Reply

Tags
area, openfoam


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
Error in enabling the python wrapper Jinn SU2 Installation 2 April 23, 2022 14:52
solver crashing hrishikeshsivanandan OpenFOAM 7 March 6, 2021 02:18
Warning:no return statement in function returning non-void [-Wreturn-type] 3014214149 OpenFOAM Programming & Development 1 January 19, 2021 12:40
Issues with poor performance in faster CPU gian93 Hardware 9 October 29, 2018 14:34
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 14:55.