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

generating a random location in a cell

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By piu58

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2017, 17:54
Default generating a random location in a cell
  #1
New Member
 
Hesam
Join Date: Jun 2016
Posts: 6
Rep Power: 10
HesamAUT is on a distinguished road
Good day to everyone.
I need to generating a random location in a certain cell.
Is there anyone who can guide me?
Thanks in advance.
HesamAUT is offline   Reply With Quote

Old   April 23, 2017, 07:08
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Take two (x,y) or three (x,y,z) random numbers around the cell center with s spread of slightly more than the "radius" of the cell. Chef if the point is in the inner of the cell. If not take another pair / tripel.
HesamAUT likes this.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 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
How to determine the direction of cell face vectors on processor patches sebastian_vogl OpenFOAM Programming & Development 1 October 11, 2016 14:17
location of each cell hawkeye321 OpenFOAM 6 November 17, 2012 16:15
location of cell hawkeye321 OpenFOAM Running, Solving & CFD 1 October 4, 2012 03:48
ParaView and Qt 4.3.5 on Mac OS X 10.6 Adrian OpenFOAM 3 August 8, 2010 04:16
Ghost cell location for inclined cavity flow zonexo Main CFD Forum 13 September 9, 2005 03:00


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