How to convert the mass fraction into the volume fraction

Dear friends,
I need help! How can I get the density of a mixture of gases within a grid in a computational domain to convert the mass fraction into the volume fraction? If I need to go through a UDF file, how can I get the keyword of the mixed density or volume fraction? Thank you very much for your reply.

use mpi_utility, only : vol ! Volume of the cell
use fldvar, only : X_g ! Mass fraction of the different gas species
use fldvar, only: RO_g ! Density of the gas mixture
use physprop, only: NW_g ! Molecular weight

X_g(N2)/(MW_g(N2))/ ∑(X_g(x)/(MW_g(x)) is the mole fraction/volume fraction of N2, for example.

Thank you very much for your help.