def calculateAvgMass(problemFile,windno):
  """
  Calculate the average mass of a winds flow
  Inputs:
    - dict problemFile: problem file, containing mass fractions
    - int  windno:      wind number, counting from 1
  Outputs:
    - avgMass: average mass of particles in wind (g)
  """
  protonmass = 1.6726219e-24
  # Find original values from problem file
  xH  = float(problemFile["xH"+str(windno)])
  xHe = float(problemFile["xHe"+str(windno)])
  xC  = float(problemFile["xC"+str(windno)])
  xN  = float(problemFile["xN"+str(windno)])
  xO  = float(problemFile["xO"+str(windno)])
  # Calculate mass contributon
  mH  = xH  * 1.0
  mHe = xHe * 4.0
  mC  = xC  * 12.0
  mN  = xN  * 14.0
  mO  = xO  * 16.0
  # Calculate average mass, in proton masses, convert to grams and return!
  avgMass  = mH + mHe + mC + mN + mO
  avgMass *= protonmass
  return avgMass