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

How to generate a random number between 0 and 1 in openFOAM?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By s1291

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2023, 04:31
Default How to generate a random number between 0 and 1 in openFOAM?
  #1
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8
farzadmech is on a distinguished road
Hello everyone
I am using OF21 and I do not know how to generate a random number between 0 and 1. I tried to use
Code:
sample01()
but it did not worked;

https://www.openfoam.com/documentati...8C_source.html

Thanks,
Farzad
farzadmech is offline   Reply With Quote

Old   January 26, 2023, 09:02
Default
  #2
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 9
s1291 is on a distinguished road
Check this answer: Random number generation
farzadmech likes this.
__________________
"When in doubt, use brute force." -- Ken Thompson
s1291 is offline   Reply With Quote

Reply

Tags
of21, random number, sample01


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
use the message in macro DEFINE_PROFILE with parallel processor alireza_T Fluent UDF and Scheme Programming 3 May 11, 2022 03:08
Foam-Extend 4.0 simpleFoam motorbike parallel error? EternalSeekerX OpenFOAM Running, Solving & CFD 0 May 10, 2021 05:55
[OpenFOAM.org] OF2.3.1 + OS13.2 - Trying to use the dummy Pstream library aylalisa OpenFOAM Installation 23 June 15, 2015 15:49
[blockMesh] --> foam fatal error: lillo763 OpenFOAM Meshing & Mesh Conversion 0 March 5, 2014 11:27
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


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