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

Creating an initial field with a random disturbance

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2009, 18:46
Post Creating an initial field with a random disturbance
  #1
Member
 
Join Date: Mar 2009
Posts: 46
Rep Power: 17
mmahdinia is on a distinguished road
Hi everybody,

I am using the setFields utility to create an initial filed for a scalar. Is there a way to create a random disturbance with an specified amplitude (like 10 percent of the max value) in the initial scalar field mentioned above?

Your response would be of high value to me.

Thanks
Maani
mmahdinia is offline   Reply With Quote

Old   October 7, 2009, 11:35
Default
  #2
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
IC is transient and temporary, why do you care about it?
__________________
~
Daniel WEI
-------------
Boeing Research & Technology - China
Beijing, China
Email
lakeat is offline   Reply With Quote

Old   October 7, 2009, 11:53
Default
  #3
Member
 
Join Date: Mar 2009
Posts: 46
Rep Power: 17
mmahdinia is on a distinguished road
Dear Daniel,

Generally that is true for steady state cases. But I was thinking about the modeling of the evolution of an unsteady case. I am aware that this unsteadiness will finally lead to a semi-steady case, but it is the beginning of the current that I am currently seeking about.

Thanks for the reply
Maani
mmahdinia is offline   Reply With Quote

Old   October 7, 2009, 23:50
Default
  #4
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
Hi, you are welcome, There's a way for us in using channelOodles some years ago, which is now renamed as channelFoam, at that time Eugene gave us his perturbU utility, you can just download it and I think that's a good point for you to start.
__________________
~
Daniel WEI
-------------
Boeing Research & Technology - China
Beijing, China
Email
lakeat is offline   Reply With Quote

Old   October 11, 2009, 09:38
Default
  #5
bjj
New Member
 
Bjarne Jensen
Join Date: Mar 2009
Location: Denmark
Posts: 7
Rep Power: 17
bjj is on a distinguished road
You may also use the foamCalc utility. This includes a randomise function. In your case do: foamCalc randomise <pertubation> <field> -time 0. This will create a new field in your /0 dir with a random pertubation.

Regards,
Bjarne
bjj is offline   Reply With Quote

Old   October 12, 2009, 09:27
Default
  #6
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi,

one way to get some kind of 'turbulence' as initial field is to use the velocity field from 'boxTurb'. From a dummy cube-mesh (which is bigger than your domain) you can map the velocity field to your case and/or add it to an existing solution.

Fabian
braennstroem is offline   Reply With Quote

Old   February 22, 2014, 18:32
Default foamCalc only randomise vector field?
  #7
Member
 
Manjura Maula Md. Nayamatullah
Join Date: May 2013
Location: San Antonio, Texas, USA
Posts: 42
Rep Power: 12
mmmn036 is on a distinguished road
Hello,

I need to randomise a scalar filed before i start running my simulation. foamCalc gives me error when I randomise the scalar field, but it disturbes U (vector) perfectly. The error is:

--> FOAM FATAL ERROR:
Unable to process D
No call to randomise for fields of type volScalarField

Any body can help?

Thanks
Manjura
mmmn036 is offline   Reply With Quote

Old   March 20, 2016, 22:55
Default
  #8
Member
 
Pavan
Join Date: Jan 2016
Posts: 53
Rep Power: 10
pvpnrao is on a distinguished road
Manjura has fixed this problem.

Go to the file $FOAM_SRC/postProcessing/foamCalcFunctions/field/randomise.C

Go to line 95 which says: if (fieldHeader.headerOk())
and paste the following lines in the body of the function:
writeRandomField<scalar>
(
fieldHeader,
pertMag,
rand,
mesh,
processed
);

cd ../..

wmake libso

then the 'randomise' utility will work for scalar fields also.
pvpnrao is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 16:33
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16
Unknown error sivakumar OpenFOAM Pre-Processing 9 September 9, 2008 13:53
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09


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