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

TemperatureBuoyancy for evolving temperature without salinity #581

Closed
ali-ramadhan opened this issue Dec 19, 2019 · 2 comments · Fixed by #595
Closed

TemperatureBuoyancy for evolving temperature without salinity #581

ali-ramadhan opened this issue Dec 19, 2019 · 2 comments · Fixed by #595
Labels
feature 🌟 Something new and shiny

Comments

@ali-ramadhan
Copy link
Member

Would be useful to speed up simulations that use temperature but not salinity.

Should be easy to implement now that we have arbitrary tracers.

@ali-ramadhan ali-ramadhan added the feature 🌟 Something new and shiny label Dec 19, 2019
@glwagner
Copy link
Member

A thought:

A different design would extend SeawaterBuoyancy with two types that specify whether temperature and salinity are present:

struct SeawaterBuoyancy{FT, EOS, T, S} <: AbstractBuoyancy{EOS}
    gravitational_acceleration :: FT
    equation_of_state :: EOS
end

and

function SeawaterBuoyancy(FT=Float64;
                          gravitational_acceleration = g_Earth,
                          equation_of_state = LinearEquationOfState(FT)
                          with_temperature = true, with_salinity = true
)
    return SeawaterBuoyancy{FT, typeof(equation_of_state), with_temperature, with_salinity}(gravitational_acceleration, equation_of_state)
end

We can then dispatch on those types when calculating buoyancy.

Slightly less code this way, but perhaps the complexity isn't worth it.

@glwagner
Copy link
Member

glwagner commented Jan 8, 2020

Looking at the issue again, I'm liking the solution I've proposed because I think it's easier to understand for users. Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🌟 Something new and shiny
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants