-
Notifications
You must be signed in to change notification settings - Fork 2
Thermodynamic and physical properties
NeqSim calculates and return thermodynamic and physical properties using the following methods:
1. Calculation of properties for a fluid.
Thermodynamic properties of a fluid is calculated when calling the fluid.init(2) method, and can then be read using the functions:
enthalpy = fluid.getEnthalpy();entropy = fluid.getEntropy(); numberOfPhases = fluid.getNumberOfPhases(); mixMolarVolume = 1.0 / fluid.getDensity("mol/m3"); mixDensity = fluid.getDensity("kg/m3"); mixZfactor = fluid.getZ(); mixEnthalpy = fluid.getEnthalpy("Jmol"); mixEntropy = fluid.getEntropy("JmolK"); mixCp = fluid.getCp("J/molK"); mixCv = fluid.getCv("J/molK"); mixKappa = fluid.getKappa(); mixViscosity = fluid.getViscosity("kg/msec"); mixThermalConductivity = fluid.getConductivity("W/mK");`
2. Calculation of properties for a given phase for a fluid.
Thermodynamic properties of a phase in a fluid is calculated when calling the fluid.init(2) method, and can then be read using the functions listed below. Valid phase names are: "gas", "oil", "aqueous".
phaseNumber = fluid.getPhaseNumberOfPhase("gas");
gasFractionc(c) = fluid.getMoleFraction(phaseNumber) * 100;
gasMolarVolume(c) = 1.0 / fluid.getPhase(phaseNumber).getDensity("mol/m3");
gasVolumeFraction(c) = fluid.getCorrectedVolumeFraction(phaseNumber) * 100;
gasDensity(c) = fluid.getPhase(phaseNumber).getDensity("kg/m3");
gasZ(c) = fluid.getPhase(phaseNumber).getZ();
gasMolarMass(c)= fluid.getPhase(phaseNumber).getMolarMass() * 1000;
gasEnthalpy(c) = fluid.getPhase(phaseNumber).getEnthalpy("J/mol");
gasWtFraction(c) = fluid.getWtFraction(phaseNumber) * 100;
gasKappa(c) = fluid.getPhase(phaseNumber).getGamma();
gasViscosity(c) = fluid.getPhase(phaseNumber).getViscosity("kg/msec");
gasThermalConductivity(c) = fluid.getPhase(phaseNumber).getConductivity("W/mK");
gasSoundSpeed(c) = fluid.getPhase(phaseNumber).getSoundSpeed();
gasJouleThomsonCoefficient(c) = fluid.getPhase(phaseNumber).getJouleThomsonCoefficient() / 1e5;