-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wall boundary condition experiment #181
Conversation
…likely to fail due to sqrt(-1) if potential ever reverses gradient in a fluctuation.
…ure of ion phase space to justify using the vcut feature only if deltaphi has the correct sign. epsz is a parameter that would vary from 0 (vcut=0) to 1 (vcut corresponds to particles that reverse at the first grid point from the wall). Remarkably, this feature shows that the pdf at the wall is barely or not at all resolved for slow particles, because with vcut = 1, a significant part of the distribution function is set to zero.
…on_parameters] toml list.
Some figures demonstrating the potential usefulness of this feature for making sure that the kinetic-Chodura condition is satisfied without disturbing much the form or scaling of the potential with distance to the wall target (numerical dissipation in vpa only, not a full Fokker-Planck case). Generalising this cut-off to moment-kinetic or 2D cases is still left to be done. This feature may be useful for physical studies with the correct Fokker-Planck collision operator. |
This reduces the number of function arguments that are needed overall, so keeps the code slightly simpler.
I'm wanting to try playing with this feature now, so I've merged in master. I thought it would be easier to merge if we store the boundary condition parameters within the |
On balance I think I preferred my way. I think that putting the data in coordinate structs will force duplication of parameters, because every coordinate now will have this struct of data even if it is never used for anything (like in the initial conditions structs, where parameters that made sense for the spatial initialisation are also specified for the velocity initialisation, even if they are not used). In addition, if we just have the one parameter for now, making an extra name list that then gets put into coordinates struct seems like overkill when you could have just added an extra parameter to the coordinate inputs. I would rather store data according to theme (having the data in the boundary distributions struct, e.g.), and read the name list in from the boundary_conditions module. As the boundary distributions struct is already used in boundary_conditions.jl, I would hope that not too many extra arguments would need passing. I can see why you want to go this way, and if you are taking ownership of the feature and strongly disagree with my points above I won't stop you : ). If we want to add similar features as this elsewhere, porting this to the boundary_conditions module might be something that I would want to do. EDIT: I imagine examples of future parameter features would mostly be connected with how radial boundaries are treated, having a Maxwellian upstream and parameters to mimic the damping towards a vacuum downstream. |
P.s. publication_inputs/xarray_post_processing/plot_wall.py from https://github.com/mabarnes/moment_kinetics/pull/228/files#diff-0768e749529d60b8847e50149f1e15df02852fc44d787e0b9f4cb0c51d587fe9 is the python script used to produce the .pdf plots of the |
I see your point. When I started converting, I hadn't realised that the PS I've set it up so that extra parameters (only |
The conservative option of keeping I say this partly because the coordinate inputs are still open to be refactored #241 into namelists, and partly because boundary condition options are potentially logically separate from the number and location of grid points to use (except in the finite difference method perhaps?). Perhaps we cannot reasonably take I am arguing for the conservative option of not changing |
I'd think of boundary conditions as logically related to the I'm not against refactoring the coordinates input now to keep things simple. I think the only arguments that should be needed would be an foo_input = OptionsDict("foo" => OptionsDict("ngrid" => 5, "nelement" => 10))
define_coordinate(foo_input, "foo") which would be simpler than it is at the moment because you could leave default values for options that you don't care about. That refactor should probably be a separate PR, which we could then merge into this one (possibly via master). I'll make one and put it up as a proposal. |
I suppose that I have to agree that information like "periodic" or "wall" or "none" is linked to the coordinate information in the way that the code in formulated, but I am not sure if very detailed information about distribution functions or numerical method choices (like |
@johnomotani Just left a comment in #241 pointing out a potential problem with the below approach.
|
7eb766c
to
124cc56
Compare
bzed is now a 2D variable, not a scalar.
In runs that do not use a Boltzmann electron response, the electron temperature is not just a constant.
The 'Chodura condition' is often not satisfied. By zero-ing out enough grid points near v_parallel=0, eventually we would get a distribution function at the wall that would satisfy the condition. Add an option to calculate how many grid points this would be.
The line shown by the cutoff is the vpa value that, if we integrated f/vpa^2 only up to there, the result would obey the Chodura condition.
124cc56
to
9d40d8d
Compare
I think this feature is useful to have as an option. I also added some extensions to the post-processing in makie_post_processing that can show how far along in vpa we would have had to zero out |
Pull request for experimental feature for modifying the wall boundary condition.