Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- GMD Density Model
-
Default Ideal gas (Z=1) Allowed Ideal gas (Z=1), User-entered Z
About this input
Use the ideal equation with Z fixed at one or apply one positive user-entered mixture compressibility factor. No Z correlation or lookup is supplied.
- GMD Compressibility Factor Conditional
-
Unit ratio Default 0.917 Range At least 0
About this input
Positive dimensionless mixture Z at the entered pressure and temperature, used only in User-entered Z mode. Hidden values are inert in ideal-gas mode.
- GMD Unit System
-
Default SI metric Allowed SI metric, US customary
About this input
Select coherent SI or U.S. customary entries and outputs. Changing this selector relabels the values; it does not automatically convert previously entered numbers.
- GMD Temperature
-
Unit deg C Default 146.3 Range At least -273.15 (conditional)
About this input
Gas temperature strictly above absolute zero; it is converted to kelvin before the equation of state is evaluated.
- Gas components - entered mole fractions and user molar masses
-
Default 8 rows
About this input
Submit exactly eight complete rows. Set Use component? to Yes for active components and No for inert sentinel rows. Every Yes row requires a 1-to-80-character label, a nonnegative mole amount, and a positive user-entered molar mass. No cells may be blank. Numeric grid cells are transported as strings under contract 0.17 and parsed explicitly; no static grid maximum is imposed.
Column Range or allowed values Use component? Yes, No Component label Not declared Mole amount At least 0 User molar mass At least 0 - GMD Absolute Pressure
-
Unit kPa abs Default 236.7 Range At least 0
About this input
Positive absolute gas pressure at the density state. Gauge pressure is not accepted.
- GMD Composition Total Policy
-
Default Require stated total Allowed Require stated total, Normalize entered amounts
About this input
Require the raw entries to total 1 or 100 within 1e-8 relative tolerance, or deliberately normalize any positive finite entered total.
- GMD Composition Basis
-
Default Mole fraction Allowed Mole fraction, Mole percent
About this input
Enter each active component amount as a mole fraction or mole percent. Both paths are normalized internally after the selected total policy is checked.
Outputs
- GMD Normalization Factor
-
Unit ratio
About this output
Selected stated total, one or one hundred, divided by the raw active total. Normalized mole fractions are raw entries divided by their raw total.
- GMD Mixture Molecular Weight
-
Unit kg/kmol
About this output
Mole-fraction weighted sum of user-entered component molar masses. The familiar molecular-weight wording is retained in the app name while this output states the dimensional molar-mass convention.
- GMD Specific Gas Constant
-
Unit J/(kg*K)
About this output
Exact molar gas constant divided by the calculated mean molar mass and expressed in the selected coherent unit system.
- Model Status
-
No unit declared
About this output
Returns actionable NOT VALID text for malformed composition/state inputs or unsupported arithmetic and OK for a finite supported calculation. It does not certify gas properties or phase behavior.
- GMD Specific Volume
-
Unit m^3/kg
About this output
Reciprocal of the calculated gas density in the selected coherent unit system.
- GMD Compressibility Factor Used
-
Unit ratio
About this output
One in ideal-gas mode or the positive visible user-entered value in User-entered Z mode.
- GMD Active Component Count
-
Unit components
About this output
Number of the eight fixed grid rows marked Yes, including any zero-amount row that remains explicitly defined.
- GMD Density Model Used
-
No unit declared
About this output
States whether density used the ideal-gas special case or a user-entered compressibility factor.
- GMD Gas Density
-
Unit kg/m^3
About this output
Equation-of-state density P*Mmix/(Z*Ru*T) at the entered absolute pressure and temperature.
- GMD Entered Composition Total
-
Unit fraction total
About this output
Raw sum of active component mole entries before normalization.
What it is
The Gas Mixture Molecular Weight and Density Calculator works out the mean molar mass of a gas mixture you define, and from it the mixture specific gas constant, the density at an absolute pressure and temperature you state, and the specific volume. It also reports the raw composition total, the normalisation factor applied to it, the compressibility factor used, and how many components were active.
Composition goes into a fixed grid of eight rows. Each row carries a Yes or No switch, a label, a mole amount and a molar mass. Amounts go in as mole fractions or as mole percent, and a composition-total policy decides whether entries that do not add up to one, or to one hundred, are refused or scaled.
Density runs in one of two modes. Ideal gas fixes the compressibility factor at one. User-entered Z applies a single positive number you supply for the whole mixture. There is no correlation and nothing that estimates Z from composition, pressure and temperature.
Units are coherent SI (kilograms per kilomole, kilopascals absolute, degrees Celsius, kilograms per cubic metre) or U.S. customary (pounds mass per pound mole, psia, degrees Fahrenheit, pounds mass per cubic foot).
There is no species library here. Every component molar mass is a number you type, nothing checks it against the label beside it, and the shipped values are synthetic demonstration figures rather than real gas data. The density is an equation-of-state result at whatever compressibility factor you gave it, and the model has no way to tell you that factor is wrong.
Methodology
Purpose and model boundary
This model calculates a user-defined gas mixture's mean molar mass, specific gas constant, density, and specific volume from an eight-row mole-basis composition, absolute pressure, temperature, and either ideal-gas Z = 1 or one positive user-entered compressibility factor. It is a composition and equation-of-state calculator, not a species or gas-property database.
Inputs and units
Each fixed grid row declares whether a component is used, its label, a nonnegative mole amount, and a positive user molar mass. Composition can be entered as mole fraction or mole percent. The total policy either requires the stated total of 1 or 100, or normalizes any positive active total.
Pressure is absolute: kPa in SI or psia in U.S. customary units. Temperature is °C or °F and is converted to kelvin internally. Molar mass is kg/kmol or the numerically corresponding lbm/lbmol convention. Ideal mode uses Z = 1; user-Z mode exposes one positive dimensionless mixture compressibility factor at the entered state.
Governing relationships
For active entered amounts a_i, raw total A = sum(a_i) and normalized mole fractions are:
y_i = a_i / A
The displayed normalization factor is target total / A, where target total is 1 for mole-fraction entry and 100 for mole-percent entry. Mean molar mass and specific gas constant are:
M_mix = sum(y_i × M_i)
R_s = 1000 × R_u / M_mix
where the workbook uses exact molar gas constant R_u = 8.31446261815324 J/(mol·K). With absolute pressure P, absolute temperature T, and active compressibility factor Z:
rho = P × M_mix / (Z × R_u × T)
The workbook's SI implementation uses P in kPa, M_mix in kg/kmol, and the numerically compatible R_u so density is kg/m³. Specific volume is v = 1/rho. Public U.S. customary results are exact unit conversions of the same internal SI state.
Calculation sequence
- Validate the modes, visible state fields, all eight rows, at least one active component, and the selected composition-total policy.
- Sum active amounts and divide each by the raw active total to obtain mole fractions.
- Calculate each molar-mass contribution and sum them to
M_mix. - Select
Z = 1or the visible user-enteredZ. - Convert temperature and absolute pressure to the internal SI basis.
- Calculate specific gas constant, density, and reciprocal specific volume, then convert results to the selected public units.
- Verify normalized-fraction and molar-mass contribution closure and evaluate status.
Outputs and interpretation
The four headline properties are mixture molar mass, specific gas constant, gas density, and specific volume. Supporting outputs expose entered composition total, normalization factor, compressibility factor used, active component count, and density-model label. The donut chart shows each active component's positive contribution to mixture molar mass, with exact values and shares available on hover, keyboard focus, and assistive text.
Validation and status logic
The workbook evaluates status in this order:
| Condition | Returned status |
|---|---|
| Any selector, visible state field, fixed-grid row, active-component, or selected-total rule fails | NOT VALID: correct visible state, mode, or eight-row composition inputs |
| A mixture property, unit conversion, normalized-fraction closure, contribution closure, or chart value is outside the supported calculation range | NOT VALID: derived mixture result exceeds the supported calculation range |
| Neither condition applies | OK |
The input gate requires listed modes, positive absolute pressure, temperature above absolute zero, positive visible Z, exactly eight well-formed rows, at least one Yes component, and a positive active amount total. Every active row requires a label, nonnegative amount, and positive molar mass. In Require stated total mode, the raw total must equal 1 or 100 within relative tolerance 1e-8 × target total; normalization mode accepts any positive finite total.
The derived gate requires all eight fraction and contribution values, positive mixture properties, mole fractions summing to 1 within 1e-9, and contributions summing to M_mix within 1e-9 × max(1, M_mix).
Assumptions and limitations
- Every component and molar mass is user-defined; there is no species library or atomic-weight table.
- All entries are mole-basis. Mass fractions require prior conversion outside this model.
- Ideal mode fixes
Zat one. User-Z mode applies one user value and does not estimate or mix compressibility factors. - Pressure must be absolute and temperature must be above absolute zero.
- The model does not calculate phase equilibrium, condensation, reaction, dissociation, adsorption, trace-species uncertainty, or composition-dependent
Z. - Results are equation-of-state values at the entered state, not custody-transfer, regulatory, safety, or laboratory certification.
Restrictions and non-computing states
The request always retains the workbook's fixed eight-row extent. The page's Add/Remove interaction only toggles the declared Yes/No activation column; it does not change the shape of the submitted values. Inactive rows do not contribute. A zero active total, missing active label, nonpositive active molar mass, invalid stated total, nonpositive pressure or visible Z, or temperature at/below absolute zero prevents a result.
There is no CHECK branch. A finite, closed mixture result returns OK; malformed input or unsupported arithmetic returns NOT VALID.
Errors and warnings
Input checking can reject an unknown option, invalid row shape, or input outside its allowed range before calculation. Workbook NOT VALID separates input-domain failures from derived-range failures using the exact messages above. A service failure is not a zero-density state. OK confirms only that the stated user data produced a finite equation-of-state calculation.
References
This calculator implements the ordinary textbook relations: the mole-weighted sum for a mixture's mean molar mass, the specific gas constant as the molar gas constant divided by that molar mass, and the equation of state with a compressibility factor, of which the ideal gas is the special case Z = 1. No species library, atomic weight table, property table, equation-of-state parameter set, mixing rule or compressibility correlation is embedded, and the shipped component values are synthetic. The sources below are where to go for the method class and for the constant used.
- U.S. EPA Method 3, Gas Analysis for the Determination of Dry Molecular Weight, for the mole-weighted molecular-weight sum and its engineering units. https://www.epa.gov/sites/default/files/2017-08/documents/method_3.pdf
- 40 CFR Part 60, Appendix A-2, the current federal regulatory location of Method 3 and its dry molecular-weight context. https://www.ecfr.gov/current/title-40/chapter-I/subchapter-C/part-60/appendix-Appendix%20A-2%20to%20Part%2060
- NASA Glenn Research Center, Equation of State, for the ideal-gas relation and the specific gas constant. https://www1.grc.nasa.gov/beginners-guide-to-aeronautics/equation-of-state/
- NIST CODATA 2022 recommended values, for the molar gas constant of 8.31446261815324 used here. https://tsapps.nist.gov/publication/get_pdf.cfm?pub_id=958143
- National Bureau of Standards NBSIR 86-3057, Natural Gas Handbook, for the compressibility form of the equation of state. https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nbsir86-3057.pdf
Naming these sources is provenance, not endorsement, certification or approval. Component identity, molar mass, composition basis and any non-ideal compressibility factor all come from outside this page.
Additional source notes migrated from Methodology
The weighted molar-mass relationship follows the general mole-fraction method in EPA Method 3 and its current regulatory location in 40 CFR Part 60, Appendix A-2. The equation-of-state relationships are documented by NASA Glenn and the exact molar gas constant by NIST CODATA. Unit definitions and conversions follow the NIST Guide to the SI and its Appendix B. No species, property, or vendor dataset is embedded.
Frequently asked questions
What happens if my mole fractions do not add up to one?
What does the normalisation factor tell me?
Does it use a compressibility factor?
What does the ideal-gas assumption cost me?
Where do the component molar masses come from?
Does the hidden compressibility field affect an ideal-gas run?
Can I use fewer than eight components?
Is this a wet or a dry molecular weight?
Why did all my outputs come back as zero?
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.