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

push changes into run in 1d branch #158

Merged
merged 135 commits into from
Oct 10, 2024
Merged

push changes into run in 1d branch #158

merged 135 commits into from
Oct 10, 2024

Conversation

aaronjridley
Copy link
Contributor

Description

We need to be able to run in 1D, so this will allow a testing place for that.

abukowski21 and others added 28 commits September 3, 2024 16:50
Drafted first in python. This code makes plots & is adjustable.

I commented everything so it's hopefully understandable... Reach out with questions.

Similar to SAMI2/3 grid. It's B_par & B_perp aligned, made in dipole (p,q) coords, and specified w/ (nf, nz). Code hands back (r,lat) though, not (q,p) or anything like that...

Code needs to be able to be modified for tilted, offset dipole so I left all the for-loops and didn't spend any time optimizing.
Working. Need to port to init_mag_grid.cpp
Couple issues remain:
- Longitudes are sometimes nan in output files?
- nLats needs to be even. And it's not checked.
- Ghost cells probably not implemented correctly.
Netcdf files can't be ready by xarray (python) when a dimension has the same name as a variable. This is a problem for "z".

Renames all `(x,y,z,time)` -> `(n_x, n_y, n_z, n_time)`

> there are two output_netcdf files. I dont think the other is used?
clean out old comments, improve comments that are gonna be left, refactor a bit.

- Some nan's in lon are removed by changing the transform.cpp. It's not a bug so I included it in this commit.

- Style in transform.coo too.
- not all ionGrid options are used for sphere/dipole grid. I'll add a doc page on this in the next commit...
! I removed the section about passing btwn N/S hemispheres, since that's undecided.
> Probably won't work. But a decent starting point, I hope.

Feel free to revert this commit if it's broken.
Though I could do something clever. It's wasn't. Glad I caught this, geez
## Documentation changes:

- Update description of geographic & dipole grids
- Rearrange `.md` files, complete docs might be easier to generate with this

## test passing

- I found an issue that caused tests to fail. this was a quick fix to the input files. 

## DIPOLE GRID

> big one here

- I rewrote the magnetic grid to be in dipole coordinates. *should* be field-aligned.
- Very similar to SAMI2/3 grid
- Changed inputs, docs, etc. to support this.
[FEAT]: Dipole grid and 1D improvements
- Grid spacing was not exponential, as expected. The issue was with using nZ vs nAlts & is fixed.
unused funcs rm'ed from in init_mag_grid

file for debugging removed from edu/examples/dipole/
- I can't test in 1D since things break in the geographic grid. If the dipole grid is broken in 1D, let me know!

The altitude (along-field-line) ghost cells are treated as standard grid points.
- At low altitudes, points are close enough this is OK.
- At high altitudes, it's going to be hard to get ghost cells.
  - For example, if they extend along the field line, there will be points at +25 Re (L-shell of max_lat)
  - If they are scaled to lower radius, or just not as far along the field line, they will not be perpendicular to B anymore!

> Maybe specify where field lines should be separated btwn open/closed? Then closed field lines will overlap across equator, and open field lines will not be perpendicular to B in the ghost cells? IDK yet!

----

Ghost cells in latitude currently go over the poles. Discussion is happening on whether this is a good idea or not.

---
[BUG]: Fix altitude spacing error in dipole grid
@aaronjridley
Copy link
Contributor Author

lots of NaNs, but that is why I am merging!

@aaronjridley aaronjridley merged commit d2fc24d into run_in_1d Oct 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants