Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the Sine Channel analytical solution #88

Open
ChrisBarker-NOAA opened this issue Aug 21, 2024 · 2 comments
Open

Correct the Sine Channel analytical solution #88

ChrisBarker-NOAA opened this issue Aug 21, 2024 · 2 comments

Comments

@ChrisBarker-NOAA
Copy link
Contributor

In gen_analytical_datasets, there is:

def gen_sinusoid(filename=None)

however, it has:

vx = np.ones_like(x)
vy = np.cos(x / 2) / 2

which makes the y -direction velocity constant -- which is almost a sinusoidal flow, but not quite parallell to the chennel.

It should have a constant magnitude, the the y component should also change sinusoidally (out of phase).

Somethign like this:

# Create the velocity flow
V = 3
xv = np.linspace(0, 1, 10)
yv = A * np.sin(xv * 2 * np.pi / L)

#constant velocity in the x direction == not quite right

v =  V * A * (2 * np.pi / L) * np.cos(xv * 2 * np.pi / L)
# v = vA / 10 * np.ones_like(xv)
# vx = vA * np.ones_like(xv)
# vx = 3 + 0.01* vA * np.sin(xv * 2 * np.pi / L)
u = np.sqrt(V**2 - v**2)

theta = np.arctan(A * (2 * np.pi / L) * np.cos(xv * 2 * np.pi / L))
u = V * np.cos(theta)
v = V * np.sin(theta)
@jay-hennen
Copy link
Contributor

Are you sure this is still correct when we take the sinusoidal shape of the grid into account plus the 'angle' variable? Actually when I look at this again it appears the mistake is actually that vy should be zero. That's how it would appear in a 'normal' sgrid file right?

If you want to put this math in feel free. At the moment the sinusoid file is only used in loading tests; the data within is actually never used. Of course it should still be a 'correct' file!

@ChrisBarker-NOAA
Copy link
Contributor Author

ChrisBarker-NOAA commented Aug 21, 2024

well, it depends on the goal, but if we want a uniform flow parallel to the sides, it's needs adjustment -- this came up when someone was testing a new interpolation method.

i put in the issue so I wouldn't forget ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants