Select Git revision
resistive_wall.py
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
resistive_wall.py 2.09 KiB
# -*- coding: utf-8 -*-
"""
Define resistive wall elements based on the Wakefield class.
@author: Alexis Gamelin
@date: 14/01/2020
"""
import numpy as np
from scipy.constants import mu_0, epsilon_0, c
from CollectiveEffect.wakefield import Wakefield, Impedance
def skin_depth(omega, rho, mu_r = 1, epsilon_r = 1):
""" General formula for the skin depth
Parameters
----------
omega: angular frequency in [Hz]
rho: resistivity in [ohm.m]
mu_r : relative magnetic permeability, optional
epsilon_r : relative electric permittivity, optional
Returns
-------
delta : skin depth in [m]
"""
delta = np.sqrt(2*rho/(np.abs(omega)*mu_r*mu_0))*np.sqrt(np.sqrt(1 +
(rho*np.abs(omega)*epsilon_r*epsilon_0)**2 )
+ rho*np.abs(omega)*epsilon_r*epsilon_0)
return delta
class CircularResistiveWall(Wakefield):
"""
Resistive wall Wakefield element for a circular beam pipe, approximated
formulas from Eq. (2.77) of Chao book [1].
Parameters
----------
frequency: frequency points where the impedance will be evaluated in [Hz]
length: beam pipe length in [m]
rho: resistivity in [ohm.m]
radius: beam pipe radius in [m]
mu_r : relative magnetic permeability, optional
epsilon_r : relative electric permittivity, optional
"""
def __init__(self, frequency, length, rho, radius, mu_r = 1, epsilon_r = 1):
super().__init__()
omega = 2*np.pi*frequency
Z1 = length*(1 + np.sign(omega)*1j)*rho/(
2*np.pi*radius*skin_depth(omega,rho))
Z2 = c/omega*length*(1 + np.sign(omega)*1j)*rho/(
np.pi*radius**3*skin_depth(omega,rho))
Zlong = Impedance(variable = frequency, function = Z1, impedance_type='long')
Zxdip = Impedance(variable = frequency, function = Z2, impedance_type='xdip')
Zydip = Impedance(variable = frequency, function = Z2, impedance_type='ydip')
super().append_to_model(Zlong)
super().append_to_model(Zxdip)
super().append_to_model(Zydip)