Skip to contents

Calculate ion values expressed as mole fraction (mols).

Usage

fun_salt_mol(salt_ppm, water_ml, mol_wts, salt_charges_z)

Arguments

salt_ppm

Ion concentration in ppm

water_ml

Amount of water in millilitres

mol_wts

Molecular weight

salt_charges_z

Ionic charge of the salt

Value

Numeric value giving the molar concentration (mols)

Details

Calculates the molar concentration from the ion concentration in ppm, volume of water, molecular weight, and ionic charge.

The calculation used is: $$ \text{mols} = \frac{0.001 \times C_{\mathrm{ppm}} \times V_{\mathrm{water}}} {\frac{M}{z}} $$ where:

  • \(C_{\mathrm{ppm}}\): ion concentration in ppm

  • \(V_{\mathrm{water}}\): volume of water in millilitres

  • \(M\): molecular weight

  • \(z\): ionic charge

Examples

# Chloride test data with scalar inputs
fun_salt_mol(66.824, 100, 35.453, 1)
#> [1] 0.1884862

# Vectorized usage with salt_test and mol_wts data frames/lists
fun_salt_mol(
  salt_test$chloride_ppm,
  salt_test$water_ml,
  mol_wts$chloride,
  salt_charges_z$chloride
)
#> [1] 0.1884862