-
Notifications
You must be signed in to change notification settings - Fork 18
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 simple 1D reservoir model #204
base: master
Are you sure you want to change the base?
Conversation
Hi @tbody-cfs |
Accidentally making a copy of the state, rather than getting a reference.
- Deleted commented-out code - Replaced nested loop with BOUT_FOR - Use GET_NOBOUNDARY so that more useful errors are printed if values are modified out of order - Add comments to class, moving some from .cxx to header - Delete unused variables - Run clang-format
Rather than checking `reservoir_region` every time `transform` is called, create a `Region` containing only the cell indices needed.
There is an issue where the final domain cell is seeing an extremely high density source in the last domain cell. Here is a plot near the target which includes guard cells showing the model output and a post-processing calculation which is identical to what's in the code. There is no large energy source there which is bizarre since it should be proportional. However, there is a large pressure source in the first guard cell for whatever reason. The momentum source matches the calculation, unlike energy and density. Again, this is very strange since the momentum source is proportional to the density source: No clue what's going on here. I think I will start by setting the guard cells to 0 in case they are having an impact, but I thought they wouldn't. @bendudson any ideas? |
A major limitation of 1D SOL models is the inability to consider cross-field transport. This is particularly impactful in deep detachment where the neutral pressure can be many times higher than in a comparable 2D model where neutrals can spread across field lines and get pumped out.
This PR adds a simple reservoir model based on the one in DIV1D but a step simpler. The user defines the reservoir location by passing an expression to
reservoir_location
and sets it to a constant density withreservoir_density
. The exchange term for density will be proportional to the difference between the domain density and the reservoir density, and there will be proportional pressure and momentum sinks. In regions where the particle transfer goes in the other direction, new particles will appear with the same pressure and momentum as the local ones.Still trying to work out exactly what DIV1D did but I think they evolve the reservoir density with a domain exchange term as described above plus a pump sink term. This is according to Gijs Derks' MSc thesis and may have changed since then.
The reservoir can be implemented for any species.
If we have evolving reservoirs we need to evolve a scalar. Peter prepared an example: https://github.com/boutproject/BOUT-dev/blob/evolve-scalars/tests/integrated/test-solve-scalar/test_solve_scalar.cxx