CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Generating sample points

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2017, 07:44
Default Generating sample points
  #1
New Member
 
Ebrahim
Join Date: Mar 2010
Posts: 28
Rep Power: 16
Ebrahim is on a distinguished road
Hello,

I need to generate a number of sample points inside a grid cell. Is there any utility / function in OpenFOAM which can do this for me? Or do you have any experience in this matter?

Thanks,
Ebrahim
Ebrahim is offline   Reply With Quote

Old   April 20, 2017, 10:01
Default Sampling data
  #2
New Member
 
Max
Join Date: Sep 2016
Location: Delft
Posts: 22
Rep Power: 9
WildeCat is on a distinguished road
Dear Ebrahim,

you can easily sample along lines, surfaces or boundaries with the sample utility. sample is executed by running "sample" in terminal. I leave below a link describing how sample works and anotherone to a "sampleDict" file.

http://www.openfoam.com/documentatio...ide/sample.php

https://github.com/OpenFOAM/OpenFOAM...ple/sampleDict

Good luck
WildeCat is offline   Reply With Quote

Old   April 22, 2022, 12:10
Default Generating sample points
  #3
New Member
 
Join Date: Dec 2021
Posts: 7
Rep Power: 4
frubicle93 is on a distinguished road
Hello,

Did you manage to find a good solution to this? I also have a need to randomly (uniformly) sample points within cells to perform a Monte Carlo integration.

The best way I can think of is to find a minimal box that encloses the cell, and sample over the box with an accept/reject policy to get a list of points in the cell.
frubicle93 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sample utility bug? For many cloud points in the sampleDict, some are neglected! brandius OpenFOAM Post-Processing 10 August 22, 2022 09:56
Equidistant points on sample surface? HenningW OpenFOAM Post-Processing 0 August 22, 2016 04:04
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Doxygen documentation Tanay OpenFOAM Installation 9 September 23, 2011 11:40
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


All times are GMT -4. The time now is 09:11.