1D Shallow Water Wave in FORTRAN using LAX WENDROFF Method

In summary, the code uses a half-time step and needs an appropriate 'reflective boundary condition' at the wall to simulate the reflection of the shallow water wave.
  • #1
Aun Muhammad
14
0
Hey everyone,

I’m trying to simulate a 1D Shallow Water wave in FORTRAN using the Lax Wendroff Method. The case is fairly simple. I have a wave generator on one end of a water pool and a wall boundary on another. The waves start traveling towards the wall and are ‘reflected off’ the wall. The problem which I’m facing is the Boundary Condition on the wall.

My generated wave starts traveling towards the wall and once it reaches the wall, my solution crashes. I need an appropriate ‘reflective boundary condition’ at the wall. As you guys already know, the Lax Wendroff Method employs a half time step. The governing PDE’s are attached in the image. The discretised equations are also attached.

Since h and A are the unknowns we are dealing with, I need the following BC at the wall:

HNP102(1)=? !1/2 Time Step, denotes n
ANP102(1)=? !plus half

and

HNP1(1)=? !full time step, denotes n
ANP1(1)=? !plus 1.

I read a similar code where
HNP1(1)=HNP1(2)
ANP1(1)=ANP1(2) was used but in my case it did not work.
 

Attachments

  • D2B028C8-4DF8-44DA-820C-B19CC329FA90.jpeg
    D2B028C8-4DF8-44DA-820C-B19CC329FA90.jpeg
    13.6 KB · Views: 495
  • F53685CF-7C30-41A0-9F81-6FC8812BB6CB.jpeg
    F53685CF-7C30-41A0-9F81-6FC8812BB6CB.jpeg
    13.6 KB · Views: 561
Technology news on Phys.org
  • #2
What is your question?
 
  • #3
The question is that what must be an appropriate 'reflective boundary condition' at the wall to simulate the reflection of the shallow water wave?
 
  • #4
Aun Muhammad said:
Since h and A are the unknowns we are dealing with, I need the following BC at the wall:

HNP102(1)=? !1/2 Time Step, denotes n
ANP102(1)=? !plus half

and

HNP1(1)=? !full time step, denotes n
ANP1(1)=? !plus 1.

I read a similar code where
HNP1(1)=HNP1(2)
ANP1(1)=ANP1(2) was used but in my case it did not work.
This isn't very explanatory -- we have no idea what HNP102, ANP102, HNP1 and ANP1 are supposed to represent. In addition, the text in the two images you posted is too small to be legible, so those images aren't much help, either.

The behavior of a wave when it hits a reflecting surface depends on the number of wavelengths between the wave source and the reflecting surface. If the distance between source and reflector is an integral number of half-wavelengths, the reflecting wave will be out of phase with the following incoming wave, producing destructive wave interference. If the incoming wave hits the reflector at a high or low point, the reflection produces constructive reinforcement, resulting in a wave with twice the amplitude. It's been a long while since I've thought about this stuff, so I believe my explanation is correct.
 

1. What is a 1D shallow water wave?

A 1D shallow water wave is a type of wave that occurs in a body of water that is shallow compared to the wavelength of the wave. It can be described by a single horizontal dimension and is commonly used in oceanography and coastal engineering studies.

2. What is FORTRAN?

FORTRAN (FORmula TRANslation) is a high-level programming language that is commonly used for scientific and engineering applications. It was developed in the 1950s and is still widely used today for its efficiency and powerful mathematical capabilities.

3. What is the LAX WENDROFF method?

The LAX WENDROFF method is a numerical method used to solve partial differential equations, such as the 1D shallow water wave equation. It is a second-order accurate method that uses a combination of the forward and backward difference approximations to calculate the solution at each time step.

4. How is the LAX WENDROFF method implemented in FORTRAN?

The LAX WENDROFF method can be implemented in FORTRAN by first discretizing the partial differential equation into a set of algebraic equations. These equations can then be solved using the LAX WENDROFF method, which involves calculating the solution at each time step using a combination of the previous and current time steps.

5. What are the advantages of using FORTRAN and the LAX WENDROFF method for simulating 1D shallow water waves?

FORTRAN and the LAX WENDROFF method are both well-suited for simulating 1D shallow water waves due to their efficiency and accuracy. FORTRAN's powerful mathematical capabilities make it ideal for solving complex equations, while the LAX WENDROFF method is a stable and accurate numerical method for solving partial differential equations. Using these tools can help scientists accurately simulate and study 1D shallow water waves in a timely manner.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
634
Replies
1
Views
1K
Replies
7
Views
1K
Replies
2
Views
966
Replies
14
Views
2K
Replies
1
Views
1K
Replies
1
Views
480
Replies
4
Views
3K
Back
Top