-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adding bpar to stella, explicit and implicit algorithms #129
Conversation
…, example input files, etc. appropriately.
…he code would function properly even if they are specified. ultimately, we should remove these variables.
…p to make it easier to see what is happening and to make targeted changes.
…ntains apar as well as phi).
…g rather than gbar
…. further changes need to be made to implicit_solve to calculate the apar source terms associated with unit impulse in apar.
…ar. still need to add apar code to implicit_solve and test everything.
…es. currently produces unphysical behaviour so need to debug.
…so added apar treatment of explicit mirror advance, but not tested.
…d use of include_apar = T for explicit solve, with the exception of wstar term.
…steps rather than gbar; this required removal of a gbar_to_g call in implicit_solve.f90
@mabarnes @GeorgiaActon The last commits add the bpar contribution to the particle and heat fluxes, but the contribution to the perpendicular part of the momentum flux is not included. To support this stella would need to have the Bessel function d J'_1(x) /d x = (1/2) (J0(x) - J2(x)). |
Notes on numerical instability:
|
A further note that all of these experiments were done with |
…ery basic features of only plotting phi2, apar2, bpar2, and the fluxes.
…se the os module to automatically obtain the absolute path.
…user the ability to specify at command line the minimum t (in vref/lref) for the start of the time averaging.
An additional note: Examining the collisionless_mtm_implicit.zip example above, using Another check for the instability: turning off the drifts with
removes the time step restraint from the automatic CFL condition and appears to give a stable simulation for the nominal time step (the automatic CFL otherwise reduces the timestep size to 1.0e-3 from 1.0e-2 in the input file). |
…t throughout the netcdf file. Note that some variables still do not have units.
…hecks of definition of phi2 and fluxes
… flx_vs_kxky -> and the sum (weighted by mode_fac) of flx_vs_kxky is equal to the corresponding flx. This gives flx_vs_kxkyz a clear physical meaning as the contribution to the flux from the volume around the point in z. This improves testability of the diagnostics.
@Scottyujia @mabarnes I have just noticed that the perpendicular flow shear terms connected to |
…t segmentation fault.
…ort simulation if fapar > -1 or fbpar > -1 are set in the input. May fix #130.
… numpy error. "AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead".
example_nonlinear_phiaparbpar_2.zip
and taking ~1.5 CPU hrs to execute on 16 cores (5.60 mins). Perhaps suitable for "long" automatic tests. Plots are made with
|
This pull request is intended to deliver a fully functional implementation of the explicit and implicit algorithms using all three fields, phi, apar, and bpar. Starting from the development/apar2 branch where apar is included by introducing the distribution function
gbar = g + 2 (Zs/Ts) vths vpa J0 apar
, andg = h - Zs J0 phi / Ts
, we include bpar. Bpar is included by modifyingg
tog = h - (Zs/Ts)(J0 phi + 4 (J1/bs) mu (Ts/Zs) bpar)
.For the explicit algorithm standard flux tube features are supported (tested linear, collisionless simulations).
For the implicit algorithm collisionless features are supported (tested linear, and nonlinear collisionless simulations).
Initial low-resolution nonlinear simulations have been performed with promising results (no blow-up!).
Linear, collisionless, benchmarks have been carried out against GS2 for an ITG and a KBM example.
Not supported
perpendicular flow shear for simulations with A|| (The implicit implementation of perpendicular flow shear acts on g, not gbar, meaning that there are (potentially, probably) missing flow-shear terms involving A||). B|| terms are included in the evolved g in the implicit algorithm so there are no missing flow shear terms for B||
radial variation
full flux surface
implicit collisions
driftkinetic_implicit
neoclassical terms
in-code comments: many places refer to g as g = < f >, which is no longer true.
Support the implicit algorithm for flow shear and A||
Support the implicit algorithm for collisions.
Provide electromagnetic fluxes in the diagnostics (are separate variables preferred, or should the existing flux be upgraded to the total one? @mabarnes @GeorgiaActon)
Provide in-code documentation.
Provide benchmarks and report documentation.
(Optional extra) Support neoclassical terms for apar and bpar (@mabarnes where are the equations written down?).
(Optional extra) Support radial variation.
(Optional extra) Support full flux surface (@GeorgiaActon I see you have another open PR, so perhaps this is a non-trivial job).