Creating an initial field with a random disturbance
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.
IC is transient and temporary, why do you care about it?
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
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.
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.
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.
foamCalc only randomise vector field?
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?
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:
then the 'randomise' utility will work for scalar fields also.
|All times are GMT -4. The time now is 02:00.|