svalinn / r2s-act

Rigorous 2 Step Activation Workflow
4 stars 7 forks source link

Provide total photon source strength prior to running MCNP #52

Closed erelson closed 11 years ago

erelson commented 11 years ago

This is related to #47

In the structured workflow, write_gammas.py calculates the total photon source strength (via product of voxel volumes and source densities). The file phtn_src_total is then created, listing this value, which is useful for properly normalizing tallies via FM cards in MCNP's input.

The unstructured workflow does the source strength calculation in source.F90, so we don't currently have this information when setting up photon transport. This should be remedied.

Probable solution is to tack on another python script (basically the pytaps example, which calculates volumes of voxels) to r2s_step2.py.

erelson commented 11 years ago

Update: I have moved volume calculation code in python to a separate script, scripts/r2s/volumes.py. The same functions are useful for both write_alara_geom.py and write_gammas.py.

I have partially refactored write_gammas.py to use these functions. That code lives in my own branch, write_gammas_refactor, since I don't want to take the time to make sure everything is robust, just yet (thesis!). Correspondingly my branch has a few changes in r2s_step2.py which result in phtn_src_total files being generated for unstructured calculations.

Eventually I anticipate removing the scdmesh-specific volume calculation code in write_gammas.py. Replacing this with contents of volumes.py might be a bit slower (since it goes through MOAB more, rather than doing a bunch of algebra), but the simpler code is probably for the better. write_gammas.py might also be better named, since the unstructured workflow does not use it to generate the 'gammas' file.

erelson commented 11 years ago

I fixed the tests for the changes made. Commits were pushed to master a couple of days ago.

Primary commit of interest: 9e2d73e4e3f5b62dcae767477f5cb090b19c7f7e