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

Document the fact that you can pass a Tuple as closure to models #1879

Open
tomchor opened this issue Jul 20, 2021 · 9 comments
Open

Document the fact that you can pass a Tuple as closure to models #1879

tomchor opened this issue Jul 20, 2021 · 9 comments
Labels
documentation 📜 The sacred scrolls

Comments

@tomchor
Copy link
Collaborator

tomchor commented Jul 20, 2021

I couldn't find any page in docs that explains that the models can take a tuple of closures. I guess it should be here?

PS:

@tomchor tomchor added the documentation 📜 The sacred scrolls label Jul 20, 2021
@glwagner
Copy link
Member

There's no real validation of this feature, so it wasn't added to the docs.

Perhaps you can come up with a nice validation experiment that we can use to gain confidence that it works correctly, and then add some documentation?

@tomchor
Copy link
Collaborator Author

tomchor commented Jul 20, 2021

Ah, I see. I thought it was validated.

Perhaps you can come up with a nice validation experiment that we can use to gain confidence that it works correctly, and then add some documentation?

It's hard for me to come up with a validation experiment for that I think. Are we testing that the viscosities are calculated and added correctly? (Thus a simple analytical example might suffice or an example where we just add two constant diffusities.) Or are we testing that the interface is working?

@glwagner
Copy link
Member

You could use two AnisotropicDiffusivity closures (or 3?) that individually set the diffusivities in each direction. Then you can test that a model which uses a single closure with all three diffusivities returns the same result as a model with a 3-tuple of different closures. That actually might be good enough for a bona fide test, not just a validation.

@glwagner
Copy link
Member

I'm thinking of an integration test that tests the whole pipeline: use of a 3-tuple when constructing a model, test that time-stepping works without an error, and test that the output is correct.

It's probably easier to compare two models than to compare one model to an analytical solution. Comparison to an analytical solution is tricky, usually we have to invoke an arbitrary tolerance.

@tomchor
Copy link
Collaborator Author

tomchor commented Jul 20, 2021

It's probably easier to compare two models than to compare one model to an analytical solution. Comparison to an analytical solution is tricky, usually we have to invoke an arbitrary tolerance.

Good point.

Adding 3 separate constant diffusivities is a good idea, but it wouldn't test any LES closures (where the fields have to actually be computed). Do you think that'd be necessary?

Another possibility is to compare a model with closure=SmagorisnkyLilly(ν=1e-6, κ=1e-7) against a model with closure=(SmagorisnkyLilly(ν=0, κ=0), IsotropicDiffusivity(ν=1e-6, κ=1e-7). Those should be equivalent, no?

@glwagner
Copy link
Member

That's a good test too! Might be nice to do both tests in fact.

@tomchor
Copy link
Collaborator Author

tomchor commented Jul 20, 2021

Any suggestion as to where the tests would go?

@glwagner
Copy link
Member

@glwagner
Copy link
Member

glwagner commented Jul 21, 2021

Also I think just doing the proposed test with a mix of LES closure and IsotropicDiffusivity is just fine. I think we can be reasonably confident the infrastructure works with that one test.

I think we should also run the tests for different mixes of time_discretization. The infrastructure is supposed to work generally (so it should be valid to use ExplicitTimeDiscretization for both, VerticallyImplicitTimeDiscretization for both, or a mix). But we can collaborate on expanding the test to those cases once the basic comparison between the two simulations is in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📜 The sacred scrolls
Projects
None yet
Development

No branches or pull requests

2 participants