core icon indicating copy to clipboard operation
core copied to clipboard

General Equilibrium Class and processing

Open Mateasek opened this issue 6 years ago • 2 comments

I think this has been floating around for quite some time and became obvious in few last issues, for example #147 . I think Cherab should have some general equilibrium class. It can be based on EFITEquilibrium (although I would rename it). The added functionality could be:

  • specification of input coordinates, for example cocos. This is even more important if the input should be coming from various equilibrium codes.
  • input profile processing which could prevent errors like negative psi normalized
  • coordinate transforms

There is a lot more functionality it could cover...

Mateasek avatar Oct 25 '19 08:10 Mateasek

The EFIT equillibrium class is quite general, so we could probably rename it. Originally the EFITEquilibrium class was just call Equilibrium. It was renamed EFITEquilibrium as it includes some minor assumptions specific to EFIT in places. It should be relatively easy to clean these up.

CnlPepper avatar Oct 25 '19 11:10 CnlPepper

I agree with both of these comments. Probably the best first step is to:

  1. Make a new base class called Equilibrium2D() that only contains the essential interfaces and some basic data. In the long term you could add a lot of extra computational features to it to give feature parity with PLEQUE and FLUSH.
  2. Make a new derrived class from Equilibrium2D called EFITEquilibrium(). This implements the interface and adds EFIT specific functionality.

I suggest calling it Equilibrium2D because this type of equilibrium is essentially a 2D solution that is then mapped out with symmetry operators. You could also approximate some kind of error fields by applying a n=x perturbation on the field.

Thinking ahead, you may ultimately want a deeper base class that works for both Tokamaks and Stellerators. Just implements the magnetic field and a few other basics. This woudl also allow support for 3D Tokamak fields through VMEC, etc.

mattngc avatar Oct 27 '19 11:10 mattngc