MCPcopy Create free account
hub / github.com/BLAST-WarpX/warpx / InitIonizationModule

Method InitIonizationModule

Source/Particles/PhysicalParticleContainer.cpp:1580–1665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1578}
1579
1580void
1581PhysicalParticleContainer::InitIonizationModule ()
1582{
1583 if (!do_field_ionization) { return; }
1584 const ParmParse pp_species_name(species_name);
1585 if (m_charge != PhysConst::q_e){
1586 ablastr::warn_manager::WMRecordWarning("Species",
1587 "charge != q_e for ionizable species '" +
1588 species_name + "':" +
1589 "overriding user value and setting charge = q_e.");
1590 m_charge = PhysConst::q_e;
1591 }
1592 utils::parser::queryWithParser(pp_species_name, "do_adk_correction", do_adk_correction);
1593
1594 utils::parser::queryWithParser(
1595 pp_species_name, "ionization_initial_level", ionization_initial_level);
1596 pp_species_name.get("ionization_product_species", ionization_product_name);
1597 pp_species_name.get("physical_element", physical_element);
1598 WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
1599 physical_element == "H" || !do_adk_correction,
1600 "Correction to ADK by Zhang et al., PRA 90, 043410 (2014) only works with Hydrogen");
1601 // Add runtime integer component for ionization level
1602 if (!HasiAttrib("ionizationLevel")) {
1603 AddIntComp("ionizationLevel");
1604 }
1605 // Get atomic number and ionization energies from file
1606 const int ion_element_id = utils::physics::ion_map_ids.at(physical_element);
1607 ion_atomic_number = utils::physics::ion_atomic_numbers[ion_element_id];
1608 Vector<Real> h_ionization_energies(ion_atomic_number);
1609 const int offset = utils::physics::ion_energy_offsets[ion_element_id];
1610 for(int i=0; i<ion_atomic_number; i++){
1611 h_ionization_energies[i] =
1612 utils::physics::table_ionization_energies[i+offset];
1613 }
1614 // Compute ADK prefactors (See Chen, JCP 236 (2013), equation (2))
1615 // For now, we assume l=0 and m=0.
1616 // The approximate expressions are used,
1617 // without Gamma function
1618 constexpr auto a3 = PhysConst::alpha*PhysConst::alpha*PhysConst::alpha;
1619 constexpr auto a4 = a3 * PhysConst::alpha;
1620 constexpr Real wa = a3 * PhysConst::c / PhysConst::r_e;
1621 constexpr Real Ea = PhysConst::m_e * PhysConst::c2 /PhysConst::q_e *
1622 a4/PhysConst::r_e;
1623 constexpr Real UH = utils::physics::table_ionization_energies[0];
1624 const Real l_eff = std::sqrt(UH/h_ionization_energies[0]) - 1._rt;
1625
1626 const Real dt = WarpX::GetInstance().getdt(0);
1627
1628 ionization_energies.resize(ion_atomic_number);
1629 adk_power.resize(ion_atomic_number);
1630 adk_prefactor.resize(ion_atomic_number);
1631 adk_exp_prefactor.resize(ion_atomic_number);
1632
1633 Gpu::copyAsync(Gpu::hostToDevice,
1634 h_ionization_energies.begin(), h_ionization_energies.end(),
1635 ionization_energies.begin());
1636
1637 adk_correction_factors.resize(4);

Callers 1

Calls 5

queryWithParserFunction · 0.85
beginMethod · 0.80
endMethod · 0.80
dataMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected