From 62e3c27ba4a1e5876fef3a7112e450efcf2e68a3 Mon Sep 17 00:00:00 2001 From: csendlinger Date: Mon, 24 Feb 2025 15:12:54 +0100 Subject: [PATCH] Added adapted example json script; small bugfix --- .../parameter_katrin_drawing.json | 912 ++++++++++++++++++ src/generators/vector_field_generator.cpp | 2 +- 2 files changed, 913 insertions(+), 1 deletion(-) create mode 100755 simulation_config/parameter_katrin_drawing.json diff --git a/simulation_config/parameter_katrin_drawing.json b/simulation_config/parameter_katrin_drawing.json new file mode 100755 index 0000000..ed0d524 --- /dev/null +++ b/simulation_config/parameter_katrin_drawing.json @@ -0,0 +1,912 @@ +{ + "GlobalPositionBinning": { + "CylinderBinning": { + "Radial": { + "NumberOfBins": 5, + "MaxRadius": { + "value": 4.5, + "unit": "cm" + } + }, + "Longitudinal": { + "NumberOfBins": 50, + "MaxLength": { + "value": 1657, + "unit": "cm" + } + }, + "Azimuthal": { + "NumberOfBins": 1 + } + } + }, + "SourceGeometry": { + "Cylinder": { + "Radius": { + "value": 4.5, + "unit": "cm" + }, + "Height": { + "value": 1657, + "unit": "cm" + } + } + }, + "Species": { + "Background": { + "TritiumGas": { + "ParticleType": "T2", + "ConstantDensityField": { + "ScalarField": { + "ScalarFieldFunctionInZ": { + "zFunction": { + "Product": { + "fi": { + "Constant": { + "constant": 1 + } + }, + "fj": { + "Constant": { + "constant": 1 + } + }, + "fk": { + "PiecewiseLinearFromFile": { + "PathToH5": { + "Type": "RelativeToHomebase", + "RelativePath": "data/densityDistributions/T2", + "Filename": "T2_n_vs_z_kuckert_approximated_relative.h5" + }, + "xValuesKey": "/z_position(m)", + "yValuesKey": "/n(m3)", + "prefactor": 1E20 + } + } + } + } + } + } + }, + "VelocityDistribution": { + "VelocityDistributionFromFunction": { + "VelocityDistributionFunction": { + "IsotropicDistribution": { + "EnergyDistributionFunction": { + "MaxwellBoltzmann": { + "Temperature": { + "value": 80, + "unit": "K" + } + } + }, + "Mass": { + "FromParticleType": "T2" + } + } + } + } + }, + "DriftVelocity": { + "VectorField": { + "VectorFieldFunctionInZ": { + "zFunction": { + "Product": { + "fi": { + "Constant": { + "constant": 1 + } + }, + "fj": { + "Constant": { + "constant": 1 + } + }, + "fk": { + "PiecewiseLinearFromFile": { + "PathToH5": { + "Type": "RelativeToHomebase", + "RelativePath": "data/velocityDistributions/T2_vz/KuckertPaper", + "Filename": "T2_vz_vs_z_kuckert_approximated.h5" + }, + "xValuesKey": "/z_position(m)", + "yValuesKey": "/vz(ms)", + "prefactor": 1 + } + } + } + } + } + } + } + } + }, + "Tracked": { + "e-": { + "ParticleType": "electron", + "Mover": { + "Drift": { + "MaximalMovedDistance": { + "value": 1E-3, + "unit": "m" + } + } + }, + "Terminator": { + "MaximumInteractions": 1E6, + "MaxTimeAlive": { + "value": 1, + "unit": "s" + }, + "BoundaryGeometry": { + "Cylinder": { + "Radius": { + "value": 4.5, + "unit": "cm" + }, + "Height": { + "value": 1657, + "unit": "cm" + } + } + } + }, + "Reflector": { + "ReflectorDPS": { + "position_z": { + "value": 1657, + "unit": "cm" + } + } + }, + "DensityField": { + "DynamicDensityField": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + }, + "EnergyBinning": { + "Type": "Logarithmic", + "NumberOfBins": 10, + "MinEnergy": { + "value": 1E-6, + "unit": "eV" + }, + "MaxEnergy": { + "value": 20E3, + "unit": "eV" + } + }, + "PitchAngleBinning": { + "Type": "Linear", + "NumberOfBins": 15 + } + } + }, + "VelocityDistribution": { + "null": {} + }, + "DriftVelocity": { + "null": {} + }, + "Loggers": { + "Deletion": { + "Type": "all" + } + }, + "CurrentCollector": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + } + }, + "Interactions": { + "elastic": { + "Type": "ElasticScattering", + "Target": "TritiumGas", + "CrossSection": { + "PredefinedFunction": "eT2_elastic_scattering" + }, + "ScatteringAngleDistribution": { + "CompositeAngleDistribution": { + "LowerDistribution": { + "Isotropic": {} + }, + "HigherDistribution": { + "AngleDistributionFromFile": { + "PathToH5": { + "Type": "RelativeToHomebase", + "RelativePath": "data/crossSections/eT2_elastic_scattering", + "Filename": "eT2_elastic_cross_section_scattering_angle.h5" + } + } + }, + "DeciderEnergy": { + "value": 10, + "unit": "eV" + } + } + } + }, + "ionization1": { + "Type": "ElectronIonization", + "IonizationModel": "JanevNonDiss", + "Target": "TritiumGas", + "OutgoingElectron": "e-", + "OutgoingIon": "T2+" + }, + "ionization2": { + "Type": "ElectronIonization", + "IonizationModel": "JanevDissToGround", + "Target": "TritiumGas", + "OutgoingElectron": "e-", + "OutgoingIon": "T+" + }, + "ionization3": { + "Type": "ElectronIonization", + "IonizationModel": "JanevDissToFirstExcited", + "Target": "TritiumGas", + "OutgoingElectron": "e-", + "OutgoingIon": "T+" + }, + "excitation0": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_B1" + }, + "excitation1": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_B1prime" + }, + "excitation2": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_B1primeprime" + }, + "excitation3": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_C1" + }, + "excitation4": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_D1" + }, + "excitation5": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_D1prime" + }, + "excitation6": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_symmetry_forbidden_EF1" + }, + "excitation7": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_symmetry_forbidden_HHb" + }, + "excitation8": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_symmetry_forbidden_GK1" + }, + "excitation9": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_singlet_symmetry_forbidden_I1" + }, + "excitation10": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_triplet_A3" + }, + "excitation11": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_triplet_B3" + }, + "excitation12": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_triplet_C3" + }, + "excitation13": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_triplet_E3" + }, + "excitation14": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_triplet_D3" + }, + "excitation15": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_vibrational_first" + }, + "excitation16": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "janev_vibrational_second" + }, + "excitation17": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "england_rotational_j0_to_j2" + }, + "excitation18": { + "Type": "Excitation", + "Target": "TritiumGas", + "ExcitationState": "england_rotational_j1_to_j3" + } + } + }, + "T2+": { + "ParticleType": "T2+", + "Mover": { + "Drift": { + "MaximalMovedDistance": { + "value": 1E-3, + "unit": "m" + } + } + }, + "Terminator": { + "MaximumInteractions": 1E6, + "MaxTimeAlive": { + "value": 1, + "unit": "s" + }, + "BoundaryGeometry": { + "Cylinder": { + "Radius": { + "value": 4.5, + "unit": "cm" + }, + "Height": { + "value": 1657, + "unit": "cm" + } + } + } + }, + "Reflector": { + "NoReflector": {} + }, + "DensityField": { + "DynamicDensityField": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + }, + "EnergyBinning": { + "Type": "Logarithmic", + "NumberOfBins": 10, + "MinEnergy": { + "value": 1E-6, + "unit": "eV" + }, + "MaxEnergy": { + "value": 1E3, + "unit": "eV" + } + }, + "PitchAngleBinning": { + "Type": "Linear", + "NumberOfBins": 15 + } + } + }, + "VelocityDistribution": { + "null": {} + }, + "DriftVelocity": { + "null": {} + }, + "Loggers": { + "Deletion": { + "Type": "all" + } + }, + "CurrentCollector": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + } + }, + "Interactions": { + "charge exchange": { + "Type": "ChargeExchange", + "Target": "TritiumGas", + "CrossSection": { + "PredefinedFunction": "T2pT2_charge_exchange_janev" + } + }, + "clustering": { + "Type": "Clustering", + "Target": "TritiumGas", + "Product": "T3+", + "CrossSection": { + "PredefinedFunction": "T2pT2_clustering_janev" + } + }, + "free_movement_example": { + "Type": "FreeMovement" + } + } + }, + "T+": { + "ParticleType": "T+", + "Mover": { + "Boris": { + "BorisStepsPerMovementCylce": 10, + "MaximalTimestepLength": { + "value": 1E-8, + "unit": "s" + } + } + }, + "Terminator": { + "MaximumInteractions": 1E6, + "MaxTimeAlive": { + "value": 1, + "unit": "s" + }, + "BoundaryGeometry": { + "Cylinder": { + "Radius": { + "value": 4.5, + "unit": "cm" + }, + "Height": { + "value": 1657, + "unit": "cm" + } + } + } + }, + "Reflector": { + "NoReflector": {} + }, + "DensityField": { + "DynamicDensityField": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + }, + "EnergyBinning": { + "Type": "Logarithmic", + "NumberOfBins": 10, + "MinEnergy": { + "value": 1E-6, + "unit": "eV" + }, + "MaxEnergy": { + "value": 1E3, + "unit": "eV" + } + }, + "PitchAngleBinning": { + "Type": "Linear", + "NumberOfBins": 15 + } + } + }, + "VelocityDistribution": { + "null": {} + }, + "DriftVelocity": { + "null": {} + }, + "Loggers": { + "Deletion": { + "Type": "all" + } + }, + "CurrentCollector": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + } + }, + "Interactions": { + "elastic scattering": { + "Type": "ElasticScattering", + "Target": "TritiumGas", + "CrossSection": { + "PredefinedFunction": "TpT2_elastic_scattering_tabata" + }, + "ScatteringAngleDistribution": { + "Isotropic": {} + } + }, + "clustering1": { + "Type": "Clustering", + "Target": "TritiumGas", + "Product": "T3+", + "CrossSection": { + "PredefinedFunction": "TpT2_clustering_radiative_ascendion_pasil" + } + }, + "clustering2": { + "Type": "Clustering", + "Target": "TritiumGas", + "Product": "T3+", + "CrossSection": { + "PredefinedFunction": "TpT2_clustering_tertiary_ascendion_pasil" + } + }, + "free_movement_example": { + "Type": "FreeMovement" + } + } + }, + "T3+": { + "ParticleType": "T3+", + "Mover": { + "Drift": { + "MaximalMovedDistance": { + "value": 1E-3, + "unit": "m" + } + } + }, + "Terminator": { + "MaximumInteractions": 1E6, + "MaxTimeAlive": { + "value": 1, + "unit": "s" + }, + "BoundaryGeometry": { + "Cylinder": { + "Radius": { + "value": 4.5, + "unit": "cm" + }, + "Height": { + "value": 1657, + "unit": "cm" + } + } + } + }, + "Reflector": { + "NoReflector": {} + }, + "DensityField": { + "DynamicDensityField": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + }, + "EnergyBinning": { + "Type": "Logarithmic", + "NumberOfBins": 10, + "MinEnergy": { + "value": 1E-6, + "unit": "eV" + }, + "MaxEnergy": { + "value": 1E3, + "unit": "eV" + } + }, + "PitchAngleBinning": { + "Type": "Linear", + "NumberOfBins": 15 + } + } + }, + "VelocityDistribution": { + "null": {} + }, + "DriftVelocity": { + "null": {} + }, + "Loggers": { + "Deletion": { + "Type": "all" + } + }, + "CurrentCollector": { + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + } + }, + "Interactions": { + "elastic scattering": { + "Type": "ElasticScattering", + "Target": "TritiumGas", + "CrossSection": { + "PredefinedFunction": "T3pT2_elastic_scattering_tabata" + }, + "ScatteringAngleDistribution": { + "Isotropic": {} + } + }, + "free_movement_example": { + "Type": "FreeMovement" + } + } + } + } + }, + "Injector": { + "CreatedSpecies": { + "specie1": { + "TrackedSpecieName": "e-", + "CreationVelocityDistribution": { + "VelocityDistributionFromFunction": { + "VelocityDistributionFunction": { + "IsotropicDistribution": { + "EnergyDistributionFunction": { + "TritiumBetaDecay": {} + }, + "Mass": { + "FromParticleType": "electron" + } + } + } + } + } + }, + "specie2": { + "TrackedSpecieName": "T2+", + "CreationVelocityDistribution": { + "VelocityDistributionFromFunction": { + "VelocityDistributionFunction": { + "IsotropicDistribution": { + "EnergyDistributionFunction": { + "MaxwellBoltzmann": { + "Temperature": { + "value": 80, + "unit": "K" + } + } + }, + "Mass": { + "FromParticleType": "T2" + } + } + } + } + } + } + }, + "EventPositionDistribution": { + "ScalarField": { + "ScalarFieldFunctionInZ": { + "zFunction": { + "Product": { + "fi": { + "Constant": { + "constant": 1 + } + }, + "fj": { + "Constant": { + "constant": 1 + } + }, + "fk": { + "PiecewiseLinearFromFile": { + "PathToH5": { + "Type": "RelativeToHomebase", + "RelativePath": "data/densityDistributions/T2", + "Filename": "T2_n_vs_z_kuckert_approximated_relative.h5" + }, + "xValuesKey": "/z_position(m)", + "yValuesKey": "/n(m3)", + "prefactor": 1 + } + } + } + } + } + }, + "DensityLimit": { + "min": 0, + "max": 1 + }, + "PositionLimits": { + "rPosition": { + "min": 0, + "max": 0.045 + }, + "phiPosition": { + "min": 0, + "max": 6.28318530718 + }, + "zPosition": { + "min": 0, + "max": 16.57 + } + } + }, + "MotherDriftVelocity": { + "VectorField": { + "VectorFieldFunctionInZ": { + "zFunction": { + "Product": { + "fi": { + "Constant": { + "constant": 1 + } + }, + "fj": { + "Constant": { + "constant": 1 + } + }, + "fk": { + "PiecewiseLinearFromFile": { + "PathToH5": { + "Type": "RelativeToHomebase", + "RelativePath": "data/velocityDistributions/T2_vz/KuckertPaper", + "Filename": "T2_vz_vs_z_kuckert_approximated.h5" + }, + "xValuesKey": "/z_position(m)", + "yValuesKey": "/vz(ms)", + "prefactor": 1 + } + } + } + } + } + } + }, + "Activity": { + "value": 1E7, + "unit": "Bq" + } + }, + "ElectricField": { + "Background": { + "VectorField": { + "VectorFieldConstant": { + "constant": { + "vector": [ + 0, + 0, + 0 + ] + }, + "unit": "V/m" + } + } + }, + "Dynamic": { + "VectorField": { + "VectorFieldConstant": { + "constant": { + "vector": [ + 0, + 0, + 0 + ] + }, + "unit": "V/m" + } + } + } + }, + "MagneticField": { + "VectorField": { + "VectorFieldFunctionInZ": { + "zFunction": { + "Constant3D": { + "constant": 2.5 + } + } + } + }, + "GradientField": { + "VectorFieldFunctionInZ": { + "zFunction": { + "Constant3D": { + "constant": 0 + } + } + } + } + }, + "GravityField": { + "VectorField": { + "VectorFieldFunctionInZ": { + "zFunction": { + "Constant3D": { + "constant": 0 + } + } + } + } + }, + "PoissonSolver": { + "BoundaryGeometry": { + "CreateSameAs": ["SourceGeometry"] + }, + "PositionBinning": { + "CreateSameAs": [ + "GlobalPositionBinning" + ] + }, + "Boundary": { + "Top": { + "type": "neumann", + "value": 0 + }, + "Bottom": { + "type": "dirichlet", + "value": 0 + }, + "Hull": { + "type": "dirichlet", + "value": 0 + } + }, + "TargetAccuracy": 1e-6, + "NumCycles": 2e4, + "DoSolver": "false" + }, + "Simulation": { + "NumberTimesteps": 10, + "EventStride": 1000, + "TimeResolutionEvents": 10, + "DensityEventsPerCPU": 1000, + "BetaDecayEventsPerCPU": 1000 + }, + "Output": { + "folder": "output", + "filename": "katrin_drawing", + "DensityFields": { + "Species": "all", + "Intervall": 1, + "OverwriteLast": "false" + }, + "CurrentBorders": { + "Species": "all", + "Intervall": "EachSync", + "OverwriteLast": "false" + }, + "DeletionLogger": { + "Species": "all", + "Intervall": "EachSync", + "OverwriteLast": "false" + }, + "PoissonSolver": { + "Intervall": 1, + "OverwriteLast": "false" + }, + "RestartInfo": { + "Intervall": 1, + "OverwriteLast": "false" + } + }, + "Restart" : { + "Do": "false", + "SyncPeriod": 2, + "PathToH5": { + "Type": "RelativeToHomebase", + "RelativePath": "output", + "Filename": "breakInMover3", + "comment": "if the restarted file and the output file are the same, the data that is restarted from is overwritten!" + } + }, + "RandomNumbers": { + "Seed": 1337 + } +} \ No newline at end of file diff --git a/src/generators/vector_field_generator.cpp b/src/generators/vector_field_generator.cpp index 3b41ee4..8d03fe7 100755 --- a/src/generators/vector_field_generator.cpp +++ b/src/generators/vector_field_generator.cpp @@ -20,7 +20,7 @@ std::string readAbsoluteFilename(json_t* object) { json_string(json_object_by_path(object, {"Filename"})); return homebase + "/" + relative_path_to_homebase + "/" + filename; - } else if (path_type == "AbsolutPath") { + } else if (path_type == "AbsolutePath") { std::string absolute_path = json_string(json_object_by_path(object, {"AbsoluteFolderPath"})); std::string filename =