Warwick-Plasma / epoch

Particle-in-cell code for plasma physics simulations
https://epochpic.github.io
GNU General Public License v3.0
184 stars 58 forks source link

Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG #735

Open Garnet5867 opened 2 weeks ago

Garnet5867 commented 2 weeks ago

Dear Professor,

During my testing, I encountered the following message after the simulation completed: "Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG."

I have enabled QED and Bremsstrahlung radiation in the Makefile. Could this have an impact on my results? Below is my input program.

begin:control
  nx = 2500
  ny = 350 
  nz = 350 
  t_end = 200 * femto
  x_min = 0
  x_max = 50*micron
  y_min = -7*micron
  y_max = 7*micron
  dt_multiplier = 0.8
  # dlb_threshold = 0.8
  # field_order = 2
  # maxwell_solver = yee
  # restart_snapshot = 98
  stdout_frequency = 10
end:control

begin:boundaries
  bc_x_min = simple_laser
  bc_x_max = simple_outflow
  bc_y_min = open
  bc_y_max = open
end:boundaries

begin:constant
  lambda0 = 0.8 * micron
  w_0 = 3 * micron
  r = sqrt(y^2)
  k = 2.0 * pi / lambda0  

  n_c = 1.7e27
  n_e = 25*n_c
  R_0 = sqrt(y^2)
  r_x = (1/30)*x+0.4*micron    

  wo=7* micron
  x0=40* micron+2* micron*exp-((y^2)/wo^2)
end:constant

begin:laser
  boundary = x_min
  intensity_w_cm2 = 4.51e22
  lambda = lambda0
  pol_angle = pi/2
  profile = gauss(time, 24*femto, 12*femto)
  t_profile = gauss(time, 24*femto, 12*femto)
  phase = pi/2
end:laser

begin:laser
  boundary = x_min
  intensity_w_cm2 = 4.51e22
  lambda = lambda0
  pol_angle = pi/2
  t_profile = gauss(time, 24*femto, 12*femto)
  profile = gauss(time, 24*femto, 12*femto)
  phase = 0
end:laser

begin:qed

  # These are the parts that control the QED sections of EPOCH
  use_qed = T # Turn on or off QED. If you're normally running without QED then
              # don't compile with -DPHOTONS

  qed_start_time = 0 # Time after which QED effects should start.

  produce_photons = T # Should the code actually produce and track photons.
                      # If F then the code calculates the recoil due to emitting
                      # photons, but the photon is not tracked. qed must be on
                      # to Ever produce photons

  photon_energy_min = 1 * mev # Minimum energy for a tracked photon. Photons
                               # emitted with lower energy still cause electron
                               # recoil but are not tracked

  produce_pairs = F # Whether or not to activate the module for pair production
                    # by the Breit-Wheeler process. Both qed and
                    # produce_photons must be on to produce pairs

  photon_dynamics = T # Quite often you're more interested in where photons are
                      # generated than where they propagate to. This option
                      # stops the core code from moving the photons.
                      # This is also much faster.
  use_radiation_reaction = T
end:qed

begin:species
  name = electron
  charge = -1.0
  mass = 1.0
  number_density = if((x gt 3*micron) and (x lt 18*micron) and (R_0 lt r_x), n_e, 0)
  number_density = if((x gt x0) and (x lt 44*micron),555*n_c,number_density(electron))
  npart_per_cell = 1
  identify:electron
end:species

begin:species
  name = Aluminium
  charge = 5.0
  mass = 1837*27
  number_density = if((x gt x0) and (x lt 44*micron),111*n_c,0)
  npart_per_cell = 1
  immobile=T
  identify:electron
end:species

begin:species
  name = proton
  mass = 1836
  number_density = if((x gt 3*micron) and (x lt 18*micron) and (R_0 lt r_x), n_e, 0)
  charge = 1
  npart_per_cell = 1
  identify:proton
end:species

begin:species
  name = photon
  nparticles = 0 # nparticles=0 since there are no initial photons in the system
  dump = T
  # This is the key line here. It identifies that this species is a photon
  # species. Without this line this species won't work properly. Presently you
  # can't specify initial conditions for photons.
  identify:photon
end:species

begin:species

  name = positron
  nparticles = 0 # nparticles=0 since no initial positrons in the system
  dump = T

  # This identifies this species as a positron. In most senses it's still a
  # normal charged particle species. You can specify initial conditions as
  # normal. If you identify multiple species as positrons then the QED routines
  # will produce the positrons from pairs in the first specified positron
  # species. If you want to specify which positron species should receive pair
  # positrons then identify it using identify:breit_wheeler_positron

  identify:positron

end:species

begin:output
  name = number_density  
  file_prefix = number_density 
  number_density = always + species + single + no_sum
  dt_snapshot = 3*femto
  time_start = 0*femto
end:output

begin:output
  name = dist_fn
  file_prefix = dist_fn
  dt_snapshot = 1* femto
  distribution_functions = always
end:output

begin:dist_fn
    name = en
    ndims = 1
    dumpmask = always
    direction1 = dir_en
    range1 = (0,2000*mev)
    resolution1 = 1000
    include_species: electron

end:dist_fn

begin:dist_fn
    name = en
    ndims = 1
    dumpmask = always
    direction1 = dir_en
    range1 = (0,500*mev)
    resolution1 = 1000
    include_species: photon
end:dist_fn

begin:output
  name = total_energy_sum
  file_prefix = total_energy_sum
  total_energy_sum  = always + single + species + no_sum
  dt_snapshot = 1*femto
end:output
Status-Mirror commented 2 weeks ago

Hi @Garnet5867,

I've seen these flags before when running similar simulations, but I've never encountered any problems with the code or results itself.

Cheers, Stuart