<H1>WIND FIELD MODELS</H1>
        In this section we describe two different wind field models and show how they can be used to model wind effects on textiles. The first model is based on the work of Stam 
[Sta97] and calculates the numerical solution of the Navier-Stokes equation with a semi-Lagrangian approach. This model is extended to interaction of the wind flow with textiles. The second model employs precomputed wind flows and particle tracing methods. This approach is much easier to implement and can be added to existing simulation modules without additional computational cost. In section 4.2, we show how to produce realistic effects of wind on textiles including lee effects. 4.1 The Navier-Stokes equations The Navier-Stokes equations describe a precise mathematical model for fluid flows. The numerical algorithms used in CFD to solve these equations are designed for physical accuracy for engineering applications and are expensive in computation. But in our case where this precision is not necessary simplifications can be made which greatly reduce the computation costs as described by Stam [Sta03]. Since the arising wind velocities are clearly below the speed of sound, compressibility effects are negligible, and the wind is modelled as an incompressible constant density fluid. This notably simplifies the numerical approximation, and the incompressible Navier-Stokes equations can be written in a compact vector notation as
        
          4.1
          ∇ · u = 0,
        
        
          4.2
          ∂u = −(u · ∇)u − 1 ∇p + ν∇ 2 u + f . ∂t ρ
        
        Here, u describes the (three-dimensional) velocity field, ν is the kinematic viscosity of the fluid, ρ its density, p the pressure in the wind field, and f accounts for external forces. The first equation states that the velocity field should be incompressible while the second one describes the evolution of a velocity field over time. The first term on the right hand side reflects the change of velocity due to advection, while the second expression accounts for any external force f and acceleration caused by the local pressure gradient ∇p and by viscous drag depending on ν. In the following we briefly describe the numerical solution of the Navier-Stokes equations (4.1) and (4.2) by Stam 
[Sta97]. To solve these equations numerically they first have to be discretised. For this, the computational domain is diced up into equally sized cubes forming a grid as described in section 4.2.2, and sample values of velocity and pressure are defined at the cell centres. Foster and Metaxas [FM96] use a finite difference approximation for the discretisation of the operators in equation (4.2). Then they update the cell’s velocities according to the divergence value computed in each direction, respectively, using an explicit integration scheme. Since time steps in explicit computations usually need to be very small, we follow Stam 
[Sta99]
 who proposes an implicit integration scheme, which allows stable simulations with large time steps. While the linear terms in equation (4.2) are straightforward to solve implicitly, the term −(u · ∇)u is nonlinear and deserves special attention. Here, a different approach based on the method of characteristics is used to solve the advection equation. Equation (4.2) does not provide a divergent-free velocity field. Therefore, the divergence of each cell in the grid has to be projected to zero using the Helmholtz-Hodge decomposition 
[Sta03]. The major advantage of Navier-Stokes based approaches consists in the fact that the evolution of the wind flow over time is calculated. It enables us to model global effects like convection and diffusion on a physical basis. We present a model to exploit these wind models for calculating the interaction of deformable objects with the air flow by a boundary condition method. As already stated by Stam [Sta03] “a velocity field of its own isn’t really visually interesting until it starts moving objects [...]”. That means in particular that all objects in the scene interact with the fluid present in it, i.e. in our case clothes with the wind. On the one hand the wind deforms the objects which on the other hand change the wind flow. To describe the above situation by a physical model we require the Neumann boundary condition ∂u =0 ∂n to be satisfied for the wind flow u at any boundary point of an object with normal n. Rigid objects like walls will influence the fluid field but will not be affected by fluid forces themselves. Deformable objects like cloth are supposed to both experience fluid forces and itself influence the fluid flow. This in fact is a major difficulty. Consider a point p b on the boundary of a deformable object in the scene. Let u(p b ) be the corresponding wind velocity at that point and n be its normal. On the one hand, we want the Neumann boundary condition u(p b ) · n = 0 to be satisfied. On the other hand, the wind velocity orthogonal to the object’s surface is just what causes the aerodynamic forces. Without further remedial action setting the boundary according to the Neumann condition would mean that the fluid will not exert forces on the objects. Here we propose a method which meets both requirements. For every deformable object the velocity value of the surrounding wind field for every vertex of the representing mesh is tracked. In the solver’s cycle, the boundary conditions are then set prior to any other operation: For every object in the scene each triangle of its representing mesh is registered in the fluid grid, which means that the cell of the wind field occupied by the object is marked as occupied. The wind velocity at the vertex positions of the object is recorded. Additionally, the normals of these vertices are stored. Then, the aerodynamic forces as described in section 3 are calculated. Finally, for every marked cell in the scene the previously stored normals are averaged in one space cell which are used to update the velocity at the cell to satisfy the Neumann boundary condition. Thus, the boundary conditions are met and yet aerodynamic forces are obtained. A different issue is how to deal with the inside of (rigid) objects. The method to set boundary conditions as described above does not account for the interior of objects. Thus, a nonzero velocity could be mistakenly assigned to cells lying inside an object. To avoid this situation, the path of the wind flow is checked for object intersection, whereby the collision detection of the cloth simulation system provides a simple method to deal with this issue [MKE03]. 4.2 Particle Tracing on Wind Fields Here we combine the idea of creating wind fields by predefined flow primitives with particle tracing in given flow fields. To define a wind scene we first built up the air flow by simple primitives such as parallel directed wind fields, vortices, etc. We then use a par- ticle tracing method in the defined wind field to determine the effect of lee by detecting windless areas. This method is very easy to implement and yields very plausible and nicely looking results. A simple approach to generate complex air flows is to define a wind field by mathematical functions which assign to each point in space a unique velocity value. As Wejchert et al. [WH91] have shown, this already enables an animator to design even complex wind fields: Assuming an irrotational (∇ × u = 0), inviscid, and incompressible (∇ · u = 0) fluid, the NavierStokes equations which describe the mechanics of any fluid (see section 4.1) can be simplified to give the Laplace equation
        4.1.1 The solution of the Navier-Stokes equations
        4.1.2 Wind effects on clothes
        4.2.1 Global Wind Fields
        
          4.3
          ∇ · u = ∇∇φ = ∇ 2 φ = 0,
        
        where φ is the potential of the given wind field. Thus, the velocity field u is given by The linearity of equation (4.3) enables an animator to combine basic flows which satisfy equation (4.3) as he likes and thus to obtain complex fluid flows. Some primitives common to fluid simulations are depicted in figure 2 . One drawback of this model is that it cannot handle objects exhibiting complex boundaries. The approach to model solid objects in the scene taken by Wejchert et al. consists in placing a wind source using a mirror principle in order to extinguish the air flow at the boundary of the object. While this works for simple objects this approach is not feasible at all with deformable objects like textiles. Another more serious drawback of this model for our application consists in the lack of interaction with objects. The wind flow defined by the primitives will not react on objects in the scene which means for example that tissues in the lee of other objects will be affected by the wind flow as well. However, this method can be combined with the aerodynamic model described in section 3 to give nice and fast results as will be shown in section 5. To solve the described problems we propose a model which combines the simple global wind flow techniques with a particle tracing method. Here, particles are moved along the wind field to determine the effect of objects in the scene. This model divides the scene into parallelepiped cells. 
There are two common approaches to discretising the continuous velocity field defined in space: one can either choose the midpoint of a cell 
[Sta99] or its six faces 
[FM96] to define the field. As usual, values between the defining points of the grid are interpolated using trilinear functions. The basic idea of the particle tracing method is to trace wind particles through a field w = i w i defined by linear superposition of wind sources corresponding to flow primitives with respective velocity fields w i . The field w does not account for lee effects caused by objects in the flow. Therefore we compute the wind field u containing these effects as follows. In our model every wind source is also a particle source: These particles form an uncoupled particle system which can be considered as a wind gust. The wind particles are emitted into the velocity field w i of the corresponding wind source which is defined on a grid. The specific emission intervals and amounts depend on the properties of the flow sources. In every time step each particle in a wind gust moves along its velocity field w i defined by the corresponding wind source. Notice that the movement of the particles in a wind gust is only affected by the wind source they belong to. The global superposition of all wind sources has no effect on these particles. To calculate the wind particles’ positions we used the explicit Euler integration scheme. For a wind particle at position p t and time t this results in a path s(p t , p t+∆t ), where p t+∆t denotes the position after time step ∆t according to p t+∆t = p t + w i (p t , ∆t) . As a particle moves along its path in space, all grid cells colliding with the path are updated with the velocity of the associated wind source with respect to the position of the particle. The particle might cross several grid cells on its way during a single time step. If this is the case, the path of the particle has to be subdivided into parts not exceeding the size of a grid cell. This path is then tested for collisions with the objects in the scene. The velocity field u is then computed as for each grid cell separately, where w i are all those wind sources whose particles have reached the cell. If a collision is detected at position p col the normal of the colliding object n obj (p col ) is determined and the velocity of the particle is set to w i (p col , t+∆t) = w i (p col , t)−(n obj ·w i (p col , t))·n obj This assures that the velocity component of the resulting field u is orthogonal to the collision object’s surface at p col is zero, i.e. u(p col , t + ∆t) · n obj = 0 , and thus no flow propagates through the object. The wind force effective on objects in the scene is then computed from the velocity field u. Since u is determined using the wind particles, every point p that could not be reached by any wind particle will hold zero velocity even if w may hold a nonzero velocity. Thus, this method solves the problems described in section 4.2.1. Note that the somewhat tempting simplification of tagging each cell to either have wind in it or not is not valid. Imagine the simple scene in which there are two directional wind sources with opposite wind directions. Let them further have equal velocity magnitude and no distance attenuation. If we now place a solid object in between these two sources a rather undesired effect would occur using this simplification: on both sides of the solid object all cells would be tagged as having wind. But evaluating the wind field at every cell we would obtain a zero velocity. This is due to the extinguishing effect of the superposition of the two wind sources. Therefore, it is crucial for the particles to have the associated velocity of their wind source and not just the velocity resulting from the global superposition of all wind sources. 4.3 Comparison In this section we comment on the different models described in this paper. For physically accurate simulations based on the common method in fluid dynamics the model introduced by Stam produces realistic effects which global wind field models can never achieve. It produces nice swirls and vortices derived from dynamical characteristics of the fluid. However implementing the fluid solver is quite complex and using a high grid resolution is computationally expensive. Hence, the global wind field model is better suited for an easy to implement tool which is easy to adapt to specific situations. Particle systems are very common in the simulation engines and most functionality can be adapted to integrate the proposed wind model. Even with this straightforward approach, nice, realistic looking results can be achieved which is illustrated in the next section.
        u = ∇φ .
        Directional Vortex Point
        
          Figure 2: Flow primitives
        
        4.2.2 Particle Tracing
        u = w i
        .
        5.
      
      
        