[yt-svn] commit/yt: 3 new changesets

Bitbucket commits-noreply at bitbucket.org
Mon Jul 30 17:56:56 PDT 2012


3 new commits in yt:


https://bitbucket.org/yt_analysis/yt/changeset/0bb2842b11df/
changeset:   0bb2842b11df
branch:      yt
user:        jzuhone
date:        2012-07-30 22:22:02
summary:     This change makes the Entropy field accessible from any code, not just Enzo.

We accept an optional field parameter "mu" to compute the mean molecular weight, but if mu is not supplied, simply set it to 1.

Note that even under the original definition, the units are not "erg cm^2" but "erg cm^{3\gamma-3}". This is problematic for a spatially varying gamma (which this does not support) since the units of entropy would vary from place to place. Strictly speaking, the "real" entropy is the logarithm of this quantity plus a constant.
affected #:  1 file

diff -r 7001ce65f74775eee49b0437dc75b866423ea143 -r 0bb2842b11df27528482ce4dd8517f96f2974137 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -208,9 +208,13 @@
 add_field("Pressure", function=_Pressure, units=r"\rm{dyne}/\rm{cm}^{2}")
 
 def _Entropy(field, data):
-    return kboltz  * data["Temperature"] / \
-           (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-add_field("Entropy", units=r"\rm{ergs}\ \rm{cm}^{2}",
+    if data.has_field_parameter("mu"):
+        mw = mh*data.get_field_parameter("mu")
+    else :
+        mw = mh
+    return kboltz * data["Temperature"] / \
+           ((data["Density"]/mw)**(data.pf["Gamma"] - 1.0))
+add_field("Entropy", units=r"\rm{ergs}\ \rm{cm}^{3\gamma-3}",
           function=_Entropy)
 
 def _Height(field, data):



https://bitbucket.org/yt_analysis/yt/changeset/22421cfb1f3f/
changeset:   22421cfb1f3f
branch:      yt
user:        jzuhone
date:        2012-07-30 22:23:28
summary:     Merging
affected #:  58 files
Diff too large to display.

https://bitbucket.org/yt_analysis/yt/changeset/57cc32755e03/
changeset:   57cc32755e03
branch:      yt
user:        MatthewTurk
date:        2012-07-31 02:56:54
summary:     Merged in jzuhone/yt (pull request #228)
affected #:  1 file

diff -r c4e02b50dd32b303a2b0baa80caacd8b235858f4 -r 57cc32755e03015f25047e14a6df678f73f58a49 yt/data_objects/universal_fields.py
--- a/yt/data_objects/universal_fields.py
+++ b/yt/data_objects/universal_fields.py
@@ -208,9 +208,13 @@
 add_field("Pressure", function=_Pressure, units=r"\rm{dyne}/\rm{cm}^{2}")
 
 def _Entropy(field, data):
-    return kboltz  * data["Temperature"] / \
-           (data["NumberDensity"]**(data.pf["Gamma"] - 1.0))
-add_field("Entropy", units=r"\rm{ergs}\ \rm{cm}^{2}",
+    if data.has_field_parameter("mu"):
+        mw = mh*data.get_field_parameter("mu")
+    else :
+        mw = mh
+    return kboltz * data["Temperature"] / \
+           ((data["Density"]/mw)**(data.pf["Gamma"] - 1.0))
+add_field("Entropy", units=r"\rm{ergs}\ \rm{cm}^{3\gamma-3}",
           function=_Entropy)
 
 def _Height(field, data):

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