{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/44231422","id":44231422,"diff_hunk":"@@ -459,11 +470,17 @@ subroutine elastic_scatter(i_nuclide, rxn, E, uvw, mu_lab, wgt)\n     vel = sqrt(E)\n \n     ! compute cosine of scattering angle in LAB frame by taking dot product of\n-    ! neutron's pre- and post-collision angle\n-    mu_lab = dot_product(uvw, v_n) / vel\n+    ! neutron's pre- and post-collision unit vectors\n+    if (iso_lab) then\n+      uvw(1) = TWO * prn() - ONE\n+      phi = TWO * PI * prn()\n+      uvw(2) = cos(phi) * sqrt(ONE - uvw(1)*uvw(1))\n+      uvw(3) = sin(phi) * sqrt(ONE - uvw(1)*uvw(1))","path":"src/physics.F90","position":null,"original_position":167,"commit_id":"151fa4d47942a642ed8962d3904f326850233fe9","original_commit_id":"b59eacedebf4021e6f958879e86d8d0a78327df7","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"body":"I went ahead and consolidated the iso-in-lab scattering logic into `subroutine scatter` such that the `elastic_scatter`, `sab_scatter` and `inelastic_scatter` routines now remain the same as before. I would certainly like both @paulromano and @walshjon at the least to look at this to make sure that the new (greatly simplified) implementation will still perform as expected.","created_at":"2015-11-08T22:00:43Z","updated_at":"2015-11-08T22:00:43Z","html_url":"https://github.com/mit-crpg/openmc/pull/376#discussion_r44231422","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/376","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/44231422"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/376#discussion_r44231422"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/376"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/376","id":34139998,"html_url":"https://github.com/mit-crpg/openmc/pull/376","diff_url":"https://github.com/mit-crpg/openmc/pull/376.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/376.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/376","number":376,"state":"open","locked":false,"title":"Optional nuclide-based isotropic in lab scattering","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"body":"This pull request introduces the option to use isotropic-in-lab scattering on a nuclide-by-nuclide basis. The majority of the new code was graciously contributed by @walshjon at my request, with a few very minor additions of my own (to the Python API and documentation).\r\n\r\nThere is a new optional ``scattering`` attribute/sub-element for none, some or all nuclides in \"materials.xml\". The ``scattering`` attribute may be set to \"ace\" to use the scattering laws specified in the ACE files. Of course this is what is currently done, and will continue to be done by default. Alternatively, when set to \"lab\", the ACE scattering laws are used to sample the outgoing energy, but an isotropic-in-lab distribution is used to sample the outgoing angle at each scattering interaction (elastic or inelastic). \r\n\r\nI understand that there will likely be a lot of questions about why a user would ever want the capability to turn off this physics in the code. The reason we implemented this option is to do comparisons between Monte Carlo and deterministic codes. In particular, one may use OpenMC to compute multi-group cross-sections for a deterministic code. In this case, the ``scattering`` attribute may be used to quantify the effects of anisotropic scattering and the effect of applying various types of transport corrections to the total cross-section. Perhaps the other developers will decide that this feature is not useful enough to integrate into the core code - in this case, I still thought it might be helpful to submit this PR for anyone else out there who may find this option useful.","created_at":"2015-04-27T05:09:33Z","updated_at":"2015-11-08T22:00:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ed33bd13c99aa3bb462cc687ccc1d3fe2114a42","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/376/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/376/comments","review_comment_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/issues/376/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/151fa4d47942a642ed8962d3904f326850233fe9","head":{"label":"wbinventor:iso-lab","ref":"iso-lab","sha":"151fa4d47942a642ed8962d3904f326850233fe9","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"repo":{"id":17599847,"name":"openmc","full_name":"wbinventor/openmc","owner":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wbinventor/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/wbinventor/openmc","forks_url":"https://api.github.com/repos/wbinventor/openmc/forks","keys_url":"https://api.github.com/repos/wbinventor/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wbinventor/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wbinventor/openmc/teams","hooks_url":"https://api.github.com/repos/wbinventor/openmc/hooks","issue_events_url":"https://api.github.com/repos/wbinventor/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/wbinventor/openmc/events","assignees_url":"https://api.github.com/repos/wbinventor/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/wbinventor/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/wbinventor/openmc/tags","blobs_url":"https://api.github.com/repos/wbinventor/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wbinventor/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wbinventor/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/wbinventor/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wbinventor/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/wbinventor/openmc/languages","stargazers_url":"https://api.github.com/repos/wbinventor/openmc/stargazers","contributors_url":"https://api.github.com/repos/wbinventor/openmc/contributors","subscribers_url":"https://api.github.com/repos/wbinventor/openmc/subscribers","subscription_url":"https://api.github.com/repos/wbinventor/openmc/subscription","commits_url":"https://api.github.com/repos/wbinventor/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/wbinventor/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/wbinventor/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/wbinventor/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/wbinventor/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/wbinventor/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wbinventor/openmc/merges","archive_url":"https://api.github.com/repos/wbinventor/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wbinventor/openmc/downloads","issues_url":"https://api.github.com/repos/wbinventor/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/wbinventor/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/wbinventor/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/wbinventor/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wbinventor/openmc/labels{/name}","releases_url":"https://api.github.com/repos/wbinventor/openmc/releases{/id}","created_at":"2014-03-10T16:36:03Z","updated_at":"2015-05-07T21:04:05Z","pushed_at":"2015-11-08T21:57:35Z","git_url":"git://github.com/wbinventor/openmc.git","ssh_url":"git@github.com:wbinventor/openmc.git","clone_url":"https://github.com/wbinventor/openmc.git","svn_url":"https://github.com/wbinventor/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":28534,"stargazers_count":1,"watchers_count":1,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"39e246ed38bdcd42fcf2396a5d0ffd988970b664","user":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"repo":{"id":2081118,"name":"openmc","full_name":"mit-crpg/openmc","owner":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mit-crpg/openmc","description":"OpenMC Monte Carlo Code","fork":false,"url":"https://api.github.com/repos/mit-crpg/openmc","forks_url":"https://api.github.com/repos/mit-crpg/openmc/forks","keys_url":"https://api.github.com/repos/mit-crpg/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-crpg/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-crpg/openmc/teams","hooks_url":"https://api.github.com/repos/mit-crpg/openmc/hooks","issue_events_url":"https://api.github.com/repos/mit-crpg/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/mit-crpg/openmc/events","assignees_url":"https://api.github.com/repos/mit-crpg/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/mit-crpg/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/mit-crpg/openmc/tags","blobs_url":"https://api.github.com/repos/mit-crpg/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-crpg/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-crpg/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-crpg/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-crpg/openmc/languages","stargazers_url":"https://api.github.com/repos/mit-crpg/openmc/stargazers","contributors_url":"https://api.github.com/repos/mit-crpg/openmc/contributors","subscribers_url":"https://api.github.com/repos/mit-crpg/openmc/subscribers","subscription_url":"https://api.github.com/repos/mit-crpg/openmc/subscription","commits_url":"https://api.github.com/repos/mit-crpg/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-crpg/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-crpg/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-crpg/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/mit-crpg/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-crpg/openmc/merges","archive_url":"https://api.github.com/repos/mit-crpg/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-crpg/openmc/downloads","issues_url":"https://api.github.com/repos/mit-crpg/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/mit-crpg/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-crpg/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-crpg/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-crpg/openmc/labels{/name}","releases_url":"https://api.github.com/repos/mit-crpg/openmc/releases{/id}","created_at":"2011-07-21T00:33:27Z","updated_at":"2015-10-21T02:53:36Z","pushed_at":"2015-11-08T21:57:36Z","git_url":"git://github.com/mit-crpg/openmc.git","ssh_url":"git@github.com:mit-crpg/openmc.git","clone_url":"https://github.com/mit-crpg/openmc.git","svn_url":"https://github.com/mit-crpg/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":39720,"stargazers_count":61,"watchers_count":61,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"open_issues_count":39,"forks":85,"open_issues":39,"watchers":61,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/376"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/376"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/376"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/376/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/376/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/376/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/151fa4d47942a642ed8962d3904f326850233fe9"}}}}