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

Should we give the option to add background fields to model fields? #93

Open
tomchor opened this issue Nov 28, 2022 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tomchor
Copy link
Owner

tomchor commented Nov 28, 2022

We already do that in some diagnostics by default like

if model isa NonhydrostaticModel
if ~(model.background_fields.velocities.u isa Oceananigans.Fields.ZeroField)
u += model.background_fields.velocities.u
end
if ~(model.background_fields.velocities.v isa Oceananigans.Fields.ZeroField)
v += model.background_fields.velocities.v
end
if ~(model.background_fields.velocities.w isa Oceananigans.Fields.ZeroField)
w += model.background_fields.velocities.w
end
if ~(model.background_fields.tracers.b isa Oceananigans.Fields.ZeroField)
b += model.background_fields.tracers.b
end
end

I think it's a useful feature, but maybe it shouldn't be applied to all cases. For example in an Eady-like set-up, where the domain is horizontally periodic and the velocity has a background gradient this will create discontinuity in x and/or y if the velocity gradient is implemented as a background velocity. So maybe this should be an opt-in feature in the diagnostics.

@tomchor tomchor added enhancement New feature or request good first issue Good for newcomers labels Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant