-
Notifications
You must be signed in to change notification settings - Fork 10
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
Relaxation #40
Open
phuslage
wants to merge
94
commits into
bendudson:fci-bd
Choose a base branch
from
phuslage:relaxation
base: fci-bd
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Relaxation #40
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Versions of Hypnotoad newer than 1.1.3 generate output that can take into account whether "shifted" or "identity" parallel transforms are used. The option should be set to generate a grid file for "shifted" to be compatible with Hermes. In this case the curvature vector is generated by Hypnotoad with no contribution from integrated shear, so the correction applied by Hermes to remove the integrated shear contribution from the curvature vector should be skipped. This commit adds a check of the "parallel_transform" variable in the grid file (if not present indicates that an old enough version of Hypnotoad was used that the correction is needed), and applies the correction if the grid file was generated for 'parallel_transform == "identity"', skips it if 'parallel_transform == "shifted"' and throws an exception due to an unrecognized value for 'parallel_transform' otherwise.
Used dx rather than dy to calculate diffusion and viscosity.
Index used in g_22 term.
Copied over from diffusion2d neutral model.
…hypnotoad-compatibility Add check for gridfile generated by new versions of Hypnotoad
Check coordinate system of input
Include diffusion of NVn in preconditioner
Thanks to S.Mordijck for the fix.
Master neutral precon
Newer grid files use "shiftedmetric" rather than "shifted". Now allows either in check for compatible grid files. Thanks to @wphu for the fix Fixes issue bendudson#12
Sets a minimum density to be used in the sheath boundary conditions.
Add option nesheath_floor
Other sources zeroed, but Spi was not.
The original switch, adapt_sources, now provides the default value for two new switches: adapt_source_p and adapt_source_n
If temperature varies across the domain, this can lead to electric fields along the boundary, and so radial ExB flows through the boundary. This fix sets the radial boundary to the Z average (DC).
Another way to avoid negative densities/pressures, by extrapolating the logarithm of density and pressure.
Should set zero gradient boundary condition on phi.
- Remove averaging in Y, except in the core closed field-line region. - Add a switch radial_core_averagey to turn on/off this averaging in the core - Modify treatment of NVi to be similar to the other fields, rather than damping to zero.
Prevent atomicpp.a being checked in accidentally.
Thanks @hahahasan ! Accidentally using Vort rather than NVi in outer boundary.
Catch problems in future if new sheath models are added but heat flux code is not updated.
Should be Neumann boundary condition, was set to tesheath. In most cases this should be the same, but not when te gets very low.
Fixes for boundary conditions
Similar to what is used in STORM, relax the radial boundary value of phi towards zero-gradient on a given timescale.
When the boundary is modified, the `phi_boundary_last_update` time needs to be set.
The INVERT_SET flag takes the value from the guard cell, then sets this value on the boundary between cells. This results in an unstable solution if the guard cells are then put back in as the new boundary value. With this fix, the old value of the boundary is taken from the midpoint, and then put into the guard cell. Hopefully this is consistent with how the value is used in the Laplacian inversion.
- Need to move phi boundary values from cell midpoint to boundary cell every time the solver is called. - Need to include Pi in the solve, because Pi is subtracted from the result (Boussinesq approximation)
I don't think this should be necessary, but it seems to be. Without setting phi in the outermost boundary cells (+2, -2) the time advance eventually fails to converge. When this failure occurs all fields seem to be well behaved except these outer boundary cells which contain large (1e200) values. With this change no such failures seem to happen (so far)
Merge settings with tokamak/2-currents
- Time stepping stability issues. Restricting CVODE to low order or it tends to crash eventually and then restart ok - Relaxing phi on both boundaries - Boundary relaxation regions on both radial boundaries
Loosely based on LAPD parameters
An input power of about 1.7 kW. Seems to settle on densities about 5e17 m^-3 and electron temperature about 3eV.
Integrates the sources over the domain, printing in SI units.
Hopefully fixes Github formatting.
Previous input went to steady state with no fluctuations. This change makes the sources more peaked, and results in growing modes then saturated fluctuations.
Enables simulations to be run from inside that directory.
Seems to be enough to stabilise turbulent stage of the simulation.
Examples, analysis script
Sets zero-gradient on temperature. Now using the same method as in sheath model 1.
Determines when the sheath current should be turned off as unphysical. If nesheath_floor is larger than 1e-10 then this condition would never be true.
Use the larger of the Alfven speed or electron sound speed, capped at an upper limit of 100x reference, or light speed in vacuum. This stabilises parallel zig-zags seen near the target in low density, low pressure regions.
If Pe is floored to a non-zero value in these terms, then energy can continue to be extracted from a zero (or negative) pressure region.
Almost never what is wanted, so shouldn't be true by default. Added some documentation.
Sheath fixes/improvements
Modify ramp_mesh to be false by default
Increase characteristic wave speed
Missing parameter in help message. Now using f-string.
Script to set profiles in tokamak grid files.
Explain what the profiles are used for, and how to set them using the script.
Tokamak scripts
Make 2D plots, plots along the targets, and volume integrals
Add analysis and plotting scripts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A new branch for implementing a relaxation method to obtain phi in a steady state solution