cherab / core

The core source repository for the Cherab project.
https://www.cherab.info
Other
44 stars 24 forks source link

General Equilibrium Class and processing #166

Open Mateasek opened 4 years ago

Mateasek commented 4 years ago

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:

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

CnlPepper commented 4 years ago

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.

mattngc commented 4 years ago

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.