[yt-dev] Issue #1326: Inconsistency between code_length / code_time and code_velocity in enzo_tiny_cosmology (yt_analysis/yt)

John ZuHone issues-reply at bitbucket.org
Mon Feb 27 08:27:46 PST 2017


New issue 1326: Inconsistency between code_length / code_time and code_velocity in enzo_tiny_cosmology
https://bitbucket.org/yt_analysis/yt/issues/1326/inconsistency-between-code_length

John ZuHone:

`code_velocity` and `code_length/code_time` should be the same units, but in `enzo_tiny_cosmology` this does not appear to be the case. Someone with more knowledge of Enzo should have a look at this--I tried to look but for cosmo sims the units are set in a way that is rather enzo-specific.

```python
import yt

ds = yt.load("enzo_tiny_cosmology/DD0046/DD0046")

dd = ds.all_data()

print(dd["velocity_divergence"].to("1/code_time"))
print(dd["velocity_divergence"].to("code_velocity/code_length"))

print(dd["velocity_magnitude"].to("code_velocity"))
print(dd["velocity_magnitude"].to("code_length/code_time"))
```

```pycon
# velocity_divergence check
YTArray([ 0.00186079,  0.00200255,  0.00191645, ..., -0.03508909,
       -0.04609586, -0.02762048]) 1/code_time

YTArray([ 0.09485985,  0.10208633,  0.09769683, ..., -1.78877676,
       -2.34988201, -1.40804124]) code_velocity/code_length

# velocity_magnitude check
YTArray([ 0.01237452,  0.01096058,  0.00971304, ...,  0.02039839,
        0.0223968 ,  0.02642769]) code_velocity

YTArray([ 0.00024274,  0.00021501,  0.00019053, ...,  0.00040014,
        0.00043934,  0.00051841]) code_length/code_time
```




More information about the yt-dev mailing list