Skip to content

Commit

Permalink
Improve treatment of RFCavity endpoints (#596)
Browse files Browse the repository at this point in the history
* Examples for 3D space charge benchmarking

- Modified the initial beam size in the IOTA lens benchmark example.
- Added 2 benchmarks of 3D space charge for initial testing.
- Add documentation for 2 benchmarks with space charge.
- Add a benchmark example with space charge and periodic s-dependent focusing.
- Added an s-dependent example using a Kurth beam without space charge.
- Modified tolerance for IOTA lens benchmark example.
  Reduced tolerance to account for smaller initial beam size and
  improved preservation of invariants of motion.
- Modified tolerances of space charge examples to allow CI tests to
  pass when space charge is not active.

- Modified tolerance for space charge examples.
  These should fail unless space charge is turned on.

* Update input_kurth_10nC.in

Selected numerical values for amr.n_cell, lattice.nslice, and geometry.prob_relative.

* Add README documentation for examples/distgen

* Improve RF cavity treatment of endpoints.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Delete examples/kurth/input_kurth_10nC.in

Not part of this PR.

* Update RFCavity.H

Correction to initialization of efieldint.

* Delete examples/distgen/README.rst

Not part of this PR.

* Update src/particles/elements/RFCavity.H

Co-authored-by: Axel Huebl <[email protected]>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axel Huebl <[email protected]>
  • Loading branch information
3 people authored May 6, 2024
1 parent e11b2ce commit 5b8c191
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/particles/elements/RFCavity.H
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,14 @@ namespace RFCavityData
zlen*sin_data[j]*cos(j*2*pi*z/zlen)/(j*2*pi);
}
}
else // endpoint of the RF, outsize zlen
{
efieldint = std::copysign(z, z)*zmid*0.5_prt*cos_data[0];;
for (int j=1; j < m_ncoef; ++j)
{
efieldint = efieldint - zlen*sin_data[j]*cos(j*pi)/(j*2*pi);
}
}
return std::make_tuple(efield, efieldp, efieldint);
}

Expand Down

0 comments on commit 5b8c191

Please sign in to comment.