Skip to Content.
Sympa Menu

opal - Re: [Opal] OPAL and cavity phase

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] OPAL and cavity phase


Chronological Thread  
  • From: Adelmann Andreas <andreas.adelmann AT psi.ch>
  • To: Wolf-Dieter Klotz <wdklotz AT gmail.com>
  • Cc: "opal AT lists.psi.ch" <Opal AT lists.psi.ch>
  • Subject: Re: [Opal] OPAL and cavity phase
  • Date: Thu, 15 Dec 2022 08:26:59 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 20.250.75.252) smtp.rcpttodomain=gmail.com smtp.mailfrom=psi.ch; dmarc=pass (p=none sp=none pct=100) action=none header.from=psi.ch; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WLm6eA4PeepVX4uM1VrfJHykI78kpSKzz6nokKwOAOg=; b=eviVN6I0Zb1HBJxnEjOm17g+7wt7fJCzVqvqKigrXA+u+heDYc9e4T3pYV8Dylvd3u4iBi5wmqfVIAaX8y7q0z0ubQT7mGUcqQ5kMIKCCWva+nsCRu/Lcp++JPmE6uFojJkeBXKKH4Ptnad6HQzvdcTVhQnFMwXqel7rZoNUIf37gu6UFaMubfb2SMenFkRSaLUBEAMvG9DhdmQ3fAqZuwJr3oVlcvI7uObgFJjdD4rkuo9FfpaGrxRM6OrWPkezZkKtOb9a73Lya3naYTwcHD0sFmdnD0vM/31hHa7o4Z08C43WxcWUP2QQH/4dVz7V5HRgKy0AZzY7I56VvSYExQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aoG9SMI0mPek17xX8sa3Lq3Oe8mv7K8xoBTHbs1huxh4bdoBJZHH2hbEPzG2lUOZJZIVQ9lgUPqnCiIv5Trhcis3FMLRO6qWnOHX8AAPyhxW3JNxbyLInZuHTuyNRTjnD4fPor5T1r5DM1CMhNpT7UF4JdKwHacvaJIu9mYWJ7n2dslo0YomrOlmOUwx9bwIhK9LaPdiUJDNbMcBXZuJO4GFDSc7PqBZ0XpNIsoej/HdaUFCI2HqVdIYfpFFsaB7Addg74J4RgOuVkCNf5yZjA/do56sK9baoBshhzqNtQzKrEZJX1a1kj3V+QrthEGgk5M+PtCSYTzSJv9XdJUALQ==
  • Authentication-results: mc4.ethz.ch; iprev=pass (mail-zr0che01on2067.outbound.protection.outlook.com) smtp.remote-ip=40.107.24.67; spf=pass smtp.mailfrom=psi.ch; dkim=pass header.d=psi.ch header.s=selector2 header.a=rsa-sha256; dmarc=pass header.from=psi.ch
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=psi.ch;

If you run the simulation with e.g. OPTION, AUTOPHASE    = 5;  and some LAG then 
the actual phase is written to stdout like this:

Ippl> Saved phases in the h5 file: Cav-1-name -> ELMN3 --- Cav-1-value -> 2.4710

If you want this phase to be used you can set OPTION, AUTOPHASE    = 0; and add the above phase into the element definition

elmn3 : "RFG1" , ElEMEDGE=0.05, LAG=2.4710;

In both cases you get the same energy, I hope this answers the question.

Cheers A
------
Dr. sc. math. Andreas (Andy) Adelmann
Head a.i. Labor for Scientific Computing and Modelling 
Paul Scherrer Institut OHSA/D09 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Zoom ID: 470-582-4086 Password: AdA
Zoom Link: https://ethz.zoom.us/j/4705824086?pwd=dFcvT1pMMGY0bHg0dTNncUNZZTJkZz09

-------------------------------------------------------
Friday: ETH HPK G 28   +41 44 633 3076
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================

On 8 Dec 2022, at 14:46, Wolf-Dieter Klotz <wdklotz AT gmail.com> wrote:

Sorry you are right. Here are the field maps.  WDK

