ProjectTorreyPines / FUSE.jl

FUsion Synthesis Engine
https://fuse.help
Apache License 2.0
30 stars 1 forks source link

Model for capturing stationary effect of sawtooth #425

Open orso82 opened 1 year ago

orso82 commented 1 year ago

FUSE happily lets q drop below 1.0, which in real life would result in a sawtooth cycle. The sawtooth oscillations can have both beneficial and detrimental effects on the plasma confinement. On one hand, they can help in the removal of impurities from the plasma core. On the other hand, they reduce the plasma confinement time.

We could proceed and implement a time dependent sawtooth model porcelli_module.pdf however that would force small time steps in the ActorDynamicPlasma

Instead, I'd like to be able to capture the average effect that the sawtooth cycle has on the current (q) profile, and the temperature, density, rotation profiles. One possibility would be to run the porcelli model, time-average it, and only use the time-averaged solution as part of the ActorDynamicPlasma. Another idea could be to add some hyper-diffusion in the QED current diffusion solver, and have some internal controller that tunes it to keep q above 1.0... though in this case it's unclear what we should do for the other profiles. Use the same hyper-diffusion coefficient for temperatures, densities, and rotation?

bclyons12 commented 1 year ago

A collection of thoughts:

1) I don't love the idea of incorporating this into QED. First of all, that was developed under the Theory grant, so we should be wary of mixing IR&D work into it. Second, I like the idea of it being a lightweight tool that does something simple and straightforward. Minimal bells and whistles.

2) A standalone actor that flattens the profiles in the core could probably be implemented. Pick two radii, an inversion radius and a mixing radius. You flatten the profiles inside the inversion radius and modify them between the inversion and the mixing radii. Presumably we can find some formulae for those radii, maybe in Porcelli? image

3) Better would be @orso82 suggestion of some average over a sawtooth period. The issue with (2) is that you'd always be at the bottom of the sawtooth, so you'd be underestimating things like the fusion power. How you do the averaging is tricky though. Even if you time-average the density/temperature, you'd probably underestimate the fusion power since it's highly nonlinear.

4) In time-dependence, I think there'll be a conflict between the density/temperature stationary flux matching we do at each step and the flattened profiles for the sawtooth. It's a big source of "flux" that isn't appearing in those equations.

jmcclena commented 12 months ago

I need to get Bp for the Porcelli calculations. Is there a good way to get this in FUSE? Or a good way to get the perimeter of a flux surface?

bclyons12 commented 12 months ago

Right now, the equilibrium actor doesn't store the poloidal field into the IMAS data structure, though there is a place for it:

equilibrium.time_slice[:].profiles_2d[:].b_field_r
equilibrium.time_slice[:].profiles_2d[:].b_field_z

There's also the "Poloidal length of a magnetic surface" equilibrium.time_slice[:].global_quantities.length_pol.

We could add that these pretty easily in the TEQUILA (and other) actors. You'd have to do some interpolation from there. I don't know how much accuracy you need. Better would be to store the entire TEQUILA Shot data structure into IMAS through the GGD. Then you could reload it and get everything exactly.

orso82 commented 12 months ago
equilibrium.time_slice[:].profiles_2d[:].b_field_r
equilibrium.time_slice[:].profiles_2d[:].b_field_z

are IMAS.jl expressions, so those fields should be filled (and from what I see, they are).

@jmcclena what quantities do you need for the Porcelli calculation?

bclyons12 commented 12 months ago

Ah, I just noticed that it wasn't added directly to the dd. Presumably that's doing some spline fit to psi? That would be less accurate than getting it directly from the Shot, but perhaps that's all that's needed for @jmcclena

jmcclena commented 12 months ago

The flux surface average Bp is the main one I'm missing. Are the 2d profiles in rho-theta space? Maybe it is for Tequila/chease? I pulled a fuse solevev example which looked like it was R,Z.

orso82 commented 12 months ago

@jmcclena all the 2D profiles are in R,Z (at least for now). I want to support different grids, but this requires a bit of work.

Please note that I have now added equilibrium.time_slice[].profiles_1d.fsa_bp