amr-wind
amr-wind copied to clipboard
Time varying abl bodyforce
Summary
This PR adds 2 features that work together: the ability to output the ABL forcing values to a text file and the ability to read in forces from a text file to apply uniformly using BodyForce.
Pull request type
Please check the type of change your PR introduces:
- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):
Checklist
The following should accompany this PR:
- [x] new unit-test(s)
- [x] new regression test(s) pass
- [x] documentation for new capability
This PR was tested by running:
- the unit tests
- [ ] on GPU
- [ ] on CPU
- the regression tests
- [ ] on GPU
- [ ] on CPU
Additional background
This feature is well suited to be used with velocity timetable, but it does not have to be. It can be used independently. Likewise, the body force feature can be used with a text file that has been set up manually or through another means; it does not have to come from an ABL Forcing output.
Issue Number: #1022
Just getting this out there for now, but it does need unit tests and documentation
Should this PR also include a forcing timetable output from Geostrophic Forcing? I know that some ABL precursors use Geostrophic Forcing instead of ABL Forcing.
Yes, having time-varying geostrophic wind would be useful too. I think just a general code class that handles time tables and interpolates within them in time would be handy. Eliot's pull request from earlier this year does this for arbitrary time-height varying forcing, so maybe you can draw upon that instead of duplicating. What I don't like about Eliot's code is that it has to read in a netcdf input file. The input can get sort of large because it might be a full day's worth time history of an evolving height profile, so netcdf is good, I suppose, but you can't just open up a netcdf file in a text editor and look at it and modify it, and the size of data is really not that big in the grand scheme of things.
I added the same text file output for Geostrophic Forcing, but it looks like it doesn't need that. Unlike ABL forcing, Geostrophic Forcing should be reproducible in an inflow-outflow sim because it's not based on the current velocities of a sim.
With documentation now added, I think that the only thing remaining is unit tests.