Skip to content
Snippets Groups Projects
Select Git revision
  • e2efcc084362fb6110a3d4ac5fc4d44c176910ef
  • develop default protected
  • feature-ibs-suggestions-from-salah
  • syntax-typehints
  • feature-ExponentialDumper-bugfix
  • Resisitve_wall_eff_radius_yokoya
  • feature-feedback-IQ-damper0
  • 18-synchrotron-object-string-representation
  • stable protected
  • feature-particle-in-cell
  • feature-quad_wakes_LongRangeResistiveWall
  • feature-iqdamper0
  • feature-read_wakis
  • use-one-bin
  • RF-FBv0.6
  • RF-FBv0.5
  • faster_pytorch
  • RF-FB
  • util
  • RFBucket
  • Long-range_wakepotential
  • 0.9.0
  • 0.8.0
  • 0.7.0
  • 0.6.0
  • 0.5.0
  • 0.4
  • 0.3
  • 0.2
  • 0.1
30 results

resistive_wall.py

Blame
  • 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)