gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
30 stars 14 forks source link

Setup new COCOs combination for em_coupling matrices #300

Open torrinba opened 3 months ago

torrinba commented 3 months ago

The COCOs have now been defined for all of the different em_coupling matrices and should close #299.

I'm interested in why there is a distinction between sigma_Ip and sigma_B0 since it would simplify things if we could eliminate one instead of multiplying them several places. Can someone more familiar explain this?

orso82 commented 3 months ago

I honestly don't know or remember why we have both sigma_Ip and sigma_B0

jmcclena commented 3 months ago

sigma_B0 exists in Sauter's paper (https://www.sciencedirect.com/science/article/pii/S0010465512002962). So I'd be surprised if one can be removed.

bclyons12 commented 3 months ago

sigma_Ip = sign(Ip) and sigma_B0 = sign(Bt). Those don't have to be the same, so you need to maintain both. In DIII-D, for example, they are opposite signs in the standard configuration.

bclyons12 commented 3 months ago
  1. Okay, I see what you mean. It's actually sigma_Ip_eff and sigma_B0_eff, which are how those quantities transform. Those should be the same, but I guess the COCOS paper leaves open the option that your transformation might want to enforce/change a sign for one of those:

    image
  2. 'PSI/TOR' is supposed to be the transformation for inductance? I don't think sigma_B0_eff should come into that since the toroidal field isn't involved. Inductance is something like poloidal flux per unit current, so maybe you just want: transforms['PSI/TOR'] = sigma_Bp_eff * (2 * numpy.pi) ** exp_Bp_eff? Or maybe you don't want a transformation at all. Are you trying to maintain the mutual inductance as the translation from current/current change to poloidal flux/voltage. If so, I don't think it has a COCOS. It's just a number. If you want the mutual inductance to convert between psi and current, then this transformation is correct because the physical meaning of psi would change depending on the COCOS.

torrinba commented 3 months ago

Thanks for the explanation Brendan! If I'm understanding correctly, the sigma_B0_eff vs sigma_Ip_eff distinction is retained in order to support transformations outside the standard COCOs 1-18. Does OMAS have options to specify a different transformation (such as only transforming B0 or Ip)? It seems to me that a cocosin/cocosout index has to be specified for the transformations to be applied.

I'm having a hard time understanding how the mutual inductance would convey anything meaningful if it's convention didn't change when the definitions of flux and current are transformed. I could be missing something there. My use case for the em_coupling IDS is to use the mutual inductaces to compute the impacts of current sources. So the transformation is important, but I can't say that is universal. Whether the sigma_B0_eff and sigma_Ip_eff contributions are included has no consequence since I plan to stick with COCOs 1-18.

Orso also raised the possibility that the mutual inductance could have a mix of different COCOs if the flux and current each use a different COCOs, but we agreed this would be an edge case that should be handled on it's own and doesn't need to have dedicated support in OMAS.

bclyons12 commented 3 months ago

If you have more information on the definition of these matrices or how they get used, I might be able to advise.

torrinba commented 3 months ago

The only official information I know of is the description provided by IMAS https://gafusion.github.io/omas/schema/schema_em%20coupling.html

In practice we are storing the EFIT Green function tables there and using them in similar ways. Joey has a paper being reviewed that is an example of one of the applications outside of EFIT http://nike.gat.com/app/publications/tracker/item/16662

bclyons12 commented 3 months ago

How do the EFIT Green's function tables get used? You multiply those values by the coil current and it gives you the EFIT psi? If that's true, then yes, it has a COCOS definition because the EFIT psi is the poloidal flux per radian.

The easiest thing to do would be to write down the equation that has this mutual inductance in it. Then you can write down the transform for each part of the equation and see what's left over to make it balance.

github-actions[bot] commented 1 month ago

Stale pull request message