Post · 3 min read· pp. 427–430

aerosandbox.atmosphere.thermodynamics.gas

Attributes

Classes

PerfectGasProvides a class for an ideal, calorically perfect gas.

Module Contents

aerosandbox.atmosphere.thermodynamics.gas.universal_gas_constant = 8.31432

class aerosandbox.atmosphere.thermodynamics.gas.PerfectGas(pressure=101325, temperature=273.15 + 15, specific_heat_constant_pressure=1006, specific_heat_constant_volume=717, molecular_mass=0.0289644, effective_collision_diameter=3.65e-10) : Provides a class for an ideal, calorically perfect gas.

code
Specifically, this gas:
:   - Has PV = nRT (ideal)
    - Has constant heat capacities C\_V, C\_P (independent of temperature and pressure).
    - Is in thermodynamic equilibrium
    - Is not chemically reacting
    - Has internal energy and enthalpy purely as functions of temperature

Parameters:
:   - **pressure** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
    - **temperature** (*Union**[**float**,* *aerosandbox.numpy.ndarray**]*) –
    - **specific\_heat\_constant\_pressure** (*float*) –
    - **specific\_heat\_constant\_volume** (*float*) –
    - **molecular\_mass** (*float*) –
    - **effective\_collision\_diameter** (*float*) –

pressure *= 101325*

temperature *= 288.15*

specific\_heat\_constant\_pressure *= 1006*

specific\_heat\_constant\_volume *= 717*

molecular\_mass *= 0.0289644*

effective\_collision\_diameter *= 3.65e-10*

\_\_repr\_\_()
:   Return type:
    :   str

*property* density

*property* speed\_of\_sound

*property* specific\_gas\_constant

*property* ratio\_of\_specific\_heats

specific\_enthalpy\_change(*start\_temperature*, *end\_temperature*)
:   Returns the change in specific enthalpy that would occur from a given temperature change via a thermodynamic
    process.

    Parameters:
    :   - **start\_temperature** – Starting temperature [K]
        - **end\_temperature** – Ending temperature [K]

    Returns: The change in specific enthalpy, in J/kg.

specific\_internal\_energy\_change(*start\_temperature*, *end\_temperature*)
:   Returns the change in specific internal energy that would occur from a given temperature change via a
    thermodynamic process.

    Parameters:
    :   - **start\_temperature** – Starting temperature [K]
        - **end\_temperature** – Ending temperature [K]

    Returns: The change in specific internal energy, in J/kg.

*property* specific\_volume
:   Gives the specific volume, often denoted v.

    (Note the lowercase; “V” is often the volume of a specific amount of gas, and this presents a potential point
    of confusion.)

*property* specific\_enthalpy
:   Gives the specific enthalpy, often denoted h.

    Enthalpy here is in units of J/kg.

*property* specific\_internal\_energy
:   Gives the specific internal energy, often denoted u.

    Internal energy here is in units of J/kg.

process(*process='isentropic'*, *new\_pressure=None*, *new\_temperature=None*, *new\_density=None*, *enthalpy\_addition\_at\_constant\_pressure=None*, *enthalpy\_addition\_at\_constant\_volume=None*, *polytropic\_n=None*, *inplace=False*)
:   Puts this gas under a thermodynamic process.

    Equations here: <https://en.wikipedia.org/wiki/Ideal_gas_law>

    Parameters:
    :   - **process** (*str*) –

          Type of process. One of:

          - ”isobaric”
          - ”isochoric”
          - ”isothermal”
          - ”isentropic”
          - ”polytropic”

          The process must be specified.
        - **arguments** (*You must specifiy exactly one* *of* *the following*) –

          - new\_pressure: the new pressure after the process [Pa].
          - new\_temperature: the new temperature after the process [K]
          - new\_density: the new density after the process [kg/m^3]
          - enthalpy\_addition\_at\_constant\_pressure: [J/kg]
          - enthalpy\_addition\_at\_constant\_volume: [J/kg]
        - **polytropic\_n** (*float*) – If you specified the process type to be “polytropic”, you must provide the polytropic index
        - **(****Reminder** (*n to be used here.*) – PV^n = constant)
        - **inplace** – Specifies whether to return the result in-place or to allocate a new PerfectGas object in memory
        - **result.** (*for the*) –
        - **new\_pressure** (*float*) –
        - **new\_temperature** (*float*) –
        - **new\_density** (*float*) –
        - **enthalpy\_addition\_at\_constant\_pressure** (*float*) –
        - **enthalpy\_addition\_at\_constant\_volume** (*float*) –

    Returns:
    :   If inplace is False (default), returns a new PerfectGas object that represents the gas after the change.

        If inplace is True, nothing is returned.

    Return type:
    :   [PerfectGas](#aerosandbox.atmosphere.thermodynamics.gas.PerfectGas)

aerosandbox.atmosphere.thermodynamics.gas.g = []