Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Fluent – species – density – UDF

    • Dino
      Subscriber
      Hi,nI have two species (air + CO2) and I want to calculate the density of CO2 as it varies with temperature from the equation of state through a UDF. The density of the mixture is set as Incompressible Ideal Gas. I need the density of CO2 to calculate the ppm(volume) of CO2.nCO2 is assigned as species 0.ndensity0 = P * MW0 / (R_universal * T)nmy question is, P here is the static pressure which I can call via C_P(c,t) or I need to do something with the operating pressure as well?nThanks!n
    • Dino
      Subscriber
      Just a clarification:nP is supposed to be the partial pressure, P_gas = P_air + P_CO2, so in the udf how can I call P_CO2?ndensity0 = P0 * MW0 / (R_universal * T). Does that mean I need to choose Ideal Gas not Incompressible Ideal Gas for the density of the mixture?n
    • Konstantin
      Ansys Employee
      in the ideal gas expression for density, P is the absolute pressure = gauge + operating. Fluent solves flow field variables, including pressure, for the mixture, so there is no separate variables for partial pressures. You can easily reconstruct partial pressures from mixture pressure and species mass fraction by taking a product of the two. n
    • Dino
      Subscriber
      Thank you for your answer. So, Pi = Yi * P where Yi is the mass fraction of component i ? When I tried to prove it I found that Pi = Xi * P where Xi is the mole fraction. Is that correct?nIf the mole fraction is correct, is there a way to call a mole fraction of a single component within the UDF or I need to multiply the mass fraction by MW_mix/MW_i, where MW is the molar mass? Again, is there a way to call the MW_mix within the UDF since it is a variable that depends on the current mole fraction?nThank you for your help.
    • Konstantin
      Ansys Employee
      indeed, I mistyped, this is mole fraction that should be used. Mole fraction will need to be constructed from mass fraction and molecular weight as you described. Molecular weights can be accessed in a UDF as shown in 2.5.6.3. Example of UDF manualn
    • Rob
      Forum Moderator
      Mole fraction is available directly in Fluent post processing, given that would a Custom Field Function do the job? n
    • Dino
      Subscriber
      Thank you guys for your help. Yes, I think I can take this part out of the UDF and do it through a Custom Field. But I got really confused:nppm_volume = Y_i * rho_mixture * 10^6 / rho_inY_i is the mass fraction of component i. rho_i = P_i * MW_i / (R_universal * T) and rho_mixture = P MW_mixture / (R_universal * T). So, if we sub this in the ppm_volume formula, the whole thing vanishes and I get ppm_volume = 10^6. What mistake I am introducing here, please.nppm_volume by definition is the (V_i/V_mixture) * 10^6 but since we assume we have partial pressure so the V_i = V_mixture?nis there a way to call or post-processing the partial volume?nThank you,n
Viewing 6 reply threads
  • The topic ‘Fluent – species – density – UDF’ is closed to new replies.