jbisits / StaircaseShenanigans.jl

Thermohaline staircase Direct Numerical Simulations experiments using Oceananigans.jl
MIT License
1 stars 0 forks source link

Restoring using `restore_tracer_content!` #41

Closed jbisits closed 1 week ago

jbisits commented 3 weeks ago

This Callback was written to keep the tracer content (S and T) relatively constant throughout the course of a single interface diffusive convection setup (done in #40). The design is:

  1. specify some fixed volume of the domain (currently this is hard coded with $z \in (-0.4, 0]$ for the upper layer and $z \in (-Lz, -0.6)$ in the lower layer)
  2. calculate the initial S and T content in each of these layers
  3. as the simulation runs, add any change in tracer content to the top/bottom 10% of the upper/lower layer

The goal is to maintain an approximately constant $R_{\rho}$ value (away from the diffusive interface) to avoid run down in the simulation.

As I was looking at this locally I noticed especially the temperature was sensitive to the frequency of the Callback and that changes in the parameterised diffusivity also had an effect. None of my local tests could achieve high enough resolution to test this properly so I have merged #40 and will keep track of changes/updates/fixes here until I have a better handle on things.

jbisits commented 3 weeks ago

The current implementation

https://github.com/jbisits/StaircaseShenanigans.jl/blob/83c2a2f90cc9243d1523361d95e411fdf139c082/src/staircase_restoring.jl#L109-L138

is not GPU compatible. I have run a DNS experiment on CPU to see how it behaves.

Best might be to move to a ConditionalOperation or refine the Relaxation forcing I have already written so that it relaxes to something that is a bit more like the flux we place in (maybe using tanh)