opal AT lists.psi.ch
Subject: The OPAL Discussion Forum
List archive
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle
Chronological Thread
- From: Adelmann Andreas <andreas.adelmann AT psi.ch>
- To: Zhi Li <zhili29882 AT gmail.com>
- Cc: "opal AT lists.psi.ch" <opal AT lists.psi.ch>
- Subject: Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle
- Date: Tue, 20 Dec 2022 20:08:54 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 104.47.22.108) 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=CLW/lY2cuOc0oKrzSgN3XXGWWiNXp+9RVFo6WXxPk40=; b=f52ufc33G8Q4555VL3FTSBE+hPhQ7vjWyyHfV62hnFVZzEFVr7j9ziD+z6ogMSMy7VKNIGW79ui9DKZJ3EYgejJis68Ltgne9679KNg2o9UDcw1DgQYTh618SdpJEsCIipM/Q40Q5QVB3qf0Vjoq5iDpwynHXiS/aWbgP2WB5LfaIUCa3yFhXAbi7Huz7f7gPyuqmP2GWM67Fp0d68PYaGTEpiT+0vsIDDthlxjmHy5Yiisyrdd0KMIro1IDaDKylYvCN+eCTCMaM+scsiGUsSMqLCuNsPajKUjy84ti3ZKtGKlaBEJ3OozM0d4l8Qlr5pBb8tj5aHhgqxQ2A2xTQQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HW8mK3/fwd0PgKpKh0+wDoc12HveGkYk5rlm/zKyat1sUgicXQIQFt0fvg517S33sC6oplfVQvqD0W3ag+b0i6P457bOmFoPgAw039epSDrMc2Umh3Rl9wzX7r3WeygKhwbroNwv+2gNctefe3CgHOJIRAvUxtGVclHcbS82rJ8OGaw7bvFjWPoNN7/j53zhZoQmL+XxBGnKqAtfeIxj15K3O+qnQnnOAW0T/YHtcQTOL02tkA0+hTmCyKu+g/90Du/H8VvmnTa3UC6XS4TNz/i8nbi9dILZ8t4Wt99kQZzfWKlCViGqLyMfztfUZECGorawMkqEawo1G8ssMruInw==
- Authentication-results: mc3.ethz.ch; iprev=pass (mail-gv0che01hn2243.outbound.protection.outlook.com) smtp.remote-ip=52.100.1.243; 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;
Hi Zhi, you can ignore the first message. Your LINUX
flavour does not have lndir and as the message indicate
cp -rs is used.
Because you do not have a batch system you need to use --nobatch
option, this is described on the webpage.
However I feel you are close :)
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
============================================
------
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 20 Dec 2022, at 21:00, Zhi Li <zhili29882 AT gmail.com> wrote:
Hi Andreas,
It seems that the script is able to take the value from the .data file and create a new input file with it now. But I am getting some message that I don't understand how to fix.
<image.png>
Z.L
On Tue, Dec 20, 2022 at 12:03 PM Adelmann Andreas <andreas.adelmann AT psi.ch> wrote:
just type
which opal
and you should see where OPAL is located.
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 20 Dec 2022, at 18:58, Zhi Li <zhili29882 AT gmail.com> wrote:
Hi Andreas,
Yes, I will add CORES to the .data file.
I assume the OPAL_EXE_PATH should be pointed to this directory, correct? On the wiki it is pointed to the directory called "src" but my "src" directory looks very different.I made these updates to the setup.sh file and .data file but still getting the error message. Please give more hints, thanks!
<image.png>
<image.png>
Best regards,
Zhi
On Tue, Dec 20, 2022 at 12:43 AM Adelmann Andreas <andreas.adelmann AT psi.ch> wrote:
thanks, OPAL_EXE_PATH needs to point to the directory where the OPAL executable resides,not to the opal.sh
In the .data file you need to specify the number of CORES e.g.
CORES 1 # how many cores are used by OPAL
Will check more carefully later, nee to catch a bus!
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 19 Dec 2022, at 22:11, Zhi Li <zhili29882 AT gmail.com> wrote:
Here is the directory containing the .sh, .tmpl, and .data files. Let me know if you need anything else. Thanks.
Z.L
<tests.zip>On Mon, Dec 19, 2022 at 2:43 PM Adelmann Andreas <andreas.adelmann AT psi.ch> wrote:
can you send me the setup.sh and the content of the directory where the tmpl and data files are.
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 19 Dec 2022, at 21:20, Zhi Li <zhili29882 AT gmail.com> wrote:
Hi Andreas,
If I want to parametrize the launch phase of E-field in my OPAL input file and do a scan of it to see how emittance change, for this I would have to use the runOPAL.py script, correct? Right now I have some issues with making the example test files to run. I keep getting the error message: "Template and data filename do not match, {name}.data expected" but my .tmpl and .data files have the same name already. How do I fix this issue? Thanks!
<image.png>
Best regards,
Zhi
On Thu, Dec 15, 2022 at 1:53 AM Adelmann Andreas <andreas.adelmann AT psi.ch> wrote:
Hi Zhi, yes Urand() is the uniform rng.
The lower Energy Limit is calculates and eZ is the z-component of the electric field at the cathode.However this does not include space charge!
double phiEffective = (cathodeWorkFunc_m- std::sqrt(std::max(0.0, (Physics::q_e * beam->getQ() * eZ) /(4.0 * Physics::pi * Physics::epsilon_0))));double lowEnergyLimit = cathodeFermiEnergy_m + phiEffective - laserEnergy_m;
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 14 Dec 2022, at 19:53, Zhi Li <zhili29882 AT gmail.com> wrote:
Hi Andreas, Joel, Philippe,
Thank you all for the great suggestions, I am currently in the process of checking all those things and may need your help with more questions soon.
Quick question for Andreas:In regards to the applyEmissionModelNonEquil.pdf notes, is the lower energy limit (E_LL) for the function " applyEmissModelNonEquil()" user chosen? If so, where in my input file do I specify this value? Also "Urand()" is just a random integer generator, correct?
Best regards,
Zhi
On Wed, Dec 14, 2022 at 4:32 AM Adelmann Andreas <andreas.adelmann AT psi.ch> wrote:
Hi Zhi, the Schottky effect is not included. Also just to be sure: NONQUIL needs to be NONEQUIL.Attached the notes on how we emit in NONEQUIL, be aware of the fact that the notes need tobe checked. The actual code can be found here: http://amas.web.psi.ch/opal/CodeDocumentation/master/d9/d95/a02075_source.html#l00676
Cheers Andy
On 13 Dec 2022, at 21:07, Zhi Li <zhili29882 AT gmail.com> wrote:
Hi Mr. Adelmann,
Thank you very much for clarifying questions 1) and 3).
Now that I have done more searching, regarding the latter part of question 2), if I set my monitor position to be nanometers away from the cathode I should be expecting a captured value for emittance that is very close to a value calculated by the formula below, correct? NONQUIL model takes into account of Schotty effect right?<image.png>
<image.png>
4) Recently my colleague made a simulation with the same field map, same distribution parameters using GPT and I realized that the normalized x-emittance plot looks very different. To my understanding, there was a benchmark done by N. R. Neveu et al. and the results seem to agree between the two codes. Can you help take a guess what might be causing this discrepancy? I can send the input file for the GPT simulation if you need it. Thanks again for the help!
Best regards,
Zhi
<image.png>
<image.png>
On Tue, Dec 6, 2022 at 3: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 smallerthe 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”. Otherthan 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;
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle
, (continued)
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Adelmann Andreas, 12/14/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Zhi Li, 12/14/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Adelmann Andreas, 12/15/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Zhi Li, 12/19/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Adelmann Andreas, 12/19/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Zhi Li, 12/19/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Adelmann Andreas, 12/20/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Zhi Li, 12/20/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Adelmann Andreas, 12/20/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Zhi Li, 12/20/2022
- Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle, Adelmann Andreas, 12/20/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Zhi Li, 12/19/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Adelmann Andreas, 12/15/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Zhi Li, 12/14/2022
-
Re: [Opal] Initial longitudinal momentum, thermal emittance, reference particle,
Adelmann Andreas, 12/14/2022
-
Message not available
-
Message not available
-
Message not available
- Message not available
- Message not available
- Message not available
- Re: [Opal] OPAL and cavity phase, Adelmann Andreas, 12/15/2022
-
Message not available
-
Message not available
Archive powered by MHonArc 2.6.19.