CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

sample from curved surface

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree8Likes
  • 8 Post By linnemann

Reply
 
LinkBack Thread Tools Display Modes
Old   April 18, 2012, 21:58
Default sample from curved surface
  #1
Member
 
Adam
Join Date: Jun 2011
Posts: 32
Rep Power: 5
Smed is on a distinguished road
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.
Attached Images
File Type: png curvedSurfaceSample.png (70.8 KB, 79 views)
Smed is offline   Reply With Quote

Old   April 19, 2012, 03:19
Default
  #2
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 445
Rep Power: 14
linnemann will become famous soon enough
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
        );
    }
}
The following operations are available.

Code:
         "none",
         "sum",
         "average",
         "weightedAverage",	
         "areaAverage",	
         "areaIntegrate",
         "min",
         "max",
         "CoV",
         "areaNormalAverage",
         "areaNormalIntegrate"
akidess, rflats, fumiya and 5 others like this.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   April 19, 2012, 11:54
Default
  #3
Member
 
Adam
Join Date: Jun 2011
Posts: 32
Rep Power: 5
Smed is on a distinguished road
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?
Smed is offline   Reply With Quote

Old   April 25, 2012, 13:39
Default
  #4
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 185
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
hi, if I want to use the STL from SHM, do I have to give it the relative path?
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 25, 2012, 15:28
Default
  #5
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 445
Rep Power: 14
linnemann will become famous soon enough
my own words in the above post

Quote:
The stl file must reside in the constant/triSurface/ folder.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   April 25, 2012, 15:35
Default
  #6
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 185
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
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
__________________
Mihai Pruna's Bio
mihaipruna is offline   Reply With Quote

Old   April 26, 2012, 14:29
Default
  #7
Senior Member
 
Mihai Pruna
Join Date: Apr 2010
Location: Boston
Posts: 185
Blog Entries: 1
Rep Power: 7
mihaipruna is on a distinguished road
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!
__________________
Mihai Pruna's Bio

Last edited by mihaipruna; April 30, 2012 at 17:00.
mihaipruna is offline   Reply With Quote

Old   March 5, 2013, 02:39
Default
  #8
Member
 
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 74
Blog Entries: 1
Rep Power: 6
tfuwa is on a distinguished road
Hi Foamers,

This may sound silly, but how to generate a stl file for the curved surface in the first place? Thanks.


Quote:
Originally Posted by linnemann View Post
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
        );
    }
}
The following operations are available.

Code:
         "none",
         "sum",
         "average",
         "weightedAverage",    
         "areaAverage",    
         "areaIntegrate",
         "min",
         "max",
         "CoV",
         "areaNormalAverage",
         "areaNormalIntegrate"
__________________
Kind regards,

Albert
tfuwa is offline   Reply With Quote

Old   March 5, 2013, 08:57
Default
  #9
Member
 
Adam
Join Date: Jun 2011
Posts: 32
Rep Power: 5
Smed is on a distinguished road
Quote:
Originally Posted by tfuwa View Post
Hi Foamers,

This may sound silly, but how to generate a stl file for the curved surface in the first place? Thanks.
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.
Smed is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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 09:51
Plotting the velocity profile in normal direction along a curved surface StSchiff OpenFOAM 0 December 1, 2011 06: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 18:18


All times are GMT -4. The time now is 17:35.