ne10_species = Species(elements.neon, 10, ne10_distribution) # define species plasma.b_field = ConstantVector3D(Vector3D(1.0, 1.0, 1.0)) plasma.electron_distribution = e_distribution plasma.composition = [d_species, he2_species, c6_species, ne10_species] # BEAM ------------------------------------------------------------------------ beam = Beam(parent=world, transform=translate(1.0, 0.0, 0) * rotate(90, 0, 0)) beam.plasma = plasma beam.atomic_data = adas beam.energy = 60000 beam.power = 3e6 beam.element = elements.deuterium beam.sigma = 0.025 beam.divergence_x = 0.5 beam.divergence_y = 0.5 beam.length = 3.0 beam.attenuator = SingleRayAttenuator(clamp_to_zero=True) beam.models = [ BeamCXLine(Line(elements.helium, 1, (4, 3))), BeamCXLine(Line(elements.helium, 1, (6, 4))), BeamCXLine(Line(elements.carbon, 5, (8, 7))), BeamCXLine(Line(elements.carbon, 5, (9, 8))), BeamCXLine(Line(elements.carbon, 5, (10, 8))), BeamCXLine(Line(elements.neon, 9, (11, 10))), BeamCXLine(Line(elements.neon, 9, (12, 11))), ] beam.integrator.step = integration_step beam.integrator.min_samples = 10
adas = OpenADAS(permit_extrapolation=True, missing_rates_return_null=True) integration_step = 0.0025 beam_transform = translate(-0.5, 0.0, 0) * rotate_basis( Vector3D(1, 0, 0), Vector3D(0, 0, 1)) beam_energy = 50000 # keV beam_full = Beam(parent=world, transform=beam_transform) beam_full.plasma = plasma beam_full.atomic_data = adas beam_full.energy = beam_energy beam_full.power = 3e6 beam_full.element = deuterium beam_full.sigma = 0.05 beam_full.divergence_x = 0.5 beam_full.divergence_y = 0.5 beam_full.length = 3.0 beam_full.attenuator = SingleRayAttenuator(clamp_to_zero=True) beam_full.models = [BeamCXLine(Line(carbon, 5, (8, 7)))] beam_full.integrator.step = integration_step beam_full.integrator.min_samples = 10 beam_half = Beam(parent=world, transform=beam_transform) beam_half.plasma = plasma beam_half.atomic_data = adas beam_half.energy = beam_energy / 2 beam_half.power = 3e6 beam_half.element = deuterium beam_half.sigma = 0.05 beam_half.divergence_x = 0.5
# PLASMA ---------------------------------------------------------------------- plasma = build_slab_plasma(peak_density=5e19, world=world) integration_step = 0.0025 beam_transform = translate(-0.000001, 0.0, 0) * rotate_basis( Vector3D(1, 0, 0), Vector3D(0, 0, 1)) beam_full = Beam(parent=world, transform=beam_transform) beam_full.plasma = plasma beam_full.atomic_data = adas beam_full.energy = 100000 beam_full.power = 3e6 beam_full.element = hydrogen beam_full.sigma = 0.05 beam_full.divergence_x = 0.5 beam_full.divergence_y = 0.5 beam_full.length = 3.0 beam_full.attenuator = SingleRayAttenuator(clamp_to_zero=True) beam_full.integrator.step = integration_step beam_full.integrator.min_samples = 10 ############################ # Try converting to Renate # import pandas as pd from lxml import etree from crm_solver.beamlet import Beamlet # build species specifications, starting with electrons charges = [-1]
bes_full_model = BeamEmissionLine(Line(deuterium, 0, (3, 2)), sigma_to_pi=SIGMA_TO_PI, sigma1_to_sigma0=SIGMA1_TO_SIGMA0, pi2_to_pi3=PI2_TO_PI3, pi4_to_pi3=PI4_TO_PI3) beam_full = Beam(parent=world, transform=beam_transform) beam_full.plasma = plasma beam_full.atomic_data = adas beam_full.energy = beam_energy beam_full.power = 3e6 # beam_energy * beam_current beam_full.temperature = beam_temperature beam_full.element = deuterium beam_full.sigma = beam_sigma beam_full.divergence_x = beam_divergence beam_full.divergence_y = beam_divergence beam_full.length = beam_length beam_full.attenuator = SingleRayAttenuator(clamp_to_zero=True) beam_full.models = [bes_full_model] beam_full.integrator.step = integration_step beam_full.integrator.min_samples = 10 bes_half_model = BeamEmissionLine(Line(deuterium, 0, (3, 2)), sigma_to_pi=SIGMA_TO_PI, sigma1_to_sigma0=SIGMA1_TO_SIGMA0, pi2_to_pi3=PI2_TO_PI3, pi4_to_pi3=PI4_TO_PI3) beam_half = Beam(parent=world, transform=beam_transform) beam_half.plasma = plasma
def __init__(self, pini_geometry, pini_parameters, plasma, atomic_data, attenuation_instructions, emission_instructions, integration_step=0.02, parent=None, name=""): source, direction, divergence, initial_width, length = pini_geometry energy, power_fractions, self._turned_on_func, element = pini_parameters self._components = [] self._length = length self._parent_reminder = parent # Rotation between 'direction' and the z unit vector # This is important because the beam primitives are defined along the z axis. self._origin = source self._direction = direction direction.normalise() rotation = rotate_basis(direction, Vector3D(0., 0., 1.)) transform_pini = translate(*source) * rotation Node.__init__(self, parent=parent, transform=transform_pini, name=name) attenuation_model_class, attenuation_model_arg = attenuation_instructions # the 3 energy components are different beams for comp_nb in [1, 2, 3]: # creation of the attenuation model # Note that each beamlet needs its own attenuation class instance. attenuation_model = attenuation_model_class( **attenuation_model_arg) # creation of the emission models emission_models = [] for (emission_model_class, argument_dictionary) in emission_instructions: emission_models.append( emission_model_class(**argument_dictionary)) beam = Beam(parent=self, transform=translate(0., 0., 0.), name="Beam component {}".format(comp_nb)) beam.plasma = plasma beam.atomic_data = atomic_data beam.energy = energy / comp_nb beam.power = power_fractions[comp_nb - 1] beam.element = element beam.sigma = initial_width beam.divergence_x = divergence[0] beam.divergence_y = divergence[1] beam.length = length beam.attenuator = attenuation_model beam.models = emission_models beam.integrator.step = integration_step beam.integrator.min_samples = 10 self._components.append(beam)