-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add background flow functionality in SingleLayerQG
model
#359
Comments
How about:
We can discuss here how you'd go about and do it if you like. |
This sounds ideal, yes please! I have no experience contributing to projects that aren't mine so any help would be greatly appreciated. |
Sure. What you would like help with? Github-wise: You first you need to fork the repo, create a branch, modify the source code (as if it was your code!) and then submit a pull request... Or you want to discuss what/where exactly to modify the module? |
SingleLayerQG
model
Thanks, this pretty much answered my question; which was 'do I need to create my own fork to do pull requests'. I've now created the fork, and unless I've missed something, I think the required changes have been made. Will test later today and submit a pull request if it works. |
changes added and tested and pull request submitted |
Questions:
|
Yes, my goal was to add a constant flow U, I figured U(y) was already implemented in the multi-layer module which could presumably be run with 1 layer so this was unnecessary. Specifically, I wanted to add the term You're correct that this is just a Galilean transformation. However, my goal is to simulate travelling vortices (such as the Lamb vortex you have implemented in By 'tested' I mean that I have created a new julia enviroment and added my forked version of |
Would U(y) need to be periodic for this to work? (Or perhaps dU/dy?) One test is to make sure the code runs without erroring. Another is to test correctness, ie use some metric + simulation to show that If there's no test it could easily break without anyone knowing, so it's in your interest to add a test to make sure your code continues to work in the future |
@mncrowe thanks for the elaboration. Fair enough for the constant U. However, regarding testing we would need something more than taking your word for it. I mean, not that we don't believe you, but it's good if we have something in the test suite of the repo that uses the functionality you added and tests that the results as what being expected. This way, we would have a way to catch a potential bug introduced in the future. E.g., for the |
@navidcy I would just add that the test is actually most important to make sure the code keeps working in the future. I think if we manually verify the code works now, I think we can conclude that it does indeed work. The issue isn't figuring out whether the code works now. The thing we are actually trying to achieve with CI is to ensure that the code continues to work in the future as new PRs come in. |
Just to add another thought about this, would it make sense to have a test comparing results between
And about this, I wonder if it would be helpful to use multiple dispatch to put the background flow in the linear operator if |
Yeah for sure or just an |
Agreed, will have a look at adding non-constant U to the nonlinear operator. Regarding tests; how do I add them here and how can I locate the pre-existing ones to ensure I use a consistent approach? |
The tests are all in this file: https://github.com/FourierFlows/GeophysicalFlows.jl/blob/main/test/test_singlelayerqg.jl |
For consistency with the rest of the package, how would you prefer this Also, would you prefer multiple |
if U isa Number
# add to linear operator
else
# add to nonlinear RHS
end |
Hi,
I'm looking to add a constant background flow into the single layer model in order to study steadily propagating features. This is equivalent to adding
im * params.C * grid.kr
to the linear operatorL
for speedC
in the x-direction. My options seem to be:β
term) dealt with in the linear term for stability etc.SingleLayerQG
. This seems straightforward enough as it's just addingC
to the various functions and structures and adding the extra term intoEquation
. However, I'm not familiar with creating modules so am not sure how to load this without modifying GeophyiscalFlows.jl directly.SingleLayerQG
to include this functionality.What would you suggest?
Thanks,
Matt
The text was updated successfully, but these errors were encountered: