Skip to content

Latest commit

 

History

History
79 lines (49 loc) · 2.24 KB

ex_density.rst

File metadata and controls

79 lines (49 loc) · 2.24 KB

Calculating liquid densities

The :py:meth:`VESIcal.calculate_liquid_density()` function calculates the density of the silicate liquid given composition, temperature, and pressure. The function uses the DensityX model of Iacovino and Till (2019). No other models are currently available for this calculation.

Method Structure

Single sample:

def calculate_liquid_density(self, sample, pressure, temperature).result

BatchFile process:

def calculate_liquid_density(self, pressure, temperature)

Required inputs:

sample: Only for single-sample calculations. The composition of a sample as Sample class.

pressure: The pressure in bars. For BatchFile calculations, if pressure information is present in the file (e.g., as a column with unique pressure values for each sample), this can be accessed by passing the column name in quotes to the pressure variable.

temperature: The temperature in degres C. For BatchFile calculations, if temperature information is present in the file (e.g., as a column with unique temperature values for each sample), this can be accessed by passing the column name in quotes to the temperature variable.

Calculated outputs: The density of the liquid in grams per liter, rounded to 3 dp.

myfile = v.BatchFile('example_data.xlsx')
myfile.get_data()
densities = myfile.calculate_liquid_density(pressure=1000, temperature=900)
densities
SampleName = 'BT-ex'
extracted_bulk_comp = myfile.get_sample_composition(SampleName, asSampleClass=True)
v.calculate_liquid_density(sample=extracted_bulk_comp, pressure=1000, temperature=900).result
2142.827