SKIRT / SKIRT9

SKIRT version 9 -- advanced radiative transfer in dusty systems
http://www.skirt.ugent.be
GNU Affero General Public License v3.0
36 stars 30 forks source link

Metallicity per cell? #36

Closed kpolsen closed 4 years ago

kpolsen commented 4 years ago

Description I'm using SpatialCellPropertiesProbe to print out the cell coordinates, with their volumes and densities etc. used by SKIRT. However, I would also be interested in the metallicity that SKIRT ended up adopting from the input metallicity that I supplied (in SPH format) - is there a way to have this quantity printed out? Perhaps with another probe that I overlooked?

Data I attach the ski file I'm using (h401_s135_G2.txt).

System SKIRT9, Linux

Context Using SKIRT to get attenuated FUV emission for further post-processing of SPH (fluid element) simulations with the aim of simulating FIR lines.

h401_s135_G2.txt

petercamps commented 4 years ago

Unfortunately not. The MediumSystem calculates the dust density in each cell by integrating the product (gas mass x metallicity x metal-to-dust ratio) over the volume, without keeping track of the intermediate results. Although the metal-to-dust ratio is equal to 1 in your ski file, you can still no longer disentangle the gas mass and metallicity in the calculated sums.

The current probes look at the data in the medium system. It would be possible to build a probe that calculates the average metallicity in each cell directly from the input data (i.e. integrating just the metallicity over the cell volume). While not overly difficult, it is also not a trivial undertaking. I estimate up to a day's work, including testing, for someone who knows the code well. If you like, you can put it on the wish list...

kpolsen commented 4 years ago

I see, thanks. It would be amazing with a probe (or an extension to the already existing SpatialCellPropertiesProbe) that can derive mass-weighted metallicity within each cell. It is a very useful output for people like me that intend to use Cloudy for line mission calculations after SKIRT. I'm afraid I don't know the code well enough to do that, or at least not in a day, but how do I put this on the wish list?

In the meantime, I'll go with the SPH-evaluated metallicity at the center of each SKIRT cell...

Sorry, one more additional question: You say that the metal-to-dust ratio is 1 in my ski file, how do I change that to for instance 0.2? I was looking at this tutorial but not understanding completely.

petercamps commented 4 years ago

I added the enhancement label, so this thread automatically ends up on the list of feature requests.

As for your second question, to adjust the metal-to-dust ratio, change the value of the massFraction attribute on the ParticleMedium element in the ski file from one to a fraction between zero and one.

kpolsen commented 4 years ago

Great - I'll look out for updates. And I found the massFraction attribute.