ImpactX
Loading...
Searching...
No Matches
WakeConvolution.H
Go to the documentation of this file.
1/* Copyright 2022-2023 The Regents of the University of California, through Lawrence
2 * Berkeley National Laboratory (subject to receipt of any required
3 * approvals from the U.S. Dept. of Energy). All rights reserved.
4 *
5 * This file is part of ImpactX.
6 *
7 * Authors: Alex Bojanich, Chad Mitchell, Axel Huebl
8 * License: BSD-3-Clause-LBNL
9 */
10#ifndef WAKE_CONVOLUTION_H
11#define WAKE_CONVOLUTION_H
12
14
15#include <AMReX_GpuContainers.H>
16#include <AMReX_Math.H>
17#include <AMReX_REAL.H>
18
19
21{
22 // Constants
23 constexpr amrex::Real Z0 = 377;
24
30 constexpr amrex::Real alpha_1 = 0.4648;
31
38 amrex::Real
39 unit_step (amrex::Real s)
40 {
41 using namespace amrex::literals;
42
43 return s >= 0_rt ? 1_rt : 0_rt;
44 }
45
54 amrex::Real alpha (amrex::Real s);
55
67 amrex::Real w_t_rf (
68 amrex::Real s,
69 amrex::Real a,
70 amrex::Real g,
71 amrex::Real L
72 );
73
85 amrex::Real w_l_rf (
86 amrex::Real s,
87 amrex::Real a,
88 amrex::Real g,
89 amrex::Real L
90 );
91
105 amrex::Real
107 amrex::Real s,
108 amrex::Real R,
109 amrex::Real const bin_size
110 )
111 {
112 using namespace amrex::literals;
113 using amrex::Math::powi;
114
115 amrex::Real const rc = powi<2>(ablastr::constant::SI::q_e) / (4_rt * amrex::Real(M_PI) * ablastr::constant::SI::ep0 * ablastr::constant::SI::m_e * powi<2>(ablastr::constant::SI::c));
116 amrex::Real const kappa = (2_rt * rc * ablastr::constant::SI::m_e * powi<2>(ablastr::constant::SI::c)) / std::pow(3_rt, 1_rt/3_rt) / std::pow(R, 2_rt/3_rt);
117
118 return -3_rt/2_rt * kappa / bin_size * (unit_step(s + bin_size / 2_rt) * std::pow(std::abs(s + bin_size / 2_rt), 2_rt/3_rt) - unit_step(s - bin_size / 2_rt) * std::pow(std::abs(s - bin_size / 2_rt), 2_rt/3_rt));
119 }
120
130 amrex::Gpu::DeviceVector<amrex::Real> const & beam_profile_slope,
132 amrex::Real delta_t
133 );
134
135} // namespace impactx::particles::wakefields
136
137#endif // WAKE_CONVOLUTION_H
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
static constexpr auto c
static constexpr auto ep0
static constexpr auto m_e
static constexpr auto q_e
PODVector< T, ArenaAllocator< T > > DeviceVector
constexpr T powi(T x) noexcept
Definition ChargeBinning.cpp:17
constexpr amrex::Real alpha_1
Definition WakeConvolution.H:30
constexpr amrex::Real Z0
Free space impedance [Ohm].
Definition WakeConvolution.H:23
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real unit_step(amrex::Real s)
Definition WakeConvolution.H:39
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real w_l_csr(amrex::Real s, amrex::Real R, amrex::Real const bin_size)
Definition WakeConvolution.H:106
amrex::Gpu::DeviceVector< amrex::Real > convolve_fft(amrex::Gpu::DeviceVector< amrex::Real > const &beam_profile_slope, amrex::Gpu::DeviceVector< amrex::Real > const &wake_func, amrex::Real delta_t)
Definition WakeConvolution.cpp:66
amrex::Real w_l_rf(amrex::Real s, amrex::Real a, amrex::Real g, amrex::Real L)
Definition WakeConvolution.cpp:51
amrex::Real w_t_rf(amrex::Real s, amrex::Real a, amrex::Real g, amrex::Real L)
Definition WakeConvolution.cpp:36
@ s
fixed s as the independent variable
Definition ImpactXParticleContainer.H:37