Open ktangtar opened 1 year ago
For Absorption/Total_Laser_Energy_Injected_J
, each MPI rank keeps a variable called laser_inject_local
. This takes the laser intensity at each boundary cell (as specified in the laser block), multiplies it by cell area and simulation timestep, and estimates the injected energy. The laser_inject_local
sums energies from all cells and time-steps in the local rank. This is done in laser.F90
, and an MPI_ALLREDUCE
command in io/diagnostics.F90
produces the final global output.
For Total_Field_Energy_in_Simulation_J
, the calculation is performed in the calc_total_energy_sum
subroutine of io/calc_df.F90
. This calculates the sums of $E^2$ and $B^2$, and combines them to get the total EM energy density.
I was playing around with a more simple input deck (written below), and I found the following. If we inject two uniform lasers into a 1D simulation as in the below example, we get:
Total_Field_Energy_in_Simulation_J
= 4.0480e10Absorption/Total_Laser_Energy_Injected_J
= 2.0011e10Absorption/Fraction_of_Laser_Energy_Absorbed
= 2.0001Here, the Absorption/Total_Laser_Energy_Injected_J
sums each laser contribution independently. The Total_Field_Energy_in_Simulation_J
considers the super-posed fields. As another example, consider if we lauched the two lasers in anti-phase. Each laser may be firing into the simulation window, but they would interfere destructively and there would be no field energy in the simulation window. This is why the two numbers may differ.
The Absorption/Fraction_of_Laser_Energy_Absorbed
would appear to be quite useless here. In addition to being energetically impossible, it's also misleading as the simulation domain is too large for laser energy to escape.
Perhaps it would be a good idea to switch the Absorption/Total_Laser_Energy_Injected_J
to calculate the injected Poynting flux, or maybe the documentation should be altered to make the distinction between the diagnostics more clear. I'll leave the issue open while we figure out what we want to do.
Cheers, Stuart
begin:control
nx = 800
x_min = 0
x_max = 40.0e-6
t_end = 100.0e-15
end:control
begin:boundaries
bc_x_min = simple_laser
bc_x_max = open
end:boundaries
begin:laser
boundary = x_min
lambda = 1.0e-6
intensity_w_cm2 = 1.0e19
end:laser
begin:laser
boundary = x_min
lambda = 1.0e-6
intensity_w_cm2 = 1.0e19
end:laser
begin:output
dt_snapshot= 1.0e-15
absorption = always + single
total_energy_sum = always + single
ey = always
end:output
Thanks for the very thorough explanation!
Hi,
I have a simulation with no particles. I define two lasers at the x boundary. After they are both in, epoch gives me these two values: Total_Field_Energy_in_Simulation_J = 26.5354 Absorption/Total_Laser_Energy_Injected_J = 16.7829
I expect these to be the same, or the first one less than the second one. I would think "Total_Field_Energy_in_Simulation_J" may be straightforward to calculate, proportional to the square of the fields.
For "Total_Laser_Energy_Injected_J ", is it only looking at the energy of one laser? Or maybe calculating the energy of each laser separately and then adding them up? I think the correct way would be to add up both the fields of the laser at the boundary, and calculate the energy from that?
Regards, Kavin Tangtartharakul