CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   Extract area per element for a specific sur/face (https://www.cfd-online.com/Forums/su2/140379-extract-area-per-element-specific-sur-face.html)

neetin August 13, 2014 15:04

Extract area per element for a specific sur/face
 
Hi,

For post-processing purpose, I wish to pick a sur/face (based on a specific MARKER_TAG) and write area for each element associated with that sur/face. Where can I find the area calculation and write/dump into a file?

Thank you for your help.

fpalacios August 22, 2014 17:29

Quote:

Originally Posted by neetin (Post 505830)
Hi,

For post-processing purpose, I wish to pick a sur/face (based on a specific MARKER_TAG) and write area for each element associated with that sur/face. Where can I find the area calculation and write/dump into a file?

Thank you for your help.

Hi,
Please find below an example about how to compute the area of a surface element,
Cheers,
Francisco

for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) {
if (config->GetMarker_All_KindBC(iMarker) == case EULER_WALL) {
for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {

Normal = geometry->vertex[val_marker][iVertex]->GetNormal();
Area = 0.0;
for (iDim = 0; iDim < nDim; iDim++) Area += Normal[iDim]*Normal[iDim];
Area = sqrt (Area);

}
}
}


All times are GMT -4. The time now is 01:51.