Import Equation of State

Function to import equation of state given by user.

EoS_import.EOS_check(density, pressure)

file_read

Checks that the derivative (drho/dp) is positive.

Parameters
  • density (array) – numpy 1Darray. Density array to be checked.

  • pressure (array) – numpy 1Darray. Pressure array to be checked.

Returns

two arrays, one corresponding to density and one corresponding to pressrure or ends the function and prints invalid equation of state.

Return type

array

EoS_import.EOS_import(file_name='', density=0, pressure=0)

Imports density and pressure from csv or array, checks them, and returns them.

Parameters
  • file_name (string, optional) – string. CSV file to be opened.

  • density (array, optional) – numpy 1Darray. Passed into a check function and returned if valid.

  • pressure (array, optional) – numpy 1Darray. Passed into a check function and returned if valid.

Returns

checked density and pressure.

Return type

array

EoS_import.file_read(input_file)

Reads a csv file of denisty and pressure given by the user.

Parameters

input_file (string) – string. File to be opened and parsed.

Returns

two 1Darray numpy arrays, one corresponding to density and one corresponding to pressrure.

Return type

array