Skip to content

Rename isgn and clarify its use #133

@jhalpern30

Description

@jhalpern30

The variable isgn in the Vacuum code is currently very esoteric and needs a rework, specifically:

  1. Renaming the variable entirely, something like outward_normal_sign
  2. Add documentation for what it does and why it is there
  3. I think its use can also be simplified. Right now, it multiplies all entries into the gradient Green's function except for two occasions, when the wall x point < 0 and when adding the residue term. I think this could just be turned into an element-wise multiplication of the entire grad green block at the end of the function, taking special care for the sign of these cases. Note @logan-nc's comment here, where the case of the wall x points < 0 doesn't make sense. Perhaps that will get deprecated in a future PR anyway.

@jhalpern30's explanation of isgn (more or less correct, may not be 100%)
"the surface integrals from Green's identity (eq. 20) pop out a unit normal, which we interpret as the outward unit normal defined relative to the integration volume, which is the plasma -> wall region, and needs to be consistent over S = union of the plasma and wall surfaces. This unit normal is J * grad Psi, which always points outward in the direction of decreasing Psi. So on the plasma surface, you need a minus sign such that it points inward (which is the outward normal relative to the integration region). And for an outward unit normal on the wall, you use the plus such that it points outward (again, the outward normal of the integration region). This appears for only the grad green matrix in kernel since its dotted with the normal (eq. 21), but not in the regular green matrix because the normal gets dotted with grad chi instead (this might get handled implicitly or elsewhere in the code)"

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions