|
[Sponsors] |
January 6, 2015, 10:21 |
Updating face properties for a moving mesh
|
#1 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
Hi All,
I am trying to extract face centres and normal vectors of a set of faces described by a patch. It works fine for a stationary mesh but when I move the code to a dynamic mesh solver and apply rotation to the faces I am interested in the face normal vector does not update but the face centre does. In other words, the second quantity of the following is always the same: Code:
Info << mesh.Cf().boundaryField()[patchi][patchFaceI] << " " << mesh.Sf().boundaryField()[patchi][patchFaceI] << endl; All the best, A |
|
January 6, 2015, 11:10 |
|
#2 |
Senior Member
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20 |
I'm sorry, I was looking at a wrong face. Everything works as it should, it was just me being stupid.
In case someone wonders, here's a piece of code computing the normal of a face (taken from primitiveMeshGeometry.C) I used to find the mistake: Code:
const labelList& f = mesh.faces()[faceI]; const List<point>& p = mesh.points(); label nPoints = f.size(); vector sumN = vector::zero; point fCentre = p[f[0]]; for (label pi = 1; pi < nPoints; pi++) { fCentre += p[f[pi]]; } fCentre /= nPoints; for (label pi = 0; pi < nPoints; pi++) { const point& nextPoint = p[f[(pi + 1) % nPoints]]; vector n = (nextPoint - p[f[pi]])^(fCentre - p[f[pi]]); sumN += n; } Info << 0.5*sumN << endl; // final result for the area vector |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface | Kryo | OpenFOAM Meshing & Mesh Conversion | 13 | February 17, 2022 08:34 |
Question on moving mesh, mesh velocity is really small! | ripperjack | Main CFD Forum | 2 | April 28, 2014 14:37 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
gmsh2ToFoam | sarajags_89 | OpenFOAM | 0 | November 24, 2009 23:50 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |