#### Transcript PPT - Modeling & Simulation Lab.

Cloud Kwang Hee Ko September, 27, 2012 This material has been prepared by Y. W. Seo. Introduction Clouds are a ubiquitous feature of our world Provide a fascinating dynamic backdrop, creating an endless array of formations and patterns. Integral factor in the behavior of Earth’s weather systems Important area of study for meteorologists, physicists, and even artists Introduction Clouds play an important role when making images for flight simulators or outdoor scenes. Clouds’ color and shapes change depending on the position of the sun and the observer. The density distribution of clouds should be defined in three-dimensional space to create realistic images. Introduction The complexity of cloud formation, dynamics, and light interaction makes cloud simulation and rendering difficult in real time. Ideally, simulated clouds would grow and disperse as real clouds do. Simulated clouds should be realistically illuminated by direct sunlight, internal scattering, and reflections. Cloud Dynamics Simulation Clouds are the visible manifestation of complex and invisible atmospheric processes. Fluid dynamics governs the motion of the air, and as a result, of clouds. Clouds are composed of small particles of liquid water carried by currents in the air. The balance of evaporation and condensation is called water continuity. The convective currents are caused by temperature variations in the atmosphere, and can be described using thermodynamics. Cloud Dynamics Simulation Fluid dynamics, thermodynamics, and water continuity are the major processes. The physics of clouds are complex. By breaking them down into simple components, accurate models are achievable. Cloud Radiometry Simulation Clouds absorb very little light energy. Instead, each water droplet reflects, or scatters nearly all incident light. Clouds are composed of millions of these tiny water droplets. The light exiting the cloud reaches your eyes, and is therefore responsible for the cloud’s appearance. Cloud Radiometry Simulation Accurate generation of images of clouds requires simulation of the multiple light scattering. The complexity of the scattering makes exhaustive simulation impossible . Instead, approximations must be used to reduce the cost of the simulation. Efficient Cloud Rendering After efficiently computing the dynamics and illumination of clouds, there remains the task of generating a cloud image. A volumetric representation must be used to capture the variations in density within the cloud. Rendering such volumetric models requires much computation at each pixel of the image. The rendering computation can result in excessive rendering times for each frame. Efficient Cloud Rendering The concept of dynamically-generated impostors A dynamically-generated impostor is an image of an object. The image is generated at a given viewpoint, and then rendered in place of the object. The result is that the cost of rendering the image is spread over many fames. Useful for accelerating cloud rendering Physically-based Simulation on GPUs Using the GPU for simulation does more than just free the CPU for other computations. It results in an overall faster simulation. GPU implementations of a variety of physically-based simulations outperform implementations. General-purpose computation on GPUs has recently become an active research area in computer graphics. Cloud Dynamics The dynamics of cloud formation, growth, motion and dissipation are complex. To understand the dynamics is important. To choose good approximations allows efficient implementation. The Equations of Motion Assume that air in the atmosphere is and incompressible, homogeneous fluid. Incompressible if the volume of any sub-region of the fluid is constant over time. Homogeneous if its density is constant in space. These assumptions do not decrease the applicability of the resulting mathematics to the simulation of clouds. The Equations of Motion The motion of air in the atmosphere can be described by the incompressible Euler equations of fluid motion where ρ is the density of the fluid. B is buoyant acceleration, and f is acceleration due to other forces. Parcels and Potential Temperature A conceptual tool used in the study of atmospheric dynamics is the air parcel. The parcel approximation is useful in developing the mathematics. When a parcel changes altitude without a change in heat, it is said to move adiabatically. We can account for adiabatic changes of temperature. Parcels and Potential Temperature The potential temperature, Θ, of a parcel of air can be defined as the final temperature ∏ is called the Exner function, Rd is the gas constant. Buoyant Force Change in the density of a parcel of air relative to its surroundings result in a buoyant force on the parcel. If the parcel’s density is less than the surrounding air, this force will be upward. If the parcel’s density is greater, the buoyant force will be downward. The density of an ideal gas is related to its temperature and pressure. Buoyant Force A common simplification in cloud modeling is to regard the effects of local pressure changes on density as negligible where g is the acceleration due to gravity and qH is the mass mixing ratio of hydrometeors. Environmental Lapse Rate The Earth’s atmosphere is in static equilibrium. The hydrostatic balance of the opposing forces of gravity and air pressure results in an exponential decrease of pressure with altitude Here, z is altitude, and P0 and T0 are the pressure and temperature at the base altitude. Saturation Mixing Ratio Cloud water continuously changes from liquid to vapor and vice versa. The water vapor mixing ratio at saturation is called the saturation mixing ratio, denoted by qVS(T,p) with T in Celsius and p in Pa. Environmental Lapse Rate The water mixing ratios at a given location are affected both by advection and by phase changes. The rates of evaporation and condensation must be balanced, resulting in the water continuity equation Where C is the rate of condensation. Thermodynamic Equation The potential temperature of saturated air cannot be assumed to be constant. If latent heating and cooling due to condensation and evaporation are the only non-adiabatic heat sources, then the first law of thermodynamics results in where L is the latent heat of vaporization of water. Vorticity Confinement Vorticity confinement works by first computing the vorticity , from which a normalized vorticity vector field is computed. From these vectors we can compute a force that can be used to replace dissipated vorticity back in Vorticity Concept In fluid dynamics, the vorticity is a vector that describes the local spinning motion of a fluid near some point, as would be seen by an observer located at that point and traveling along with the fluid. One way to visualize vorticity is this: consider a fluid flowing. Imagine that some tiny part of the fluid is instantaneously rendered solid, and the rest of the flow removed. If that tiny new solid particle would be rotating, rather than just moving with the flow, then there is vorticity in the flow. From wikipedia Solving the Equations Fluid Flow Water Continuity Thermodynamics Solving the Equations (Fluid Flow) The cloud model is based on the equations of fluid flow. The simulator is built on top of a standard fluid simulator. Solve the equations of motion using the stable two step technique described . First, use the semi-Lagrangian advection technique Second, the intermediate field is made. incompressible using a projection method based on the Helmholtz-Hodge decomposition . Solving the Equations (Fluid Flow) The projection is performed by solving for the pressure using the Poisson equation with pure Neumann boundary conditions Subtract the pressure gradient from u’ Solving the Equations (Water Continuity) The changes in qV and qC are governed by advection of the quantities as well as by the amount of condensation and evaporation. Solve equations in two steps First, advect each using the semi-Lagrangian technique mentioned. Second, at each cell, compute the new mixing ratio as follows Solving the Equations (Thermodynamics) Potential temperature is advected by the velocity field. The temperature increases by an amount proportional to the amount of condensation, and is able to update it as follows. Implementation Solve the equations on a grid of voxels. Use a staggered grid discretization of the velocity and pressure equation. This means that pressure, temperature, and water content are defined at the center of voxels. This method reduces numerical dissipation. It prevents possible pressure oscillations that can arise with collocated grids. Interactive Applications Cloud simulation is a very computationally intensive process. It is usually done offline. Simulations of phenomena such as clouds have the potential to provide rich dynamic content for interactive applications. Interactive Applications Integrate the cloud simulation into SkyWorks cloud rendering engine. “Simulation of Cloud Dynamics on Graphics Hardware” SkyWorks was designed to render scenes full of static cloud very fast. It recomputes the illumination of the clouds, and then uses this illumination to render the clouds at runtime. Cloud Rendering Convert the simulation’s current cloud water texture into a true 3D texture, which is then used to render the cloud for multiple frames. Rendering directly from the flat 3D texture is too expensive. The conversion is overall much faster. A simulation time step dose not complete every frame. The generation of the 3D texture is included in the simulation amortization. It doesn’t affect our interactive frame rates. Cloud Illumination To create realistic images of clouds, we must account for the complex nature of their interaction with light. Light has been scattered many times by the tiny water droplets in the cloud. This is what gives clouds their soft, diffuse appearance. A full simulation of multiple scattering requires the solution of a double-integral equation. Cloud Illumination A full simulation of multiple scattering requires the solution of a double-integral equation. Cloud water droplets scatter most strongly in the direction of travel of the incident light, or forward direction. Example