On Thu, Dec 8, 2022 at 10:00 AM Adelmann Andreas (PSI) <andreas.adelmann AT psi.ch> wrote:
thanks, but without the rf-fieldmaps I can not check :(


Cheers A
------
Dr. sc. math. Andreas (Andy) Adelmann
Head a.i. Labor for Scientific Computing and Modelling 
Paul Scherrer Institut OHSA/D09 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Zoom ID: 470-582-4086 Password: AdA
Zoom Link: https://ethz.zoom.us/j/4705824086?pwd=dFcvT1pMMGY0bHg0dTNncUNZZTJkZz09

-------------------------------------------------------
Friday: ETH HPK G 28   +41 44 633 3076
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================

On 7 Dec 2022, at 23:49, Wolf-Dieter Klotz <wdklotz AT gmail.com> wrote:

Here it is.  -- WDK

On Wed, Dec 7, 2022 at 6:31 PM Adelmann Andreas (PSI) <andreas.adelmann AT psi.ch> wrote:
Please send me the input files. Thanks A

Sent from my iPhone

On 7 Dec 2022, at 18:18, Wolf-Dieter Klotz <wdklotz AT gmail.com> wrote:


Ok Thanks.
But if I set AUTOPHASE=0, APVETO=False and LAG=-25*PI/180 it looks the same as with APVETO=True! Why?
<image.png>

<image.png>

Cheers WDK

On Wed, Dec 7, 2022 at 3:44 PM Adelmann Andreas (PSI) <andreas.adelmann AT psi.ch> wrote:
you get this sort of emails because you are registered to the mailing list. 

I answered you yesterday but apparently the list server was down  …! 


If you run with APVETO=true you need to add the phase 
found by the auto phasing to your -25.0 degree. These phases are 
found in the stdout.






Cheers A
------
Dr. sc. math. Andreas (Andy) Adelmann
Head a.i. Labor for Scientific Computing and Modelling 
Paul Scherrer Institut OHSA/D09 CH-5232 Villigen PSI
Phone Office: xx41 56 310 42 33 Fax: xx41 56 310 31 91
Zoom ID: 470-582-4086 Password: AdA
Zoom Link: https://ethz.zoom.us/j/4705824086?pwd=dFcvT1pMMGY0bHg0dTNncUNZZTJkZz09

-------------------------------------------------------
Friday: ETH HPK G 28   +41 44 633 3076
============================================
The more exotic, the more abstract the knowledge, 
the more profound will be its consequences.
Leon Lederman 
============================================

On 7 Dec 2022, at 08:59, Wolf-Dieter Klotz <wdklotz AT gmail.com> wrote:

Good Morning Dr.A.A.
This mail is not for me. It appeared in my inbox - I don't know why.

However, I am waiting for a reply from my post
([Opal] OPAL and cavity phase, Wolf-Dieter Klotz, 11/30/2022).
Is it possible to get a reply on my posting?
I am stuck with OPAL on this problem. I looked into the source code, but I couln't get an answer from reading it - very difficult to grasp what happens in the code!
Mit freundlichen Gruessen
WD Klotz

On Tue, Dec 6, 2022 at 10:05 PM Adelmann Andreas (PSI) <andreas.adelmann AT psi.ch> wrote:
Hi Zhi, great that you are using OPAL! 


Questions:

1) If I generate my initial distribution using the NONEQUIL emission model, does the longitudinal momentum of the particles from this override the longitudinal momentum (P0) define in the BEAM parameters? If yes, how do I set this BEAM parameter longitudinal momentum (P0) to 0?


Yes P0 is overwritten. In case you have problems setting P0=0.0, then try P0=1.0E-12.


2) Is there a way to have the thermal emittance value saved to the output file (.stat) from the emitted distribution by NONEQUIL? Perhaps I can define a monitor very close to the cathode and capture this value? So far the closest I can set the monitor to the cathode is one micrometer away, is there a way to set it to 0 so its right ontop of the cathode?

Yes with a monitor you can achieve this, however a distance of 0.0 will not work. The minimal distance is determined by the time step, the smaller 
the time step the closer you can put the monitor towards the cathode. 

What is the exact formula that OPAL uses to calculate this thermal emittance? I want to confirm the thermal emittance value captured by a monitor with theoretical calculation by plugging in laser energy, work function, cathode temp, and Fermi energy into an equation. 

