# idealGasVariables¶

This source allows the user to compute specific internal energy ($$\epsilon$$), pressure ($$P$$), density ($$\rho$$), and temperature ($$T$$) from the ideal gas law,

\notag \begin{align} \rho\epsilon = P/(\Gamma-1) = \rho k_B T / m_i (\Gamma-1). \end{align}

Here $$\Gamma$$ is the adiabatic gas index, $$m_i$$ is the species mass and $$k_B$$ is the Boltzmann constant.

This updater is intended for usage as an example. As many equation updaters in USim assume an ideal gas equation of state use of this updater is redundant and largely unnecessary. Rather, this is updater is used to provide examples of EOS usage when EOS tables are not available.

## Parameters¶

operations (string vector, required)

The operation(s) to be performed. The standard direct operation is “computeEOSFromTemperatureAndDensity” where “EOS” should be replaced by one of the following values (the first word of each option should be used, the remainder offers a brief description and the default units after conversion):

• energy - ($$J kg^{-1}$$)
• pressure - ($$Pa$$)

To compute an inverse operation, simply permute the string to be “computeTemperatureFromEOSAndDensity” or “computeDensityFromTemperatureAndEOS”. The input is not case sensitive.

gasGamma (float, required)
Specifies the adiabatic index (ratio of specific heats), $$\Gamma$$.
speciesMass (float, required)
Specifies the species mass in $$kg$$.
kboltz (float, optional)
Specifies the Boltzmann constant. Defaults to $$1.3806 \times 10^{-23}$$ ($$J/K$$).
useParticleDensity (int, optional)
Whether to use the particle (true) or mass (false) density. Default is false.
densityConversionCoefficient (float, optional)
Custom density unit conversion factor. Conversion to MKS mass density ($$kg m^{-3}$$) is the default. The default conversion factor is divided by the custom conversion factor. Thus if using alternative units, set the unit conversion factor to to the MKS value that corresponds to unity in the alternative units.
temperatureConversionCoefficient (float, optional)
Custom temperature unit conversion factor. Conversion to MKS temperature ($$K$$) is the default. The default conversion factor is divided by the custom conversion factor. Thus if using alternative units, set the unit conversion factor to to the MKS value that corresponds to unity in the alternative units.
conversionCoefficients (float vector, optional)
Custom unit conversion factors for EOS values. Conversion to MKS units is the default. The default conversion factor is divided by the custom conversion factor. Thus if using alternative units, set the unit conversion factor to to the MKS value that corresponds to unity in the alternative units.

## Parent Updater Data¶

in (string vector, required)

input variables (nodalArray, 1-component each, 2 required)

The specific input variables and order depend on the operations input option. For direct EOS evaluation, the input variables should be in = [temperature, density]. The order is critical where temperature must be the first input and density must be the second input. For inverse operations, the temperature, if an input, must be the first input and the density, if an input, must be the second input. The EOS input should be placed in the correspondingly empty input location. Inputs are of type nodalArray with one component each.

out (string vector, required)

output variables (nodalArray, 1-component each, required)

The number of out variables should be the same as the number of entries into the list of operations. The result of each operation will be placed into the corresponding output variable, respectively. Outputs are of type nodalArray with one component each.

## Example¶

<Updater computeEOS>
kind=equation2d
onGrid=domain
in=[temperature, density]
out=[energy, pressure]
<Equation thisGas>
kind=idealGasVariables
operations=["computeEnergyFromDensityAndTemperature", \
"computePressureFromDensityAndTemperature"]
</Equation>
</Updater>