-
Notifications
You must be signed in to change notification settings - Fork 21
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
Non-zero CO2 surface flux for an ocean in equilibrium (with non-zero average wind speed) #197
Comments
Hi @ali-ramadhan, thank you for raising this issue! I've had a look and am pretty sure this is because the grid is flat, so when Oceananigans calls OceanBioME.jl/src/Boundaries/gasexchange.jl Lines 223 to 232 in 4bcaf29
I tried running your code with y periodic and it appears to be correct. Currently, I'm doing a lot of work on the gas exchange model because I've discovered a few issues with how I originally implemented it, and following that PR (#186) it will be more sophisticated and better tested. This situation would also cause an issue with the refactored code so I'll work out how to fix it there. For now, the best thing is probably to only use 3D grids I think. |
Thanks for having a look @jagoosw! Tricky dispatch haha. It does work with a 3D grid and I was able to hack in a boundary condition wrapper for 2D grids. gas_exchange = GasExchange(;
gas = :CO₂,
air_concentration = pCO₂_atmosphere
)
@inline CO₂_flux(x, t, DIC, Alk, T, S, ge) = ge.condition.func(x, 0, t, DIC, Alk, T, S)
DIC_top_bc = FluxBoundaryCondition(CO₂_flux, field_dependencies = (:DIC, :Alk, :T, :S), parameters = gas_exchange) Out of curiousity, do you know why it works correctly when |
Just to chime in --- I recommend using the discrete form in packages that build out functionality for Oceananigans. That should avoid the issues that occur when trying to write generic code for |
The flux is like |
Thank you everyone for the super nice package (especially @jagoosw)! I know everything is still in development with lots of changes happening.
I've been playing around with LOBSTER (well, really just the carbonate chemistry component) and the air-sea gas exchange model. I'm just initializing an ocean at equilibrium with constant T, S, DIC, and Alk. I set the atmospheric pCO2 equal to the ocean's pCO2. I expect a surface CO2 flux of zero. I see this but only when
average_wind_speed = 0
.When
average_wind_speed = 10.0
(the default) I believe the flux should still be zero since pCO2 is equal across the air-ocean interface but it's slightly negative after one time step. It's zero at time step 0.Is this behavior expected or am I misunderstanding the gas exchange model?
Thank you!
Here's a minimal working example to showcase what I'm seeing:
Time step 0:
Time step 1:
I'm using Julia 1.10.4 with
The text was updated successfully, but these errors were encountered: