glwagner / WaveTransmittedTurbulence.jl

Near-inertial waves and turbulence driven by the growth of surface waves
7 stars 3 forks source link

Error running WaveTransmittedTurbulence.jl with julia 1.9.3 #1

Open Swarnali-D opened 1 week ago

Swarnali-D commented 1 week ago

I am trying to reproduce the figures of WaveTransmittedTurbulence.jl in julia version 1.9.3 On running julia --project -e 'using Pkg; Pkg.instantiate()', I am met with an error :

┌ Warning: The active manifest file is an older format with no julia version entry. Dependencies may have been resolved with a different julia version. └ @ ~/WaveTransmittedTurbulence/Manifest.toml:0 ERROR: Could not locate the source code for the DelimitedFiles package. Are you trying to use a manifest generated by a different version of Julia?

How do I overcome this? Or is there any other way I can run the simulations?

glwagner commented 1 week ago

The first thing to try is to delete the Manifest and instantiate again.

glwagner commented 1 week ago

Unfortunately there are no compat entries and this will surely fail.

glwagner commented 1 week ago

You can try this PR:

https://github.com/glwagner/WaveTransmittedTurbulence.jl/pull/2

I added a compat entry and deleted the Manifest.

Can I ask your intent / goals? That will help us understand what to do about it. If you need the precise scientific results for some reason, we have to reproduce the setup. If you just want the general idea / setup, it's better to start with a fresh script in fact, because this is not very challenge to reproduce. Also it depends which simulation you want to reproduce. One of them is maintained as an example in Oceananigans.

Swarnali-D commented 1 week ago

I tried to run the example code in Oceananigans and tried to see if the figures matches with the resting cases of figure 7 of your article. It does not. So I want to run this repository and see if I'm able to reproduce the results. I want to reproduce the steady wave case, it would be helpful if you can tell me what's the difference in the Oceananigans code and the repository code that was not able to match the plots.

glwagner commented 6 days ago

The main difference is the resolution. Can you tell me if you used the example at its given resolution, or whether you increased the resolution to match the paper?

The numerics may also differ --- check the advection scheme and turbulence closure. I'll take a look when I can.

Swarnali-D commented 6 days ago

I gave a resolution of 256^3. advection= WENO() closure = AnisotropicMinimumDissipation()

In the Oceananigans example, there is no sponge layer, whereas in your article there is a sponge layer as far as I have understood. Can this be one of the reasons?

glwagner commented 5 days ago

Hmm. The sponge layer could matter but I think the effect should be pretty minor. More important perhaps is that the paper uses advection = Centered(order=2). You can also try running with closure=nothing and advection=WENO(order=9). advection=WENO() defaults to 5th order which is quite diffusive.

Can you be specific or provide a plot showing how your simulation differs from the paper?

Swarnali-D commented 5 days ago

Thank you for providing me with the used advection scheme. I can try with closure=nothing but the paper uses closure=AnisotropicMinimumDissipation, I just want to try the exact model parameters.

w_variance speed gradB buoyancy

glwagner commented 5 days ago

Ah! Check the initial buoyancy profile. They are different.

glwagner commented 5 days ago

Ok there are two things. First, in the plot you shared it seems there is a discrepancy in the initial buoyancy gradient. Second, the example has an initial mixed layer whereas the epaper case does not. Can you try fixing these two things and see what happens?

Swarnali-D commented 4 days ago

The buoyancy parameters in the example (which I used) are:

Qᵇ = 2.307e-8 # m² s⁻³, surface buoyancy flux
N² = 1.936e-5 # s⁻², initial and bottom buoyancy gradient

And the paper has these parameters: Screenshot from 2024-09-14 11-15-24 Am I right? I just noticed that the paper doesn't have an initial mixed layer, I will fix that. But why did you include that in the example? Also, you did a spin up simulation which created a mixed layer of z=-8m, didn't you use this as initial condition for the resting case?

glwagner commented 2 days ago

An initial mixed layer helps speed up the simulation. It's not a bad idea to use that in general. The paper and example have different goals.

glwagner commented 2 days ago

The spin up simulation is only used for the first part of Wagner et al. 2021

glwagner commented 2 days ago

As for the buoyancy profile, the point is just that the buoyancy profile below the mixed layer is different between the two simulations. Since this part of the domain shouldn't change it has to mean the initial condition is different. I'm not sure how you make that plot though.