The spray is created by building sources of the spray and its interaction with the air around it. The spray evolution can contain the effects of buoyancy, vorticity, turbulence, windshear and vortical motion.
As with clouds, the lighting of the spray is affected by the incident sun and air light. The user can specify the strength with which light is scattered and absorbed. Advanced users can also modify the angular dependence of the scattering.
A spray is added to a scene by specifying the object
type :spray in the scene file. The object coordinates correspond to the location and orientation of the center of the spray box. An example of a spray object entry using a spray object file spray.dat in a scene file is:
number_of_times 1
time x y z theta phi chi
0 10 0 0 0 0 0
name: spraything
type: spray
input: spray.dat
priority: 2
The contents of an example spray file are shown below. Many of the lines in it are familiar from other object files.
RenderWorld_data_file volume 1 1
216
216
64
12
12
15
number_of_bands 3
band_id 1 2 3
0.025 0.025 0.025
0.1 0.1 0.1
0.025 0.025 0.025
phase_functions.dat
0.01
multiple
0.125
0.01
0.004
end
RenderWorld_data_file spray 5 5
0
100
yes
density.dat
yes
0
0
15
yes
250
250
150
0.5
1
gaussian
50
0 0
z
100.0
0
100
0.1
64 64 64
1.0
wind
0
15 90
1000.0
0.1
4.0
0.001
full
no
no
end
The lines prior to the line
RenderWorld_data_file spray 5 5 are
identical in structure and meaning to those used in clouds.
The section on Clouds describes them in detail. The lines from RenderWorld_data_file spray 5 5 on are specific to sprays, and blobs have a similar structure, as described in the section on Blobs.
initial_time and final_time determine when to turn on the spray volume evolution, and turn it off. After final_time, the distribution is written to a file if desired, and the spray is frozen in time in subsequent frames. yes or no after output_density_at_end. If you choose yes, then you put the name of the output file after density_file on the next line. If you choose no, then eliminate then line density_file from the input file. The density file is a binary file that gives the particle density at each point in the box. The density that has been written to a file can be used in the cloud or blob objects. slicex, slicey, and slicez are the distance inward in meters each of the three sides are moved in. One useful result of slicing is that spray source nozzles lying between the bounding box edge and the slice walls are not visible in a rendered image, giving the spray a chance to evolve somewhat before being visible.taperx, tapery, taperz parameters are the distance inward from the box edges affected by tapering. If slicing has also been chosen, the slice edges are used for measuring the taper distance. The cloud material density is tapered with a taper coefficient in each of the three directions. The taper coefficient is zero at the edges, one at the inside distance, and varies between these extremes according to a power-law specified by taper_power . Spray Source
spray_shape flat has uniform density across the nozzle. As material moves out of the nozzle, its speed is given by the spray_velocity line, and its absolute angle is spray_angle 0 0 , with the angles corresponding to elevation and azimuth. base_orientation z, y, or x control the nozzle orientation. The width of the circular cross section of the spray nozzle is given by spray_width . Emission of material begins at physical time spray_start_time , and stops spray_duration seconds later. After stopping, the spray material in the bounding box will continue to evolve with whatever wind is present. During the initial pray_ramp_time seconds, the magnitude of emitted material is ramped up from zero to source_density . The center of the spray nozzle is located at spray_center. which is given in cell units, not physical units.An Array of Sprays Sources
1 might suggest, any number of spray sources can be placed in the spray bounding box. To accomplish this, replace 1 by the appropriate number of sources, and repeat lines spray_shape through source_density with new parameters for each source. Windshear Evolution
ambient_wind part of the spray file specifies the types of advective wind carrying spray material throughout the volume. There are two types: an ambient windshear and a vortex. This wind is not to be confused with turbulence, which is included separately, as discussed in the section below on turbulent evolution.ambient_type wind . The wind velocity starts at zero at the bottom of the bounding box, and increases linearly to the ambient_velocity at the ambient_height (in meters), with direction ambient_angle. Above this height the wind velocity remains at the ambient_velocity. The spray shape is updated periodically in time at intervals separated by delta_time seconds.Vortex Evolution
ambient_type is changed to ambient_type vortex, and a sequence of lines defines a procedural form for the wind. An example of the vortex type is:
ambient_type vortex
core 1
n_radial 2
v_radial -0.00005
p_radial 2
v_radial 500
p_radial -2
n_theta 1
v_theta 200.0
p_theta 0
n_z 1
v_theta -0.001
p_theta 2
In the cylindrical geometry, a central core region is defined with a radius given in the
core 1 line, e.g. 1 meter. Within this region, the vortex wind velocity on the outside boundary of the core is smoothly tapered to zero at the center. Throughout the rest of the spray bounding box, the cylindrical components of the velocity field are created as power series in either the radius or height. In the example above, the radial velocity has two terms in its power series expansion, as given by the n_radial line. Each term is characterized by a pair of numers, one for the power of the radius used p_radial, and one for the coefficient v_radial.. When applied, the radius is scaled by the core radius. In equation form, the radial velocity in the above example is:
Similarly, the angular velocity in the direction perpendicular to the radial direction is defined as a power series in radius, following the same format: give the number of terms in the power series, followed by pairs of numbers for the coefficient and power of each term. The vertical velocity component follows exactly the same procedure, but here the power series is in the height from the center of the bounding box.
Next, the parameters for the buoyant evolution are specified. The
air_density is the density that neither rises or falls in the presence of gravity. Densities greater than the air_density fall, and those less rise. To control the degree of rising and falling, set the reference_density parameter. Specifically, the acceleration experienced by a given density is calculated by
acceleration = earths_gravity * (density - air_density)/reference_density
so that a high reference density diminishes the effect of gravity and a low reference density enhances it.
Finally, the specific way that spray couples to gravity is determined by setting
gravity_flag. A value of full gives full buoyant evolution, a value of yes turns off buoyancy and simply gives each density an acceleration equal to earths_gravity, and a value of no turns off all gravitational effects.
Turbulence is creted by changing
random_fluctuations_flag to yes from no. When set to yes, turbulence is present and a group of parameters that specify the turbulence must be included. The result looks like:
random_fluctuations_flag yes
seed 10
time_scale 1
velocity_scale 50
length_scale 300
end
The turbulence is generated from a set of random numbers, for which
seed, is the seed from which the random numbers are generated. It must be a positive integer. The time_scale is the time over which the turbulent field evolves. The evolution of the turbulent field is itself random, so this time is effectively the time over which the turbulence becomes uncorrelated with its previous state. The velocity_scale is the average velocity of the turbulence, which determines how strongly the turbulence deviates from the ambient wind motion. The value of this relative to the spray source velocity determines how much distortion the turbulence generates in the spray jet. Finally, the turbulence is on scales as small as the cell size up to the scale length_scale.
Running a large spray with a cell size spacing can eat up a lot of memory. In order to get around this problem, RenderWorld allows you to introduce small scale structure into the spray without having to use a fine lattice spacing in the bounding box. This is accomplished by adding a second grid, called the small-scale grid. The small-scale grid is a small periodic grid of fluctuation parameters that evolve in time, and plays a role like that for clouds. The density at any point in space is determined by combining the density of the spray field with the small-scale field.
The last part of the spray input file gives you the ability to add a small scale fluctuation field to the spray. If you want to add small scale fluctuations, then set
small_scale_fluctuations_flag to either yes or dynamic. If you set the flag to yes, then the parameters of the small scale fluctuation are as follows:
small_scale_fluctuatuion_flag yes
nx 64
ny 64
nz 64
scale 0.33333
fluctuation 0.33
power_law 2
length 150
seed 11011
end
nx, ny, and nz) specify the number of cells in the small scale fluctuation box. The cell size is some fraction of the cell size of the spray box, specified by a number less than one after scale. The value of scale should be determined by the ultimate resolution you want in the spray. The number of lattice points should then be picked so that the total volume of the fluctuation field overlaps a reasonable number ( typically > 5 in each dimension) of spray field cells. This is necessary so that the periodicity of the small scale field is not apparent in the final images.
The magnitude of the fluctuations is determined by setting
fluctuations. The parameter fluctuations can be any number greater or equal to zero. A value of zero corresponds to no fluctuations and a value of one can provide large fluctuations.
Although the fluctuations are random (the random number series is based on the
seed parameter), they are correlated in space and time. The power_law controls the rate of fall-off of the correlation with distance (similar to a fractal dimension), and the length is the largest spatial length scale of fluctuations.
These small scale fluctuations do not evolve in time. For evolving fluctuations, the
small_scale_fluctuatuion_flag should be set to dynamic and this portion of the input file becomes:
small_scale_fluctuatuion_flag dynamic
nx 64
ny 64
nz 64
scale 0.33333
small_scale_fluctuation_file fluct.dat
generate_file yes
fluctuation 0.33
power_law 2
length 150
seed 11011
reference_time 0
update_time 0.1
sigma 16.0
end
dynamic choice for cloud small scale fluctuations described in that section.