As is discused on this post, taking some assumptions, the water surface can be simulated by a discrete aproximation of a grid of heights using this formula

enter image description here


HT is the new height grid

HT-1 is the grid mapped in the previous step of the simulation

N is a damping factor

The 2D simulation works pretty well. I want now to move to 3D, but I'm concerned about the bundary limit conditions.

Unless I'm missing something, the document doesn't explain how to calculate the height on the limits, where there is no x+1 or x-1.

I could mirror the point on the other site as if the boundaries were mirrors, but I'm not sure.

The following image depicts what's described above

enter image description here

  • $\begingroup$ The following depicts what is described above $\endgroup$ – rraallvv Nov 23 '12 at 0:05

It depends on how you want your simulation to behave.

You seem to be describing what's called Periodic boundary conditions.

You might want to extrapolate and use those values in the place of your unknown values.

| cite | improve this answer | |
  • $\begingroup$ As described here, Periodic Boundary Conditions woud cause a particle to pass through the boundaries an reapear on the oposite side, moving in the same direction. I would rather want that particle, or wave in my case, to be reflected back, as a result the wave would move in the opposite direction $\endgroup$ – rraallvv Nov 22 '12 at 23:38
  • $\begingroup$ I added an image as a comment to the question $\endgroup$ – rraallvv Nov 23 '12 at 0:06
  • $\begingroup$ Reflection from a SOFT boundary here is what you want. You need to solve so the derivative is zero at the boundaries. Try to set your x+1 and x-1 to x. If that's not good enough, you need to re-discretize for the boundaries. $\endgroup$ – Roberto Mizzoni Nov 24 '12 at 9:01
  • $\begingroup$ Thanks, ti realy helped me to clarify. It's as if the area below the curve remains a constant, so when the wave reaches the boundary it increases its magnitude. In which case, a good aproximation could be to make x-1 = x on the left boundary and x+1 = x on the right one, but not both, as the wave peak would be very high. $\endgroup$ – rraallvv Nov 24 '12 at 18:20
  • $\begingroup$ Hard boundaries is withouth a doubt the easiest to implement. At every timestep you set the boundary to some constant value, for example to zero. This produces reflections like in your picture. Soft boundaries are a little more realistic since the height of a water surface obeys soft b.c. but hard b.c. show about the same effects. $\endgroup$ – AccidentalTaylorExpansion Oct 23 '19 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.