[yt-svn] commit/yt: xarthisius: Merged in jzuhone/yt (pull request #2523)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Feb 23 07:54:10 PST 2017


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/ff20b94f7f7b/
Changeset:   ff20b94f7f7b
Branch:      yt
User:        xarthisius
Date:        2017-02-23 15:54:04+00:00
Summary:     Merged in jzuhone/yt (pull request #2523)

[bugfix] Allow mu to be set in the Gadget temperature definition via a field parameter Closes #1321

Approved-by: Nathan Goldbaum
Approved-by: Kacper Kowalik
Affected #:  1 file

diff -r 0150f2960194e9f105f4ff8063cc6735d35f9431 -r ff20b94f7f7b5bba93a0fa1f26beeebf82ecf8ae yt/frontends/gadget/fields.py
--- a/yt/frontends/gadget/fields.py
+++ b/yt/frontends/gadget/fields.py
@@ -83,8 +83,11 @@
                 # Assume cosmic abundances
                 x_H = 0.76
                 gamma = 5.0/3.0
-                # Assume zero ionization
-                mu = 4.0 / (3.0 * x_H + 1.0)
+                if data.has_field_parameter("mean_molecular_weight"):
+                    mu = data.get_field_parameter("mean_molecular_weight")
+                else:
+                    # Assume zero ionization
+                    mu = 4.0 / (3.0 * x_H + 1.0)
                 ret = data[ptype, "InternalEnergy"]*(gamma-1)*mu*mp/kb
                 return ret.in_units(self.ds.unit_system["temperature"])

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list