I think I do not understand the question. In case of a monitor you have access to the phase space and can calculate the emittance “by hand”. Other
than that the emission process is described in chapter 15.4 of the manual (http://amas.web.psi.ch/opal/Documentation/2022.1/#sec.distribution.emissionmodel ). 

3) In the output (.stat) file, I can plot the field seen by the reference particle. What is the exact definition of this reference particle? I don't seem to find a good description of this in the user manual. Is this the first particle emitted from the cathode or does it represent the average of every particle in the bunch?

If you plot against column 2, it uses the path length (m) in the floor coordinate system of the on-axis particle if I remember correctly. 
@Christof can you confirm please! 

Cheer Andy 


Best regards,

Zhi


Here is my input file:


OPTION, PSDUMPFREQ = 300;  
OPTION, STATDUMPFREQ = 1;  
OPTION, BOUNDPDESTROYFQ=10;
OPTION, AUTOPHASE=4;      
                           
OPTION, VERSION = 20300;

Title, string="Original AWA Photoinjector input file modified";

//----------------------------------------------------------------------------
//Global Parameters

REAL rf_freq             = 2.998e3;     //RF frequency. (MHz)
REAL n_particles         = 1E3;      //Number of particles in simulation.
REAL beam_bunch_charge   = 1e-3;      //Charge of bunch. (C)

//Initial Momentum Calculation
REAL Edes    = 1e-9; //initial energy in GeV
REAL gamma   = (Edes+EMASS)/EMASS;
REAL beta    = sqrt(1-(1/gamma^2));
REAL P0      = gamma*beta*EMASS;    //inital z momentum

//Printing initial energy and momentum to terminal output.
value , {Edes, P0};

//----------------------------------------------------------------------------
REAL gun_inj_phase = 0;  

GUN:    RFCavity, L = 0.1, VOLT = 110.26, ELEMEDGE = 0.0, TYPE = "STANDING",
        FMAPFN = "DriveGunGPTmap.T7", FREQ = 2998, LAG = (gun_inj_phase*Pi)/180.0,
 APVETO = TRUE;
//----------------------------------------------------------------------------
// DEFINE BEAM LINE

myLine:  Line = (GUN);
//M: MONITOR, ELEMEDGE = 1e-9, OUTFN = 'mon';

// Complete accelerator
DRIVE: Line = (myLine);
//----------------------------------------------------------------------------
Dist:DISTRIBUTION, TYPE = GAUSS,
 SIGMAR = 0.001,
 CUTOFFR = 2.0,
 SIGMAT = 1e-12,
 CUTOFFLONG = 2.0,
 NBIN = 10,
 EMISSIONSTEPS = 100,
 EMISSIONMODEL = NONEQUIL,
 ELASER = 6.48,
 W = 4.31,
 FE = 7.0,
 CATHTEMP = 300,
 EMITTED = TRUE,
 WRITETOFILE = True;
//----------------------------------------------------------------------------
FS_SC: Fieldsolver, FSTYPE = FFT,
            MX = 10, MY = 10, MT = 10,
            PARFFTX = True,
            PARFFTY = True,
            PARFFTT = True,
            BCFFTX = open,
            BCFFTY = open,
            BCFFTT = open,
            BBOXINCR = 1,
            GREENSF = INTEGRATED;
//----------------------------------------------------------------------------
// Electron Beam Definition

BEAM1:  BEAM, PARTICLE = ELECTRON, pc = P0, NPART = n_particles,
        BFREQ = rf_freq,BCURRENT = beam_bunch_charge * rf_freq, CHARGE = -1;

//----------------------------------------------------------------------------
TRACK, LINE = DRIVE, BEAM = BEAM1, MAXSTEPS = 1900000,
    DT = {1.0e-13}, ZSTOP={0.12};

RUN, METHOD = "PARALLEL-T", BEAM = BEAM1,
    FIELDSOLVER = FS_SC, DISTRIBUTION = Dist;
ENDTRACK;

Quit;




<opALCELIshort.in>

<OPALEzTab1><OPALEzTab3>




Archive powered by MHonArc 2.6.19.

Top of Page