Exporting Face Normal of a patch and some other values
Dear all,
I want to do a post processing process of a patch (wall) where I need: - Face center coordinate - Normal to Face vector - Face area - Other data like density 1) I have tried first with a sampling but I cannot find a field "name" to get the face properties. Is it possible to get such a thing ? Here I put a "mesh.Sf()" as example of what I want. Code:
interpolationScheme cellPointFace; Code:
label wallPatch = mesh.boundaryMesh().findPatchID("wall"); |
For the face centers on the patches, try something like
Code:
Edit: the next solution seems much more elegant :) |
Hi Heckmann,
The OpenFoam-formatted output can be achieved in the following way: Code:
IOField<vector> cfOut Kind regards, Niels |
Thank you for yours answer :)
@chegdan Your function does something very similar to mesh.Cf().boundaryField()[wallPatch] but with each component separably. My question is more about how to export those data to a file in a convenient way. I don't really know how OpenFoam manage to write things on the hard drive. @ngj Your solution looks perfect ! I didn't know that we can use such direct coding into the solver. I will try your method this weekend and study the IOField. Thanks guys. (I'm still open to any other method) |
P.S. You could also add an if-statement around the above code, which looks like this
Code:
if ( runTime.write() ) / Niels |
Hi Niels,
Greetings. Can you please enlighten me on how to output the pressure integration along a slice of any patch. I would like to solve the sectional force along a certain structure. Thanks in advance! Kind regards, Albert Quote:
|
Hi All,
I am interested in such a problem. I have a patch called "airfoil" and I would like to write the normals to each face on the patch in a text file. Do you know how I can get this? Thanks a lot, Samuele |
Hi Niels, with regards to the block of code you wrote above , does it have to be in the creatFields header file for the output to be exported for post processing. Or can it still be added in the main function of the solver. I will appreciate your help
|
All times are GMT -4. The time now is 11:31. |