|
[Sponsors] |
July 22, 2014, 12:23 |
Surface Sampling
|
#1 |
Member
Join Date: Jul 2012
Location: Wisconsin,USA
Posts: 34
Rep Power: 14 |
Dear Foamers,
I have an engine case where I need to extract velocities on different cut planes. To do that I am using sample utility in OpenFoam with a format raw (which gives the coordinates and the velocity components). Later I am plotting the 2D velocity vectors in Matlab. But since the mesh is not an evenly spaced grid , I am having some issues in creating the contours and vectors. My question is there a way I could get the velocities on a regular grid (like remapping the sampled velocity on an evenly spaced grid)? Or a surface write format which writes the sampled data at regular intervals given a dx , a dy and start and end points? I am aware that line sampling can do that, but I need surface sampling in this case. Thanks for your time. |
|
August 6, 2014, 14:12 |
|
#2 |
Member
Join Date: Jul 2012
Location: Wisconsin,USA
Posts: 34
Rep Power: 14 |
Well I had to provide a cloud of points using set sampling to get what I wanted.It works but creating a cloud is not fun, especially if the domain is big and we want to sample at many points.
Thanks ! |
|
August 6, 2014, 14:22 |
|
#3 |
Member
Join Date: Jul 2012
Location: Wisconsin,USA
Posts: 34
Rep Power: 14 |
Another question is that when we provide the coordinates of several points to sample, and say a point A(0.5,0.5,0.5) lies outside our solution domain , then the sample utility does not output any value at that point (I am using "raw" write format).
All I want is that OpenFOAM outputs "NaN" values at all those points which lie outside the domain. Does anyone have an idea about how to accomplish this? Thanks in advance ! |
|
October 26, 2020, 14:18 |
|
#4 | |
Senior Member
Join Date: Jul 2019
Posts: 148
Rep Power: 7 |
Quote:
|
||
September 21, 2021, 08:16 |
Sample on array of points
|
#5 |
Member
Tom Lauriks
Join Date: Apr 2020
Posts: 34
Rep Power: 6 |
I also needed to sample on set of points on a surface and found a solution.
It's possible to sample on a surface drawn in a CAD program (I use blender), which is exported as stl. If you draw the points where you need to sample and connect them as a surface, it is possible to sample on these points. You can then add to your controlDict (openfoam.com v2012): Code:
planesVelocity { type surfaces; libs ("libfieldFunctionObjects.so"); enabled true; writeControl runTime;//Writes data every writeInterval seconds of simulated time. writeInterval 0.001; interpolationScheme cellPoint; surfaceFormat raw; surfaces ( y0 { type sampledTriSurfaceMesh; surface y0.stl; interpolate true; source insideCells; } ); fields ( U turbulenceProperties:R ); } source=insideCells, interpolate=true Per surface point interpolate cell containing it. https://cpp.openfoam.org/v4/classFoa...rfaceMesh.html . The stl file is located in constant/triSurface I didn't check thoroughly, but values outside the domain seem missing. I will write a script (Python) to add the missing coordinates and set them to NaN. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 12:05 |
Problems with surface sampling | mcarpe | OpenFOAM Post-Processing | 11 | November 9, 2012 12:00 |
[snappyHexMesh] Add additional boundary layers to complex stl surface | tobijingles | OpenFOAM Meshing & Mesh Conversion | 1 | October 26, 2011 11:45 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 13:43 |
free convection heat transfer from a heated horizontal surface through a liquid to a thin cooled fin | Kaushik | FLUENT | 1 | May 8, 2000 07:47 |