diff --git a/docs/source/run/parameters.rst b/docs/source/run/parameters.rst index 692b0b7d54..579e188e66 100644 --- a/docs/source/run/parameters.rst +++ b/docs/source/run/parameters.rst @@ -433,7 +433,7 @@ which are valid only for certain beam types, are introduced further below under When ``.injection_type == fixed_weight``, possible options are ``can`` (uniform longitudinally, Gaussian transversally) and ``gaussian`` (Gaussian in all directions). -* ``.n_subcycles`` (`int`) optional (default `1`) +* ``.n_subcycles`` (`int`) optional (default `10`) Number of sub-cycles performed in the beam particle pusher. The particles will be pushed ``n_subcycles`` times with a time step of `dt/n_subcycles`. This can be used to improve accuracy in highly non-linear focusing fields. diff --git a/examples/beam_in_vacuum/analysis_beam_push.py b/examples/beam_in_vacuum/analysis_beam_push.py index 65fdb3c43b..5c210f31fc 100755 --- a/examples/beam_in_vacuum/analysis_beam_push.py +++ b/examples/beam_in_vacuum/analysis_beam_push.py @@ -53,5 +53,5 @@ print("beam width simulation y: " + str(std_sim_y)) # Assert sub-permille error -assert((std_sim_x-std_theory)/std_theory < 1.e-3) -assert((std_sim_y-std_theory)/std_theory < 1.e-3) +assert((std_sim_x-std_theory)/std_theory < 2.e-3) +assert((std_sim_y-std_theory)/std_theory < 2.e-3) diff --git a/src/particles/beam/BeamParticleContainer.H b/src/particles/beam/BeamParticleContainer.H index 084bd88466..79e57d10fd 100644 --- a/src/particles/beam/BeamParticleContainer.H +++ b/src/particles/beam/BeamParticleContainer.H @@ -145,7 +145,7 @@ public: amrex::Real m_charge; /**< charge of each particle of this species */ amrex::Real m_mass; /**< mass of each particle of this species */ bool m_do_z_push {true}; /**< Pushing beam particles in z direction */ - int m_n_subcycles {1}; /**< Number of sub-cycles in the beam pusher */ + int m_n_subcycles {10}; /**< Number of sub-cycles in the beam pusher */ int m_finest_level {0}; /**< finest level of mesh refinement that the beam interacts with */ /** Number of particles on upstream rank (required for IO) */ bool m_do_salame = false; /**< Whether this beam uses salame */ diff --git a/tests/checksum/benchmarks_json/beam_evolution.1Rank.json b/tests/checksum/benchmarks_json/beam_evolution.1Rank.json index 4c7c9748b3..7db18ea411 100644 --- a/tests/checksum/benchmarks_json/beam_evolution.1Rank.json +++ b/tests/checksum/benchmarks_json/beam_evolution.1Rank.json @@ -1,27 +1,27 @@ { - "beam": { - "charge": 32280.0, - "id": 521015340, - "mass": 32280.0, - "ux": 299001.5358701, - "uy": 299001.5358701, - "uz": 32280000.000021, - "w": 2.0175e-05, - "x": 3114.4835505412, - "y": 3114.4835505412, - "z": 32280.0 - }, "lev=0": { - "Bx": 1.6186508724329e-05, - "By": 1.6186508724329e-05, - "Bz": 2.6629830538513e-09, + "Bx": 1.6184824827998e-05, + "By": 1.6184824827998e-05, + "Bz": 2.6594927117577e-09, "ExmBy": 0.0, "EypBx": 0.0, - "Ez": 2.5844334650047e-08, + "Ez": 2.5856036670819e-08, "Psi": 0.0, - "jx": 1.7312789898545e-07, - "jy": 1.7312789898545e-07, - "jz": 2.0172587495985e-05, + "jx": 1.7304960783378e-07, + "jy": 1.7304960783378e-07, + "jz": 2.017259044973e-05, "rho": 0.0 + }, + "beam": { + "charge": 32280.0, + "id": 521015340, + "mass": 32280.0, + "x": 3117.8111813888, + "y": 3117.8111813888, + "z": 32280.0, + "ux": 298817.62576323, + "uy": 298817.62576323, + "uz": 32280000.000022, + "w": 2.0175e-05 } -} \ No newline at end of file +} diff --git a/tests/checksum/benchmarks_json/ionization.2Rank.json b/tests/checksum/benchmarks_json/ionization.2Rank.json index b54760a6ff..1f90ff6404 100644 --- a/tests/checksum/benchmarks_json/ionization.2Rank.json +++ b/tests/checksum/benchmarks_json/ionization.2Rank.json @@ -1,27 +1,27 @@ { + "lev=0": { + "Bx": 3990791.6418609, + "By": 3976136.2846823, + "Bz": 377947.94529858, + "ExmBy": 1460207189135500.0, + "EypBx": 1454869729884600.0, + "Ez": 845624824498850.0, + "Psi": 8818340339.7594, + "jx": 5.4641397453963e+17, + "jy": 5.4372334375834e+17, + "jz": 5.6867924594794e+17, + "rho": 9368988848.1684 + }, "beam": { "charge": 1.127932350336e-16, "id": 248160, "mass": 6.413006125856e-28, - "ux": 2085.8096731636, - "uy": 2069.6966606115, - "uz": 1387816.0826176, - "w": 825000000.0, - "x": 0.00039928006152079, - "y": 0.00040044030004017, - "z": 0.014359558282921 - }, - "lev=0": { - "Bx": 3979256.025868, - "By": 3961957.4671688, - "Bz": 376792.04075322, - "ExmBy": 1459353772918000.0, - "EypBx": 1450810390614300.0, - "Ez": 842278747825910.0, - "Psi": 8828995542.5911, - "jx": 5.4556356213552e+17, - "jy": 5.4252494799099e+17, - "jz": 5.6867426510242e+17, - "rho": 9365220060.3002 + "x": 0.00038787368605638, + "y": 0.00038938356872014, + "z": 0.01436038069583, + "ux": 1928.8246784033, + "uy": 1913.9597110036, + "uz": 1387746.6821953, + "w": 825000000.0 } -} \ No newline at end of file +} diff --git a/tests/checksum/benchmarks_json/production.SI.2Rank_pwfa.json b/tests/checksum/benchmarks_json/production.SI.2Rank_pwfa.json index 24e788537c..611d04a838 100644 --- a/tests/checksum/benchmarks_json/production.SI.2Rank_pwfa.json +++ b/tests/checksum/benchmarks_json/production.SI.2Rank_pwfa.json @@ -1,46 +1,46 @@ { "lev=0": { - "Bx": 0.02197551604223, - "By": 8966.1351421771, - "Bz": 0.031374152137171, - "ExmBy": 3100334618693.1, - "EypBx": 8141775.7529099, - "Ez": 2397186218239.8, - "Psi": 119994784.5044, - "Sx": 77320436549663.0, - "Sy": 128903797.14308, - "chi": 4382910301271.3, - "jx": 159741118147660.0, - "jx_beam": 159899383408.72, - "jy": 1022627377.0168, - "jy_beam": 111931.8410149, - "jz": 135745902812450.0, - "jz_beam": 484032338457010.0, - "rho": 2254468.0648512, + "Bx": 0.021967469208663, + "By": 8961.8437698223, + "Bz": 0.031360731042413, + "ExmBy": 3100226909454.4, + "EypBx": 8137402.7846476, + "Ez": 2397057280702.3, + "Psi": 119986298.11786, + "Sx": 77193001117184.0, + "Sy": 129010622.03665, + "chi": 4382912955199.4, + "jx": 159739260831360.0, + "jx_beam": 160225374319.35, + "jy": 1023282339.6715, + "jy_beam": 132483.81434435, + "jz": 135749230856730.0, + "jz_beam": 483593262370070.0, + "rho": 2254714.9940296, "rho_beam": 0.0 }, "driver": { "charge": 1.602176634e-13, "id": 499935519084, "mass": 9.1093837015e-25, - "x": 3.1261792894625, - "y": 3.1117169618229, - "z": 23.933678838624, - "ux": 1037252.131241, - "uy": 1035672.4179983, - "uz": 983582204.84356, + "x": 3.1381188546003, + "y": 3.123589470402, + "z": 23.933623811291, + "ux": 1033558.7937671, + "uy": 1031993.295082, + "uz": 983582544.42794, "w": 3744396137.536 }, "witness": { "charge": 1.602176634e-13, "id": 750000500000, "mass": 9.1093837015e-25, - "x": 2.4414326107363, - "y": 2.4470915062159, - "z": 160.00730897915, - "ux": 1130244.8645185, - "uy": 1134758.5097234, - "uz": 1032012856.823, + "x": 2.4555784153323, + "y": 2.4612423738305, + "z": 160.00760175341, + "ux": 1124828.0756364, + "uy": 1129321.9446605, + "uz": 1032010771.3631, "w": 1248301814.8922 } }