Skip to content

Polymorphic field BCs and standing shocks - #410

Open
JamesMcClung wants to merge 106 commits into
psc-code:mainfrom
JamesMcClung:pr/polymorphic-bcs-standing-shocks
Open

Polymorphic field BCs and standing shocks#410
JamesMcClung wants to merge 106 commits into
psc-code:mainfrom
JamesMcClung:pr/polymorphic-bcs-standing-shocks

Conversation

@JamesMcClung

Copy link
Copy Markdown
Collaborator

This is a mega PR with a messy history even after significant cleanup, so sorry about that. Here's a summary of the changes:

PSC Changes

  • Stats dump interval can be ≤0 to disable it
  • Fix read_checkpoint begin/endStep
  • Fix integer division by 0 in taccum causing debug-mode crashes

FieldBcBase

  • Abstract base class for polymorphic field boundary conditions
  • Subclasses subsume the previous monolithic BndFields_ implementation
    • This greatly improves how radiating boundary waveforms can be specified
  • Goal is to eventually subsume all BndFieldsBase types and possibly boundary-specifying enums
    • CUDA subclass remains

ConductingWall

  • Handles conducting wall field BCs
  • Automatically added by psc integrator based on boundary-specifying enum
  • Dimension-agnostic implementation
  • Add documentation

Radiating

  • Handles radiating open BCs
  • Templated by user-defined waveform provider
  • Dimension-agnostic implementation
  • Add documentation

SetupParticles

  • Add VelocityBooster struct to facilitate velocity boosts
  • Drifting Maxwellians are sampled in their rest frame and then boosted
    • The rest-frame sample is actually interpreted as a proper velocity to avoid crashing when a rogue particle's plasma-frame velocity exceeds 1; the correct thing to do would be to sample from a Maxwell–Jüttner distribution, but that's nontrivial

BoundaryInjector

  • Experiment with "preacceleration", which seems to prevent Langmuir-like waves from building up at high-speed inflows
  • Support upper boundaries
  • SetupParticles sampling changes apply here, too

psc_shock Changes

  • Fix parallel B component being 0
  • Fix advective inflow when the domain corner isn't at the origin
  • Fix advective inflow of turbulence when the initial background field isn't uniform
  • Fix div B = 0 in 2D case
  • Support relaxation method of initialization
  • Param changes:
    • Add checkpoint-related params: checkpoint_filename, checkpoint_interval, n_checkpoints
    • Add stats_interval param
    • Add shock_method param ("wall", "relaxation", or "none")
    • Add θ_xz_deg and θ_Bn_deg
    • Add domain length params lx, ly, lz that override d* when present
    • Add downstream override params: r, T_e2, T_i2
    • Breaking changes to other params:
      • electron_mass -> m_e
      • ion_mass -> m_i
      • electron_temperature -> T_e
      • ion_temperature -> T_i
      • b_mag -> B_0
      • turb_dB -> dB
      • turb_correlation_length -> L_c
      • n_patches_* -> np*
      • Remove turb_dB^2
      • Remove b_angle_y_to_x_rad
      • Remove v_upstream_*
      • Remove mirror_domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant