pecos / tps

Torch Plasma Simulator
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Compute the distance function #202

Closed trevilo closed 1 year ago

trevilo commented 1 year ago

Add a naive calculation of the distance function. For now, this is computed serially using the serial mesh (i.e., prior to decomposing the mesh). This is obviously the simplest approach (e.g., it avoids needing to communicate boundary faces to ensure that the closest wall face isn't on another mpi rank) but has drawbacks, especially for large 3D meshes. I envision using this capability primarily in 2D for now, so this is not an issue for the moment.

Two other known issues:

  1. The solve for the nearest wall point uses an approximate Newton solve that may not perform well for highly curved elements (see further comments here)
  2. The distance function is compute at the nodes for the finite element space used for the flow variables. This may not be ideal, especially for coarse meshes in the vicinity of features that lead to distance functions with discontinuous derivatives (e.g., corners).

Resolves #201