notes dispersion relation again
play

Notes Dispersion relation again Please read Ocean wave has wave - PDF document

Notes Dispersion relation again Please read Ocean wave has wave vector K Kass and Miller, Rapid, Stable Fluid K gives the direction, k=|K| is the wave Dynamics for Computer Graphics, number SIGGRAPH90 E.g. the


  1. Notes Dispersion relation again � Please read � Ocean wave has wave vector K • Kass and Miller, “Rapid, Stable Fluid • K gives the direction, k=|K| is the wave Dynamics for Computer Graphics”, number SIGGRAPH’90 • E.g. the wavelength is 2 � /k g � Blank in last class: c = � Then the wave speed in deep water is k • At free surface of ocean, p=0 and u 2 � = gk � Frequency in time is negligible, so Bernoulli’s equation simplifies to • For use in formula � t =-gh • Plug in the Fourier mode of the solution to this ( ) h ( x , z , t ) = A ( K )cos K � ( x , z ) � � t equation, get the dispersion relation cs533d-winter-2005 1 cs533d-winter-2005 2 Simulating the ocean Energy spectrum � Far from land, a reasonable thing to do is � Fourier decomposition of height field: • Do Fourier decomposition of initial surface ˆ � � 1 i , j ( ) � x , z ( ) ( ) e h ( x , z , t ) = h i , j , t height i , j 2 • Evolve each wave according to given wave S ( K ) = ˆ � “Energy” in K=(i,j) is h ( K ) speed (dispersion relation) � Update phase, use FFT to evaluate � Oceanographic measurements have found � How do we get the initial spectrum? models for expected value of S(K) • Measure it! (oceanography) (statistical description) cs533d-winter-2005 3 cs533d-winter-2005 4 Phillips Spectrum Fourier synthesis � For a “fully developed” sea � From the prescribed S(K), generate actual • wind has been blowing a long time over a large area, Fourier coefficients statistical distribution of spectrum has stabilized ˆ ( ) S K h K ,0 ( ) = 1 2 X 1 + X 2 � 1 ( ) � The Phillips spectrum is: [Tessendorf…] • X i is a random number with mean 0, standard 2 � � � � K � W S ( K ) = A 1 � 1 deviation 1 (Gaussian) 2 ( ) k 4 exp � 2 � kl � � � � � • Uniform numbers from unit circles aren’t terrible either ( ) K W kL � � � � � Want real-valued h, so must have • A is an arbitrary amplitude ˆ ( K ) = ˆ ( � K ) � h h • L=|W| 2 /g is largest size of waves due to wind velocity • Or give only half the coefficients to FFT routine and W and gravity g specify you want real output • Little l is the smallest length scale you want to model cs533d-winter-2005 5 cs533d-winter-2005 6

  2. Time evolution Picking parameters � Dispersion relation gives us � (K) � Need to fix grid for Fourier synthesis (e.g. 1024x1024 height field grid) ˆ � At time t, want ( ) � � 1 K � x � � t h ( x , t ) = h ( K ,0) e � Grid spacing shouldn’t be less than e.g. 2cm K = ( i , j ) (smaller than that - surface tension, nonlinear ˆ � ( K ,0) e � � 1 � t e � 1 K � x = h wave terms, etc. take over) • Take little l (cut-off) a few times larger K = ( i , j ) � So then coefficients at time t are � Total grid size should be greater than but still ˆ ) = ˆ ) e � � 1 � t ( ( • For j � 0: h i , j , t h i , j ,0 comparable to L in Phillips spectrum (depends • Others: figure out from conjugacy condition (or leave on wind speed and gravity) it up to real-valued FFT to fill them in) � Amplitude A shouldn’t be too large • Assumed waves weren’t very steep cs533d-winter-2005 7 cs533d-winter-2005 8 Note on FFT output Tiling issues � FFT takes grid of coefficients, outputs grid of � Resulting grid of waves can be tiled in x and z heights � Handy, except people will notice if they can see � It’s up to you to map that grid more than a couple of tiles (0…n-1, 0…n-1) to world-space coordinates � Simple trick: add a second grid with a non- � In practice: scale by something like L/n rational multiple of the size • Adjust scale factor, amplitude, etc. until it looks nice • Golden mean (1+sqrt(5))/2=1.61803… works well • The sum is no longer periodic, but still can be � Alternatively: look up exactly what your FFT evaluated anywhere in space and time easily enough routines computes, figure out the “true” scale factor to get world-space coordinates cs533d-winter-2005 9 cs533d-winter-2005 10 Choppy waves Choppiness problems � See Tessendorf for more explanation � The distorted grid can actually tangle up (Jacobian has negative determinant - not � Nonlinearities cause real waves to have 1-1 anymore) sharper peaks and flatter troughs than • Can detect this, do stuff (add particles for linear Fourier synthesis gives foam, spray?) � Can manipulate height field to give this � Can’t as easily use superposition of two effect grids to defeat periodicity… (but with a big • Distort grid with (x,z) -> (x,z)+ � D(x,z,t) enough grid and camera position chosen � � 1 K ˆ well, not an issue) � ( ) e � 1 K � x D ( x , t ) = h K , t K K cs533d-winter-2005 11 cs533d-winter-2005 12

  3. Shallow Water Shallow water � Simplified linear analysis before had dispersion relation g c = k tanh kH • For shallow water, kH is small (that is, wave lengths are comparable to depth) • Approximate tanh(x)=x for small x: c = gH � Now wave speed is independent of wave number, but dependent on depth • Waves slow down as they approach the beach cs533d-winter-2005 13 cs533d-winter-2005 14 What does this mean? PDE’s � We see the effect of the bottom � Saving grace: wave speed independent of k means we can solve as a 2D PDE • Submerged objects (H decreased) show up � We’ll derive these “shallow water equations” as places where surface waves pile up on • When we linearize, we’ll get same wave speed each other • Waves pile up on each other (eventually � Going to PDE’s also let’s us handle non-square domains, changing boundaries should break) at the beach • The beach, puddles, … • Waves refract to be parallel to the beach • Objects sticking out of the water (piers, walls, …) with � We can’t use Fourier analysis the right reflections, diffraction, … • Dropping objects in the water cs533d-winter-2005 15 cs533d-winter-2005 16 Kinematic assumptions Conservation of mass � We’ll assume as before water surface is a height field � Integrate over a column of water with cross- y=h(x,z,t) section dA and height h+H � Water bottom is y=-H(x,z,t) • Total mass is � (h+H)dA � Assume water is shallow (H is smaller than wave lengths) • Mass flux around cross-section is and calm (h is much smaller than H) � (h+H)(u,w) • For graphics, can be fairly forgiving about violating this… � Write down the conservation law � On top of this, assume velocity field doesn’t vary much in � In differential form (assuming constant density): the y direction � • u=u(x,z,t), w=w(x,z,t) � t h + H ( ) + � � ( h + H ) u ( ) = 0 • Good approximation since there isn’t room for velocity to vary much in y(otherwise would see disturbances in small length- • Note: switched to 2D so u=(u,w) and � =( � / � x, � / � z) scale features on surface) � Also assume pressure gradient is essentially vertical • Good approximation since p=0 on surface, domain is very thin cs533d-winter-2005 17 cs533d-winter-2005 18

  4. Pressure Conservation of momentum � Look at y-component of momentum equation: � Total momentum in a column: � v = � v v t + u � � v + 1 � p h � ( ) � y = � g + � � 2 v u u h + H � � H � Assume small velocity variation - so dominant � Momentum flux is due to two things: terms are pressure gradient and gravity: • Transport of material at velocity u with its own 1 � p � y = � g � v ) v momentum: h � � ( u u � Boundary condition at water surface is p=0 � H • And applied force due to pressure. Integrate again, so can solve for p: pressure from bottom to top: ( ) p = � g h � y = � g h h 2 � � p � g h � y ( ) ( h + H ) = � H � H 2 cs533d-winter-2005 19 cs533d-winter-2005 20 Pressure on bottom Shallow Water Equations � Not quite done… If the bottom isn’t flat, � Then conservation of momentum is: there’s pressure exerted partly in the � � � t � v � ) + � � � v v ( h + H ) + � g 2 ( h + H ) 2 ( u ( h + H ) u u � � � g ( h + H ) � H = 0 horizontal plane � � � • Note p=0 at free surface, so no net force there � Together with conservation of mass � Normal at bottom is: ( ) n = � H x , � 1, � H z � Integrate x and z components of pn over � � t h + H ( ) + � � ( h + H ) u ( ) = 0 bottom • (normalization of n and cosine rule for area we have the Shallow Water Equations projection cancel each other out) ( ) � H dA � � g h + H cs533d-winter-2005 21 cs533d-winter-2005 22 Note on conservation form Simplifying Conservation of Mass � At least if H=constant, this is a system of � Expand the derivatives: conservation laws � ( h + H ) + u � � ( h + H ) + ( h + H ) � � u = 0 � Without viscosity, “shocks” may develop � t • Discontinuities in solution (need to go to weak integral D ( h + H ) = � ( h + H ) � � u form of equations) Dt • Corresponds to breaking waves - getting steeper and � Label the depth h+H with � : steeper until heightfield assumption breaks down D � Dt = � � � � u � So water depth gets advected around by velocity, but also changes to take into account divergence cs533d-winter-2005 23 cs533d-winter-2005 24

Recommend


More recommend