Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set remaining model lower limits to zero and make sure demo loop runs with integral approach off #490

Merged
merged 4 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/celeritas/em/data/MollerBhabhaData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ struct MollerBhabhaData
//! Electron mass * c^2 [MeV]
units::MevMass electron_mass;

//! Model's mininum energy limit [MeV]
static CELER_CONSTEXPR_FUNCTION units::MevEnergy min_valid_energy()
{
return units::MevEnergy{1e-3};
}
//! Model's maximum energy limit [MeV]
static CELER_CONSTEXPR_FUNCTION units::MevEnergy max_valid_energy()
{
Expand Down
5 changes: 1 addition & 4 deletions src/celeritas/em/interactor/MollerBhabhaInteractor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "celeritas/Constants.hh"
#include "celeritas/Quantities.hh"
#include "celeritas/em/data/MollerBhabhaData.hh"
#include "celeritas/em/distribution/BhabhaEnergyDistribution.hh"
#include "celeritas/em/distribution/MollerEnergyDistribution.hh"
#include "celeritas/phys/CutoffView.hh"
#include "celeritas/phys/Interaction.hh"
Expand All @@ -26,8 +27,6 @@
#include "celeritas/random/distribution/BernoulliDistribution.hh"
#include "celeritas/random/distribution/UniformRealDistribution.hh"

#include "detail/BhabhaEnergyDistribution.hh"

namespace celeritas
{
//---------------------------------------------------------------------------//
Expand Down Expand Up @@ -105,8 +104,6 @@ CELER_FUNCTION MollerBhabhaInteractor::MollerBhabhaInteractor(
{
CELER_EXPECT(particle.particle_id() == shared_.ids.electron
|| particle.particle_id() == shared_.ids.positron);
CELER_EXPECT(electron_cutoff_
>= value_as<Energy>(shared_.min_valid_energy()));
}

//---------------------------------------------------------------------------//
Expand Down
8 changes: 4 additions & 4 deletions src/celeritas/em/model/MollerBhabhaModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ MollerBhabhaModel::MollerBhabhaModel(ActionId id,
*/
auto MollerBhabhaModel::applicability() const -> SetApplicability
{
// TODO: potentially set lower energy bound based on (material-dependent)
// IonizationProcess lambda table energy grid to avoid invoking the
// interactor for tracks with energy below the interaction threshold

Applicability electron_applic, positron_applic;

// The electron applicability.lower is twice the one for positrons due to
// its maximum transferable energy fraction being 0.5 (which is 1/2 the
// positron's). This prevents it to run an infinite number of Moller
// sampling loops.
electron_applic.particle = interface_.ids.electron;
electron_applic.lower = zero_quantity();
electron_applic.upper = units::MevEnergy{interface_.max_valid_energy()};
Expand Down
2 changes: 1 addition & 1 deletion src/celeritas/em/model/MuBremsstrahlungModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ auto MuBremsstrahlungModel::applicability() const -> SetApplicability
Applicability mu_minus_applic, mu_plus_applic;

mu_minus_applic.particle = interface_.ids.mu_minus;
mu_minus_applic.lower = interface_.min_incident_energy();
mu_minus_applic.lower = zero_quantity();
mu_minus_applic.upper = interface_.max_incident_energy();

mu_plus_applic.particle = interface_.ids.mu_plus;
Expand Down
5 changes: 3 additions & 2 deletions src/celeritas/em/model/SeltzerBergerModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ SeltzerBergerModel::SeltzerBergerModel(ActionId id,
*/
auto SeltzerBergerModel::applicability() const -> SetApplicability
{
// TODO: bounds need to be adjusted based on BremsstrahlungProcess data and
// SB table data
// TODO: potentially set lower energy bound based on (material-dependent)
// BremsstrahlungProcess lambda table energy grid to avoid invoking the
// interactor for tracks with energy below the interaction threshold

Applicability electron_applic;
electron_applic.particle = this->host_ref().ids.electron;
Expand Down
2 changes: 1 addition & 1 deletion src/celeritas/phys/ParticleTrackView.hh
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ CELER_FUNCTION units::MevMomentumSq ParticleTrackView::momentum_sq() const
{
const real_type energy = this->energy().value();
real_type result = energy * energy + 2 * this->mass().value() * energy;
CELER_ENSURE(result > 0);
CELER_ENSURE(result >= 0);
sethrj marked this conversation as resolved.
Show resolved Hide resolved
return units::MevMomentumSq{result};
}

Expand Down