Skip to content

MATLAB + REFPROP: How to determine bubble and dew point temperatures for zeotropic mixtures #736

@atit-sut

Description

@atit-sut

Hello,

I’m using MATLAB to access REFPROP in order to simulate power cycles with zeotropic mixtures as the working fluid. Specifically, after selecting the component fluids and their corresponding mass fractions, I would like to use MATLAB (via the Python wrapper) to determine the bubble point and dew point temperatures of the mixture.

Could someone please suggest the appropriate REFPROP commands or methods to achieve this?

Below is an example of how I currently access the enthalpy of an ammonia-water mixture (mass fraction of ammonia = 0.82, water = 0.18):


clear
clc

RP = py.ctREFPROP.ctREFPROP.REFPROPFunctionLibrary('C:\Program Files (x86)\REFPROP');
wf = 'ammonia;water';
z_NH3 = 0.82;
z_wf = {z_NH3, 1 - z_NH3};

% Calculate enthalpy of the mixture
h_wf1 = refp(wf, 'PQ', 3e+06, 0, 'H', RP, z_wf)


And here is the content of the helper function refp:


function answer = refp(fluid, input, parameter1, parameter2, output, RP, z)
MOLSI = RP.GETENUMdll(int8(0), 'MASS base si').iEnum;
iMass = int8(1); % 0: molar fractions; 1: mass fractions
iFlag = int8(0); % 0: don’t call SATSPLN; 1: call SATSPLN
r = RP.REFPROPdll(fluid, input, output, MOLSI, iMass, iFlag, parameter1, parameter2, z);
G = double(r.Output);
answer = G(1);
end


System Information:
REFPROP Version: 10.0
Operating System: Windows 11 Home
Access Method: Python wrapper to connect MATLAB R2022a to REFPROP

Thank you in advance for your guidance on how to determine the bubble point and dew point temperatures of zeotropic mixtures in this setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions