Answers for "yt derived field"

C
0

yt derived field

import yt
from yt.units import dimensions

def _pressure(field, data):
    return (data.ds.gamma - 1.0) * \
          data["density"] * data["thermal_energy"]

yt.add_field(("gas","pressure"), function=_pressure, units="auto",
             dimensions=dimensions.pressure)
Posted by: Guest on November-13-2020

Code answers related to "C"

Browse Popular Code Answers by Language