cherab / solps

Other
6 stars 5 forks source link

Inconsistent treatment of ENEUTRAD among input formats #28

Closed jacklovell closed 2 years ago

jacklovell commented 4 years ago

The routines for reading in the total radiated power from neutrals are inconsistent:

All 3 of these are exposed by SOLPSSimulation.total_radiation, and the interpolator SOLPSSimulation.total_radiation_volume. So we have the unfortunate situation where the quantity stored in this variable depends on the data source. It would be OK to store the same quantity calculated in different ways (e.g. W/m3 emissivity with different contributions for the 3 reading methods), but I think storing either emissivity or power is a recipe for confusion.

I propose we modify the raw file reading, so that the total power is given by -ENEUTRAD / volume. This would produce a quantity in W/m3, where positive values correspond to emission. This is not only consistent with the MDSplus and balance.nc variants, but also more consistent with the rest of the Cherab framework (the TotalRadiatedPower model for example outputs quantities in W/m3/sr, rather than W).

We could also modify the output to read -(ENEUTRAD + EIONRAD + EMOLRAD) / volume, which should be a more accurate measure of total radiation. But the latter two quantities aren't available in fort.44 files in the 2013 format or older.

@mattngc @Mateasek @jrh-ccfe @shenders what are your thoughts on this?

mattngc commented 4 years ago

This sounds like a sensible approach to me.

Impressed you managed to track down all this information. Remember I could never get consistency between the different formats, it seemed like every format was different and documentation was rare. I remember doing a benchmark for Felix with one of his cases and we managed to get reasonable agreement... but long since forgotten now.

Mateasek commented 4 years ago

My SOLPS knowledge is very limited, so I am sorry if I didn't correctly understand the question here. I agree with what @jacklovell proposes. The main purpose of this module should be to provide Cherab users with a tool to work with SOLPS data with approach and units as consistent with rest of the famework as possible. On the other hand, I think this could also be a more general package allowing work with SOLPS output. In this case and from my experience, I would suggest providing some way of access to original data (i.e. in original units with original names). I know this can be a bit difficult in an environment where variable names, descriptions and data sources tend to change.

jacklovell commented 3 years ago

I've picked this back up. Getting the Prad from Eirene as W/m3 is easy, but this is only for neutral radiatoin. The MDSplus and balance.nc readers include line radiation and Bremsstrahlung from B2 too when they assign sim.total_radiation: it would be good to do this for raw files too.

I notice that b2plot can plot the quantities b2br and b2ra for Bremsstrahlung and line radiation respectively. It should be possible by consulting the source code of b2plot to reproduce its calculation of these quantities, and add that to the total radiation for the simulation model.

jacklovell commented 3 years ago

I notice that b2plot can plot the quantities b2br and b2ra for Bremsstrahlung and line radiation respectively. It should be possible by consulting the source code of b2plot to reproduce its calculation of these quantities, and add that to the total radiation for the simulation model.

Unfortunately the rqrad and rqbrm quantities which are required to get line emission and Brensstahlung respectively are only available in the b2fplasma file or its plain text equivalent, b2fplasmf. Currently we only require b2fstate, b2fgmtry and fort.44 for the raw file reader, and I don't particularly want to add a new hard file dependency as this could break existing workflows.

Of course, it's easy to calculate the total radiated power in Cherab by adding the TotalRadiatedPower model to the plasma object returned by SOLPSSimulation.create_plasma. But this will be slower than using the interpolated total radiated power from SOLPS.

I think there are several options here:

Thoughts?