Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Issues
  • #545

Closed
Open
Created May 22, 2020 by snuverink_j@snuverink_jDeveloper

Bend2D does not take particle charge into account

Summary

A RBEND or SBEND element does not take the particle charge into account.

This was discovered by Finn O'Shea, and posted to the OPAL mailing list.

Steps to reproduce

Define two beams and a bend:

BEAM1: BEAM, PARTICLE=PROTON, PC=P0, NPART=1000, BCURRENT=2.0e-03, BFREQ=50, CHARGE=1;
BEAM2: BEAM, PARTICLE=ALPHA,  PC=P0, NPART=1000, BCURRENT=2.0e-03, BFREQ=50, CHARGE=2, MASS=3.7274;
REAL switch_angle = 0.1;
REAL design_energy = 0.05;
SBEND, ANGLE = switch_angle,
       FMAPFN = "1DPROFILE1-DEFAULT",
       ELEMEDGE = 2.664,
       DESIGNENERGY = design_energy,
       L = 2 * switch_radius * sin(switch_angle / 2.0),
       E1 = 0, E2 = 0, // make a "true" sector magnet

What is the current bug behavior?

Same bend magnet strength for each beam.

What is the expected correct behavior?

Different bending strength, reduced by a factor 2 for BEAM2.

Relevant logs and/or screenshots

void Bend2D::setBendStrength() {

    // Estimate bend field magnitude.
    double mass = RefPartBunch_m->getM();
    double gamma = designEnergy_m / mass + 1.0;
    double betaGamma = sqrt(pow(gamma, 2.0) - 1.0);
    double charge = RefPartBunch_m->getQ();

    fieldAmplitude_m = ((charge / std::abs(charge)) * betaGamma * mass /
                        (Physics::c * designRadius_m));

This formula does only take the sign of the charge into account. It is repeated in findIdealBendParameters

Possible fixes

The formulas should be adjusted such that the charge is taken into account properly. The following methods should be fixed:

  • setBendStrength
  • findIdealBendParameters

Possibly also:

  • findBendStrength
  • estimateFieldAdjustmentStep
Edited May 26, 2020 by snuverink_j
Assignee
Assign to
OPAL 2.4.0
Milestone
OPAL 2.4.0 (Past due)
Assign milestone
Time tracking