Visualization of Droplet Dynamics in Cloud

Data visualization uses charts, graphs and maps to illustrate some information. Visualizing data helps us understand information faster. The study of droplet dynamics is a critical part of cloud physics and includes studying droplet properties. The aim of this work is to visualize the droplet dynamics obtained from DNS (Direct Numerical Simulation) data due to evaporation and condensation of the droplets. This simulation contains coupled Eulerian and Lagrangian frames. Animation is created for both Eulerian grid data and Lagrangian droplet movement. Scientific visualization provides a way to analyze these turbulent properties in a part of a cloud and learn about the nature of droplets and mixing process in such highly turbulent areas. Keywords—DNS (Direct Numerical Simulation), NetCDF (Network Common Data Form), VTK (Visualization Toolkit), HPC (High Performance


Introduction
Weather forecasting centers manage a large amount of meteorological data. Such data must be interpreted within short period of time. Scientific visualization can be a great help in supporting meteorological researchers and scientists. Decision-making depends on data that comes in a large quantity that it cannot be understood without some level of abstraction, such as a visual one. There are various types of meteorological data namely rainfall data, temperature data, radiation data, radar data and many more. This work involves examining various droplets' properties. It is difficult to examine the properties by just looking at Direct Numerical Simulation. Direct Numerical Simulation is method in Computational Fluid Dynamics where the range of spatial and temporal scales of the turbulence are resolved. Small scale simulation is one method in understanding the physics behind the phenomena and generate data. This work shows, the data obtained from Direct Numerical Simulation of entrainment and mixing processes in cloud affect the droplet dynamics due to condensation and evaporation. The turbulent entrainment and mixing of dry air with moist or cloudy air influences the cloud's lifespan by changing the properties. Such modifications are responsible for the droplet dynamics. This mixing process is quite complex, and it is difficult to study it during field observations. It illustrates how all of the droplets will evaporate by the same number, or the subset of the droplets evaporates entirely, while the other droplets remain intact in the cloud turbulence. However, it is not clear how the size of the droplets is influenced by the mixing process and has a major impact on the spectrum of the droplets. The types of mixing processes of the droplets are known as homogeneous mixing and in-homogeneous mixing [1]. Many visualization techniques can be used to visualize the given data [2]. This work uses ParaView for visualization because of its ability to analyze extremely large datasets rather than using expensive commercial software.

Literature Survey
The data formats along with the tools involved in the visualization are given below.

NetCDF File Format
NetCDF is the popular data format defined by Unidata program at the University Corporation for Atmospheric Research (UCAR), used widely in climatic, meteorological and oceanographic applications such as climate change and forecasting of weather etc. It is a data format that is created to support the array-oriented data [2]. All NetCDF formats contain a header which describing the layout of the rest of the file, particularly the data arrays. The NetCDF model of data abstraction creates scientific data set as a group of named multidimensional variables along with their coordinate systems [3]. Every NetCDF file has three components: dimensions which are used to define shape of data, variables to store the array values, and attributes to provide a title or this history of the data set. They help understand the data more clearly.

VTK (Visualization Toolkit)
The Visualization Toolkit offers numerous writer object with the ability to read and write standard file formats along with their own file formats. The purpose for creating other data file format is to provide a consistent data representation scheme for a number of dataset forms and to provide an easy method for transmitting data [4]. There are two file formats available in VTK, Legacy and Serial. These formats are less flexible as compared to XML file formats. While these formats are much more complicated than the Legacy format. By just providing a simple XML description any VTK source or filter can be added.

ParaView
ParaView is one of the most preferred open-source scientific visualization tools for the visualization. This software is used in many communities because of its easy to use nature to analyze and visualize large data sets. ParaView uses three steps to visualizing data: reading or loading the data files, filtering the necessary details, and then rendering the images for the given data. Reading the data involves loading the data files which creates pipelines for the loaded data, filtering the data involves creating arrays or using arrays which are necessary for the visualization and rendering involves generating and saving the images for the data set. ParaView has Python, C, C++ and Fortran bindings. In this work python shell is used for the visualization process.

Problem Statement
The aim of this paper is to propose a procedure for the visualization of the droplet dynamics in the cloud obtained from the DNS (Direct Numerical Simulation) data in an open-source software application, rather than expensive commercial alternatives to help the scientists and researchers to examine the properties of the droplets in cloud turbulence.

Data Flow Diagram
The input data consists of two datasets -Eulerian NetCDF files and Lagrangian SION files. As far as NetCDF files are concerned, there is an inbuilt NetCDF reader in ParaView software. For SION files, there are no readers as such in ParaView. So, to load SION data, SION files have to be converted into VTK format which is the default format for ParaView. Then it is to be further converted into vtkUnstructuredGrid format. The dataset forms a topologically irregular set of points and cells. After the conversion to VTK, we extract the mixing ratio variable from the NetCDF files and create new series of NetCDF files which are smaller in size. This allows ParaView to process the files faster. Now, both the VTK and extracted NetCDF files and loaded in ParaView and visualization of the data is obtained at various time steps. The purpose of ParaView is to analyze extremely large data sets. Now these images are used for the animation purpose.

Process Flow Diagram
The DNS data stored in SION format could be converted to ASCII files using SIONLib [6]. ASCII files are also referred as text files that can be read easily. They often contain letters, numbers and some line separators such as comma or spaces. ASCII files may be larger in file size but the speed of writing and reading is much faster. They are efficient, but one has to specify the file's content before reading or writing the files. So, to open and visualize the data a program must be used. There are many bindings available in all the popular languages to access these text files. The procedure for the visualization of droplets dynamics includes extraction of the positions of the marker and radius of the droplets from the ASCII files, then preparation of data using Python script which will create series of VTK files that can be coupled with the NetCDF Eulerian grid data files and imported into open-source scientific visualization software -ParaView. ParaView uses three steps to visualizing data: reading or loading the data files, filtering the necessary details, and then rendering the images for the given data. Data must be read in an acceptable file format into ParaView. Next, the data must be analyzed in different ways available and is to be filtered with the number of filters available. Finally, the visible image from the data is rendered and the images at different time steps can be stored. Now, these images are used to form an animation video using python script.

Implementation
Extract the mixing ratio variable from the Eulerian data files and create series of NetCDF files containing only mixing ratio data of same dimensions x, y, z. These Eulerian data points were reduced by spacing every two grid points. We extract this variable and form new NetCDF files to reduce the memory consumption by ParaView and also to speed up the computational time. Get the Lagrangian Data files converted to ASCII text files by extracting the marker positions and radius of the droplets. Load these coupled files in ParaView by creating NetCDF Reader for extracted Eulerian data and XMLUnstructuredGrid Reader for Lagrangian data. Set scalar coloring for both and create render view with best possible resolution. Results for this paper have 2555 x 1376 pixels. Change representation type apply color maps/ transfer functions until desired visualization is obtained. Edit color legend/bar for the datasets respectively and choose the scale based on minimum and maximum values in data. Save the Screenshots of the desired visualization and run above steps in loop for each extracted Eulerian file and Lagrangian file. Use python program to animate the saved images to create an animation video.

Results/ Screenshots
In visualization the most important part is giving appropriate color. In ParaView, applying color map/transfer function is the part where the color is applied to the visualization. "GetColorTransferFunction('variable_name')" and "ApplyPreset('colormap_name')" functions help to apply the color map/transfer function to the variables. A gray scale color map is imported (eul_gray.8) for the visualization of cloud slab. Usually the cloud slab is represented by white coloration. The range of the mixing-ratio variable is decided to be 0 to 0.0012. For radius variable 'warm to cool' color map/transfer function is used, which is already present in ParaView. This color map is useful to highlight the contrast between smaller radii and larger radii. It would otherwise be difficult to distinguish the difference in sizes due to the high density of the data. For the desired visualization of the droplet particles, the range of the radius data was changed many times. By trying several different ranges, the desired visualization was obtained when the range was 0 to 18. These ranges were set based on the values present in the data. "RescaleTranferFunction(start_point, end_point)" function was used to set the range.  Fig. 3, is the color maps/transfer functions for mixing-ratio and droplet radius respectively. Scale of the color bar depends on the maximum and minimum values in the data. For mixing-ratio variable we use gray scale color bar and for radius variable we use 'warm to cool' color bar.     Fig. 7, is the visualization of Eulerian gridded data and Lagrangian data together at time step 80. The droplets here evaporate and get smaller in size (red particles). These results show the mixing process of the droplets in cloud due to evaporation and condensation. An animation is created of the visualizations obtained at every time step to help us understand the movement of droplets in the cloud turbulence.

Conclusion
In meteorological data analysis, visualization has emerged as a great tool to understand the data more quickly and efficiently. The results are communicated between climate researchers and scientific community. A picture is worth more than a thousand lines of numbers or words. This visualization of droplet evolution provides the opportunity to peek inside the cloud and observe properties of individual droplets. This investigation is not possible with field observations or with traditional data analysis.

Future Work
This particular version of the visualization was run on an individual PC using CPU processing only. Parallel computational methods such as, GPU and multi-core processing, and those described in ParaView Visualization handbook[12] can be utilized in future studies to reduce time consumption. Due to time constraint the ASCII files were converted to VTK in this work as 'pyevtk' makes it easy to do so. In future, research can be done on how to read ASCII files directly in ParaView to avoid the step of converting them to VTK files as shown in Figure