propaceosComputeVariables

This source allows the user to read in data from a PROPACEOS table and then compute pressure and the sound speed squared from density and the internal energy. PROPACEOS tables can be obtained from Prism Computational Sciences (PROPACEOS link). Alternatively the PROPACEOS format can be used to create your own tables. Tables specify an equation of state (EOS) for energy and pressure as functions of temperature and density. Thus to solve for temperature, as an intermediate step, as a function of the internal energy an inverse operation must be applied. This operation holds the input temperature or density constant and assumes the EOS table data is a monotonic function of the dependent variables (density and temperature). If these assumptions do not hold, incorrect results may be produced.

In this updater, the sound speed squared is computed from a formula for the generalized sound speed:

\[\notag \begin{align} c_s^2 = \frac{\partial P}{\partial \epsilon} \frac{P}{\rho^2} + \frac{\partial P}{\partial \rho} \\ \end{align}\]

A note on units. Units in USim are all MKS units. However, the PROPACEOS tables use CGS units and eV for temperature. These units are converted to MKS by USim. This is important if one writes their own PROPACEOS tables. The ability to specify custom unit conversion factors is available as an optional input.

Before running any case using the PROPACEOS EOS tables, it is prudent to make basic sanity checks by running a modified version of the verifyEOSTable example with the specific PROPACEOS table that is intended for use.

Parameters

filename (string, required)
Name of file that contains the PROPACEOS formatted table.
speciesMass (float, required)
Mass of the species as required to convert from number to mass density.
delta (float, optional)
A finite difference operation is applied to evaluate partial derivatives. This factor determines the relative width of the stencil. The default is \(10^{-6}\).
soundSpeedSquaredFloor (float, optional)
Sets a minimum value for the output sound speed squared. The default is 0.
useParticleDensity (int, optional)
Whether to use the particle (true) or mass (false) density. Default is false.
fixRanges (int vector, options)
Whether the variables should be allowed to go beyond the table ranges or not. fixRanges = [1] means that the first variable cannot go beyond the table ranges and if it does, it’s value is set to the maximum (or minimum) of the table value. The default is false.
logInterpolation (int vector, optional)
Whether to use logarithmic interpolation when evaluating EOS table values. The 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 table 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.
outputPeRhoInv (int, optional)
Boolean that determines if the partial derivative of the pressure with respect to specific energy divided by the density, \(\rho^{-1} \partial P / \partial \epsilon\), is output. This output is required to compute the EOS system eigenvectors. The default is false.

Parent Updater Data

in (string vector, required)

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

The input variables (exactly 2) must be the density and the internal energy, in that order. Inputs are of type nodalArray with one component each.

out (string vector, required)

output variables (nodalArray, 1-component each, 2 required and 3rd optional)

The output variables are the pressure and the sound speed squared, in that order. If outputPeRhoInv is true, a third output variable that is the partial derivative of the pressure with respect to specific energy divided by the density \(\rho^{-1} \partial P / \partial \epsilon\). This output is required to compute the EOS system eigenvectors. Outputs are of type nodalArray with one component each.

Example

<Updater computePressureAndSoundSpeedSquared>
  kind=equation2d
  onGrid=domain
  in=[rho, intEnergy]
  out=[pressure, soundSqr]
  <Equation thisGas>
    kind=propaceosComputeVariables
    filename=propaceos.prp
    delta=1.e-5
    speciesMass=MI
  </Equation>
</Updater>