|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Adam
Join Date: Jun 2011
Posts: 30
Rep Power: 4 ![]() |
Is it possible to sample data from a curved surface? I know that you can sample from a plane by specifying the base point and normal vector, but I want to specify an arc, as shown in the attached drawing.
|
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Niels Nielsen
Join Date: Mar 2009
Location: Denmark
Posts: 394
Rep Power: 10 ![]() |
Hi
Yes it certainly is. Below is some code that shows how to use a stl surface to sample with. Note that the mesh resolution of the stl file will influence how well it interpolates/averages. Also make sure that the stl file is only as large as the mesh as it will produce false data if the stl file expands larger than the mesh domain. I have checked it and it works correctly even with odd shapes. The stl file must reside in the constant/triSurface/ folder. Code:
functions
{
faceObj1
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
outputControl outputTime;
// Output to log&file (true) or to file only
log true;
// Output field values as well
valueOutput true;
// Type of source: patch/faceZone/sampledSurface
source sampledSurface;
// // if patch or faceZone: name of patch or faceZone
// sourceName movingWall;
//// if sampledSurface: dictionary with a sampledSurface
//// Note: will not sample surface fields.
sampledSurfaceDict
{
// Sampling on triSurface
type sampledTriSurfaceMesh;
surface Scale_1.stl;
source cells; // sample cells or boundaryFaces
interpolate false;
}
// Operation: areaAverage/sum/weightedAverage ...
operation areaNormalIntegrate;
fields
(
p
U
);
}
}
Code:
"none",
"sum",
"average",
"weightedAverage",
"areaAverage",
"areaIntegrate",
"min",
"max",
"CoV",
"areaNormalAverage",
"areaNormalIntegrate"
__________________
Linnemann |
|
|
|
|
|
|
|
|
#3 |
|
Member
Adam
Join Date: Jun 2011
Posts: 30
Rep Power: 4 ![]() |
Niels,
Thanks for your response! Can this code be executed as a post process (like sampleDict) or does it need to be placed in controlDict before the case is run? |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 159
Rep Power: 5 ![]() |
hi, if I want to use the STL from SHM, do I have to give it the relative path?
|
|
|
|
|
|
|
|
|
#5 | |
|
Senior Member
Niels Nielsen
Join Date: Mar 2009
Location: Denmark
Posts: 394
Rep Power: 10 ![]() |
my own words in the above post
Quote:
__________________
Linnemann |
||
|
|
|
||
|
|
|
#6 |
|
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 159
Rep Power: 5 ![]() |
sorry I should have read more carefully.
that's where I had the STL. The mistake I made must lie elsewhere in my sampledict file. So I'm going to use the example you provided
|
|
|
|
|
|
|
|
|
#7 |
|
Senior Member
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 159
Rep Power: 5 ![]() |
linneman. can you please post your entire sampleDict?
I don't get any output. It just says Time 0, 100 etc. nm seems to work now! Last edited by mihaipruna; April 30, 2012 at 17:00. |
|
|
|
|
|
|
|
|
#8 | |
|
Member
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 56
Blog Entries: 1
Rep Power: 4 ![]() |
Hi Foamers,
This may sound silly, but how to generate a stl file for the curved surface in the first place? Thanks. Quote:
__________________
Kind regards, Albert |
||
|
|
|
||
|
|
|
#9 |
|
Member
Adam
Join Date: Jun 2011
Posts: 30
Rep Power: 4 ![]() |
Pretty much any method that can be used to create a mesh can also create an stl file. I created the desired sampling surface with blockMesh (curved it using the edges keyword), then converted it to an stl using foamToSurface. You could also use a program like gmsh or any of the commercial options.
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [ICEM] surface mesh merging problem | everest | ANSYS Meshing & Geometry | 39 | June 5, 2013 19:02 |
| Layers in a curved surface | Artex85 | Open Source Meshers: Gmsh, Netgen, CGNS, ... | 1 | December 18, 2011 08:51 |
| Plotting the velocity profile in normal direction along a curved surface | StSchiff | OpenFOAM | 0 | December 1, 2011 05:01 |
| sample: free surface & more | Phicau | OpenFOAM Post-Processing | 2 | October 11, 2011 10:19 |
| Calculating forces on a non-closed surface | ScottN | FLUENT | 0 | March 1, 2011 17:18 |