About extracting the normals to faces on a patch
Dear All,
I am studying the flow around an airfoil. The point is that I am interested in saving a file containing the normal vectors to the faces on the patch "airfoil". Do you know how I can get this? Thanks a lot, Samuele |
You could modify writeCellCentres to write Sf() instead of magSf().
|
Dear Hannes,
thanks for writing. Actually, I was thinking to compute cell normals run-time and not as post-processing. I opened the elbow tutorial and I modified the controlDict as follows: Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
lab@labPC:~/OpenFOAM/OpenFOAM-2.2.2/tutorials/incompressible/icoFoam/elbow$ icoFoam Thanks a lot, Samuele |
Hi Samuele,
first of all the compiler does not like your patch name. If you need to have it in the code, you might want to try something like velocityInlet5 instead. Regarding the coded function object this is just a wild guess as I haven't used it: code #{ // get normals const surfaceVectorField& normals = mesh().Sf(); // Write normals.write(); #} possibly: normals.boundaryField().write() Good Luck Hannes |
1 Attachment(s)
Dear Hannes,
thanks a lot. What you suggested works pretty well and I have a file names "S" in the constant/polyMesh dir. That's very nice. Nevertheless, I am not completely satisfied, yet. I would need 2 improvements: 1. computing the normals on a patch only; 2. rescale the normals in order to have magnitude 1; Could you help in doing this? Thanks a lot, Samuele PS: attached a case. If you run blockMesh and icoFoam (it's the cavity case), you can get what I wrote above. |
Progress??
Hi Samuele,
Did you make any progress in this regard? I am dealing with the same issue... Many thanks! Héctor Quote:
|
All times are GMT -4. The time now is 18:50. |