it said “As described below, the total kinetic energy transferred by these swaps is computed by the fix and can be output. Dividing this quantity by time and the cross-sectional area of the simulation box yields a heat flux. The ratio of heat flux to the slope of the temperature profile is the thermal conductivity of the fluid, in appopriate units.”

Usually, the transferred total kinetic energy Ek in M-P method would flow in two opposite directions, then the heat flux should be calculated by Ek/time/area/2. However, in the above description, it seems that heat flux is calculated by Ek/time/area. Can anyone confirm that which is the correct way? Is it necessary to divide the heat flux by two?

I am using fix thermal/conductivity command to calculate thermal
conductivity with Muller-Plathe algorithm. In the description part of the
following link LAMMPS Molecular Dynamics Simulator
it said "As described below, the total kinetic energy transferred by these
swaps is computed by the fix and can be output. Dividing this quantity by
time and the cross-sectional area of the simulation box yields a heat flux.
The ratio of heat flux to the slope of the temperature profile is the
thermal conductivity of the fluid, in appopriate units."

Usually, the transferred total kinetic energy Ek in M-P method would flow in
two opposite directions, then the heat flux should be calculated by
Ek/time/area/2. However, in the above description, it seems that heat flux
is calculated by Ek/time/area. Can anyone confirm that which is the correct
way? Is it necessary to divide the heat flux by two?

have you looked through the mailing list archives?
this is a frequently asked (and answered question).

Usually, the transferred total kinetic energy Ek in M-P method would flow in two opposite directions, then the heat flux should be >calculated by Ek/time/area/2. However, in the above description, it seems that heat flux is calculated by Ek/time/area. Can anyone >confirm that which is the correct way? Is it necessary to divide the heat flux by two?

if your system is periodic, then yes it is necessary to include the factor of 2.
As the M-P paper formulas do. LAMMPS isn't reproducing the paper,
it's simply tallying heat flux, whether your system is periodic or not. It's
up to you to use that value appropriately.