lanl / phoebus

Phifty One Ergs Blows Up A Star
BSD 3-Clause "New" or "Revised" License
46 stars 2 forks source link

fix B-field normalization in torus pgen #100

Closed Yurlungur closed 2 years ago

Yurlungur commented 2 years ago

…Bsq calc in tmunu and torus

PR Summary

What it says on the can. The issue is that the density is already normalized when the vector potential is computed. Dividing by an additional factor of rho_rmax shrinks A and, thanks to the -0.2 in the definition, kills A, and thus B, at the edges of the torus.

PR Checklist

Yurlungur commented 2 years ago

There was also a missing factor of alpha^2 in the calculation of bsq in the normalization routine that sets beta, meaning beta was incorrectly computed.

jdolence commented 2 years ago

good catch. trying to understand the substantive changes here. From my read, the only thing actually changing is that we were erroneously dividing by rho_rmax, which this removes. The rest of the edits don't look like they actually change anything. Is that right?

Yurlungur commented 2 years ago

There was also a missing alpha^2 in the calculation of bsq used when computing beta but I think it probably didn't matter because b0 should be zero in the initial conditions.

jdolence commented 2 years ago

There was also a missing alpha^2 in the calculation of bsq used when computing beta but I think it probably didn't matter because b0 should be zero in the initial conditions.

I don't think the alpha^2 was missing because that wasn't actually b[0] it was W * Bdotv. Anyway, I guess you're right that it won't matter for this setup, but it would matter later for other setups (like toroidal fields).

Yurlungur commented 2 years ago

Oh you're right. Well in that case all I did there was clarify things a little for own sanity.

The rho_rmax was the only substantive change.