Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Constant Speed, Random Direction Particle Generation
Posted 2015年7月9日 GMT-4 19:32 1 Reply
Please login with a confirmed email address before reporting spam
Hi,
I am trying to do a Monte Carlo simulation using the charged particle tracing module, but cannot seem to figure out how to properly use random functions (or equivalents) in the context of comsol. I have a 2 dimensional circular filament modeled in a 3 dimensional model of an ionization chamber, and from that filament I want to have electrons emitted. I set the filament (which is obviously just a boundary) as an inlet, and have tried using the initial velocity setting "Constant speed, hemispherical", but regardless of the sampling from distribution setting (either "Deterministic" or "Random"), the particles don't have different velocity distributions (even with the "Generate random arguments" setting selected in the Charged Particle Tracing node). Additionally, it seems that this setting discretizes the hemisphere into only N_vel separate possible velocities. I would like to have it so that if only one particle is released at a time, it would be released with a uniformly distributed velocity direction within the specified hemisphere.
I could potentially just randomly set the components of the velocity direction vector for each particle, but I cannot seem to figure out a way to uniquely seed the random functions. I understand that I can use the cpt.pidx variable and/or the t variable (if each particle is released at a different time) to uniquely seed each particle, but these seeds would remain the same every time the study is run. Ideally, there would be a way to access the time (not the time in the time-dependent study, but the actual current time in seconds from the epoch) to use as an additional seed argument for each particle.
I would also like to be able to have the particles initial position be randomly placed on the filament, but I have only found options for the particles to be uniformly distributed or some user defined density distribution.
Does anyone know of any ways to implement such a Monte Carlo model in comsol?
Thanks
I am trying to do a Monte Carlo simulation using the charged particle tracing module, but cannot seem to figure out how to properly use random functions (or equivalents) in the context of comsol. I have a 2 dimensional circular filament modeled in a 3 dimensional model of an ionization chamber, and from that filament I want to have electrons emitted. I set the filament (which is obviously just a boundary) as an inlet, and have tried using the initial velocity setting "Constant speed, hemispherical", but regardless of the sampling from distribution setting (either "Deterministic" or "Random"), the particles don't have different velocity distributions (even with the "Generate random arguments" setting selected in the Charged Particle Tracing node). Additionally, it seems that this setting discretizes the hemisphere into only N_vel separate possible velocities. I would like to have it so that if only one particle is released at a time, it would be released with a uniformly distributed velocity direction within the specified hemisphere.
I could potentially just randomly set the components of the velocity direction vector for each particle, but I cannot seem to figure out a way to uniquely seed the random functions. I understand that I can use the cpt.pidx variable and/or the t variable (if each particle is released at a different time) to uniquely seed each particle, but these seeds would remain the same every time the study is run. Ideally, there would be a way to access the time (not the time in the time-dependent study, but the actual current time in seconds from the epoch) to use as an additional seed argument for each particle.
I would also like to be able to have the particles initial position be randomly placed on the filament, but I have only found options for the particles to be uniformly distributed or some user defined density distribution.
Does anyone know of any ways to implement such a Monte Carlo model in comsol?
Thanks
1 Reply Last Post 2015年7月10日 GMT-4 10:31