Changed all callct to ctFunc

This commit is contained in:
ssun30 2023-01-31 22:15:45 -05:00 committed by Ray Speth
parent 7647893d73
commit 03dceb517b
13 changed files with 246 additions and 246 deletions

View File

@ -131,15 +131,15 @@ classdef Domain1D < handle
a = varargin{1};
if strcmp(a, 'Inlet1D')
d.domainID = callct('inlet_new');
d.domainID = ctFunc('inlet_new');
elseif strcmp(a, 'Surf1D')
d.domainID = callct('surf_new');
d.domainID = ctFunc('surf_new');
elseif strcmp(a, 'Symm1D')
d.domainID = callct('symm_new');
d.domainID = ctFunc('symm_new');
elseif strcmp(a, 'Outlet1D')
d.domainID = callct('outlet_new');
d.domainID = ctFunc('outlet_new');
elseif strcmp(a, 'OutletRes')
d.domainID = callct('outletres_new');
d.domainID = ctFunc('outletres_new');
else
error('Not enough arguments for that job number');
end
@ -151,7 +151,7 @@ classdef Domain1D < handle
if strcmp(a, 'StagnationFlow')
if isa(b, 'Solution')
d.domainID = callct('stflow_new', ...
d.domainID = ctFunc('stflow_new', ...
b.tpID, b.kinID, b.trID, 1);
else
error('Wrong argument type. Expecting instance of class Solution.');
@ -160,7 +160,7 @@ classdef Domain1D < handle
elseif strcmp(a, 'AxisymmetricFlow')
if isa(b, 'Solution')
d.domainID = callct('stflow_new', ...
d.domainID = ctFunc('stflow_new', ...
b.tpID, b.kinID, b.trID, 2);
else
error('Wrong argument type. Expecting instance of class Solution.');
@ -169,8 +169,8 @@ classdef Domain1D < handle
elseif strcmp(a, 'ReactingSurface')
if isa(b, 'Interface')
d.domainID = callct('reactingsurf_new');
callct('reactingsurf_setkineticsmgr', ...
d.domainID = ctFunc('reactingsurf_new');
ctFunc('reactingsurf_setkineticsmgr', ...
d.domainID, b.kinID);
else
error('Wrong argument type. Expecting instance of class Interface.');
@ -190,7 +190,7 @@ classdef Domain1D < handle
function delete(d)
% Delete the :mat:class:`Domain1D` object.
callct('domain_del', d.domainID);
ctFunc('domain_del', d.domainID);
end
%% Domain1D Utility Methods
@ -205,7 +205,7 @@ classdef Domain1D < handle
%
disp(' ');
disp('Disabling the energy equation...');
callct('stflow_solveEnergyEqn', d.domainID, 0);
ctFunc('stflow_solveEnergyEqn', d.domainID, 0);
end
function d = enableEnergy(d)
@ -218,7 +218,7 @@ classdef Domain1D < handle
%
disp(' ');
disp('Enabling the energy equation...');
callct('stflow_solveEnergyEqn', d.domainID, 1);
ctFunc('stflow_solveEnergyEqn', d.domainID, 1);
end
function d = disableSoret(d)
@ -231,7 +231,7 @@ classdef Domain1D < handle
%
disp(' ');
disp('Disabling the Soret effect...');
callct('stflow_enableSoret', d.domainID, 0);
ctFunc('stflow_enableSoret', d.domainID, 0);
end
function d = enableSoret(d)
@ -244,7 +244,7 @@ classdef Domain1D < handle
%
disp(' ');
disp('Disabling the Soret effect...');
callct('stflow_enableSoret', d.domainID, 1);
ctFunc('stflow_enableSoret', d.domainID, 1);
end
%% Domain Get Methods
@ -261,8 +261,8 @@ classdef Domain1D < handle
% 1x2 Vector of the lower and upper bounds.
n = d.componentIndex(component);
lower = callct('domain_lowerBound', d.domainID, n);
upper = callct('domain_upperBound', d.domainID, n);
lower = ctFunc('domain_lowerBound', d.domainID, n);
upper = ctFunc('domain_upperBound', d.domainID, n);
b = [lower, upper];
end
@ -283,7 +283,7 @@ classdef Domain1D < handle
if isa(name, 'double')
n = name;
else
n = callct('domain_componentIndex', ...
n = ctFunc('domain_componentIndex', ...
d.domainID, name);
if n >= 0
@ -324,7 +324,7 @@ classdef Domain1D < handle
end
function i = get.domainIndex(d)
i = callct('domain_index', d.domainID);
i = ctFunc('domain_index', d.domainID);
if i >= 0
i = i + 1;
@ -337,7 +337,7 @@ classdef Domain1D < handle
end
function i = get.domainType(d)
i = callct('domain_type', d.domainID);
i = ctFunc('domain_type', d.domainID);
end
function zz = gridPoints(d, n)
@ -358,7 +358,7 @@ classdef Domain1D < handle
zz = zeros(1, np);
for i = 1:np
zz(i) = callct('domain_grid', d.domainID, i - 1);
zz(i) = ctFunc('domain_grid', d.domainID, i - 1);
end
else
@ -366,7 +366,7 @@ classdef Domain1D < handle
zz = zeros(1, m);
for i = 1:m
zz(i) = callct('domain_grid', d.domainID, n(i) - 1);
zz(i) = ctFunc('domain_grid', d.domainID, n(i) - 1);
end
end
@ -404,7 +404,7 @@ classdef Domain1D < handle
end
function mdot = get.massFlux(d)
mdot = callct('bdry_mdot', d.domainID);
mdot = ctFunc('bdry_mdot', d.domainID);
end
function y = massFraction(d, k)
@ -429,18 +429,18 @@ classdef Domain1D < handle
end
if d.isInlet
y = callct('bdry_massFraction', d.domainID, k - 1);
y = ctFunc('bdry_massFraction', d.domainID, k - 1);
else error('Input domain must be an inlet');
end
end
function n = get.nComponents(d)
n = callct('domain_nComponents', d.domainID);
n = ctFunc('domain_nComponents', d.domainID);
end
function n = get.nPoints(d)
n = callct('domain_nPoints', d.domainID);
n = ctFunc('domain_nPoints', d.domainID);
end
function tol = tolerances(d, component)
@ -457,13 +457,13 @@ classdef Domain1D < handle
% 1x2 Vector of the relative and absolute error tolerances.
n = d.componentIndex(component);
rerr = callct('domain_rtol', d.domainID, n);
aerr = callct('domain_atol', d.domainID, n);
rerr = ctFunc('domain_rtol', d.domainID, n);
aerr = ctFunc('domain_atol', d.domainID, n);
tol = [rerr, aerr];
end
function temperature = get.T(d)
temperature = callct('bdry_temperature', d.domainID);
temperature = ctFunc('bdry_temperature', d.domainID);
end
function pressure = get.P(d)
@ -488,7 +488,7 @@ classdef Domain1D < handle
%
n = d.componentIndex(component);
callct('domain_setBounds', d.domainID, n - 1, lower, upper);
ctFunc('domain_setBounds', d.domainID, n - 1, lower, upper);
end
function setCoverageEqs(d, onoff)
@ -525,7 +525,7 @@ classdef Domain1D < handle
ion = onoff;
end
callct('reactingsurf_enableCoverageEqs', d.domainID, ion);
ctFunc('reactingsurf_enableCoverageEqs', d.domainID, ion);
end
function setFixedTempProfile(d, profile)
@ -548,11 +548,11 @@ classdef Domain1D < handle
if sz(1) == 2
l = length(profile(1, :));
callct('stflow_setFixedTempProfile', d.domainID, ...
ctFunc('stflow_setFixedTempProfile', d.domainID, ...
l, profile(1, :), l, profile(2, :));
elseif sz(2) == 2
l = length(profile(:, 1));
callct('stflow_setFixedTempProfile', d.domainID, ...
ctFunc('stflow_setFixedTempProfile', d.domainID, ...
l, profile(:, 1), l, profile(:, 2));
else error('Wrong temperature profile array shape.');
end
@ -569,7 +569,7 @@ classdef Domain1D < handle
% :param id:
% String ID to assign
%
callct('domain_setID', d.domainID, id);
ctFunc('domain_setID', d.domainID, id);
end
function setMassFlowRate(d, mdot)
@ -582,7 +582,7 @@ classdef Domain1D < handle
% :param mdot:
% Mass flow rate
%
callct('bdry_setMdot', d.domainID, mdot);
ctFunc('bdry_setMdot', d.domainID, mdot);
end
function setMoleFractions(d, x)
@ -596,7 +596,7 @@ classdef Domain1D < handle
% String specifying the species and mole fractions in
% the format ``'SPEC:X,SPEC2:X2'``.
%
callct('bdry_setMoleFractions', d.domainID, x);
ctFunc('bdry_setMoleFractions', d.domainID, x);
end
function setSteadyTolerances(d, component, rtol, atol)
@ -619,7 +619,7 @@ classdef Domain1D < handle
nc = d.nComponents;
for ii = 1:nc
callct('domain_setSteadyTolerances', ...
ctFunc('domain_setSteadyTolerances', ...
d.domainID, ii - 1, rtol, atol);
end
@ -628,13 +628,13 @@ classdef Domain1D < handle
for ii = 1:nc
n = d.componentIndex(component{ii});
callct('domain_setSteadyTolerances', ...
ctFunc('domain_setSteadyTolerances', ...
d.domainID, n, rtol, atol);
end
else
n = d.componentIndex(component);
callct('domain_setSteadyTolerances', ...
ctFunc('domain_setSteadyTolerances', ...
d.domainID, n, rtol, atol);
end
@ -660,7 +660,7 @@ classdef Domain1D < handle
nc = d.nComponents;
for ii = 1:nc
callct('domain_setTransientTolerances', ...
ctFunc('domain_setTransientTolerances', ...
d.domainID, ii - 1, rtol, atol);
end
@ -669,13 +669,13 @@ classdef Domain1D < handle
for ii = 1:nc
n = d.componentIndex(component{ii});
callct('domain_setTransientTolerances', ...
ctFunc('domain_setTransientTolerances', ...
d.domainID, n, rtol, atol);
end
else
n = d.componentIndex(component);
callct('domain_setTransientTolerances', ...
ctFunc('domain_setTransientTolerances', ...
d.domainID, n, rtol, atol);
end
@ -690,7 +690,7 @@ classdef Domain1D < handle
% ID of the solution object for which transport properties
% are calculated.
%
callct('stflow_setTransport', d.domainID, itr);
ctFunc('stflow_setTransport', d.domainID, itr);
end
function setupGrid(d, grid)
@ -702,7 +702,7 @@ classdef Domain1D < handle
% Instance of class :mat:class:`Domain1D`
% :param grid:
%
callct('domain_setupGrid', d.domainID, numel(grid), grid);
ctFunc('domain_setupGrid', d.domainID, numel(grid), grid);
end
function set.T(d, t)
@ -711,7 +711,7 @@ classdef Domain1D < handle
error('The temperature must be positive');
end
callct('bdry_setTemperature', d.domainID, t);
ctFunc('bdry_setTemperature', d.domainID, t);
end
function set.P(d, p)
@ -720,7 +720,7 @@ classdef Domain1D < handle
error('The pressure must be positive');
end
callct('stflow_setPressure', d.domainID, p);
ctFunc('stflow_setPressure', d.domainID, p);
end
end

View File

@ -47,7 +47,7 @@ classdef Sim1D < handle
ids(n) = domains{n}.domainID;
end
s.stID = callct('sim1D_new', nd, ids);
s.stID = ctFunc('sim1D_new', nd, ids);
end
@ -56,7 +56,7 @@ classdef Sim1D < handle
function delete(s)
% Delete the :mat:class:`Sim1D` object.
callct('sim1D_del', s.stID);
ctFunc('sim1D_del', s.stID);
end
%% Sim1D Utility Methods
@ -68,7 +68,7 @@ classdef Sim1D < handle
fname = '-';
end
callct('sim1D_showSolution', s.stID, fname);
ctFunc('sim1D_showSolution', s.stID, fname);
end
function plotSolution(s, domain, component)
@ -110,7 +110,7 @@ classdef Sim1D < handle
% :param id:
% ID of the element that should be restored
%
callct('sim1D_restore', s.stID, fname, id)
ctFunc('sim1D_restore', s.stID, fname, id)
end
function saveSoln(s, fname, id, desc)
@ -142,7 +142,7 @@ classdef Sim1D < handle
desc = '--';
end
callct('sim1D_save', s.stID, fname, id, desc);
ctFunc('sim1D_save', s.stID, fname, id, desc);
end
function x = solution(s, domain, component)
@ -173,7 +173,7 @@ classdef Sim1D < handle
x = zeros(1, np);
for n = 1:np
x(n) = callct('sim1D_value', s.stID, ...
x(n) = ctFunc('sim1D_value', s.stID, ...
idom - 1, icomp - 1, n - 1);
end
@ -184,7 +184,7 @@ classdef Sim1D < handle
for m = 1:nc
for n = 1:np
x(m, n) = callct('sim1D_value', s.stID, ...
x(m, n) = ctFunc('sim1D_value', s.stID, ...
idom - 1, m - 1, n - 1);
end
@ -209,7 +209,7 @@ classdef Sim1D < handle
% Integer, 1 to allow grid refinement, 0 to disallow.
%
callct('sim1D_solve', s.stID, loglevel, refineGrid);
ctFunc('sim1D_solve', s.stID, loglevel, refineGrid);
end
function writeStats(s)
@ -225,7 +225,7 @@ classdef Sim1D < handle
% Instance of class :mat:class:`Sim1D`
%
callct('sim1D_writeStats', s.stID, 1);
ctFunc('sim1D_writeStats', s.stID, 1);
end
%% Sim1D Get Methods
@ -233,7 +233,7 @@ classdef Sim1D < handle
function getInitialSoln(s)
% Get the initial solution.
callct('sim1D_getInitialSoln', s.stID);
ctFunc('sim1D_getInitialSoln', s.stID);
end
function n = stackIndex(s, name)
@ -252,7 +252,7 @@ classdef Sim1D < handle
if isa(name, 'double')
n = name;
else
n = callct('sim1D_domainIndex', s.stID, name);
n = ctFunc('sim1D_domainIndex', s.stID, name);
if n >= 0
n = n + 1;
@ -307,12 +307,12 @@ classdef Sim1D < handle
np = d.nPoints;
r = zeros(nc, np);
callct('sim1D_eval', s.stID, rdt, count);
ctFunc('sim1D_eval', s.stID, rdt, count);
for m = 1:nc
for n = 1:np
r(m, n) = callct('sim1D_workValue', ...
r(m, n) = ctFunc('sim1D_workValue', ...
s.stID, idom - 1, m - 1, n - 1);
end
@ -336,7 +336,7 @@ classdef Sim1D < handle
error('temperature must be positive');
end
callct('sim1D_setFixedTemperature', s.stID, T);
ctFunc('sim1D_setFixedTemperature', s.stID, T);
end
function setFlatProfile(s, domain, comp, v)
@ -354,7 +354,7 @@ classdef Sim1D < handle
% Double value to be set.
%
callct('sim1D_setFlatProfile', s.stID, ...
ctFunc('sim1D_setFlatProfile', s.stID, ...
domain - 1, comp - 1, v);
end
@ -369,7 +369,7 @@ classdef Sim1D < handle
% Double minimum grid spacing.
%
callct('sim1D_setGridMin', s.stID, domain - 1, gridmin);
ctFunc('sim1D_setGridMin', s.stID, domain - 1, gridmin);
end
function setMaxJacAge(s, ss_age, ts_age)
@ -391,7 +391,7 @@ classdef Sim1D < handle
ts_age = ss_age;
end
callct('sim1D_setMaxJacAge', s.stID, ss_age, ts_age);
ctFunc('sim1D_setMaxJacAge', s.stID, ss_age, ts_age);
end
function setProfile(s, name, comp, p)
@ -448,13 +448,13 @@ classdef Sim1D < handle
for j = 1:np
ic = d.componentIndex(c{j});
callct('sim1D_setProfile', s.stID, ...
ctFunc('sim1D_setProfile', s.stID, ...
n - 1, ic - 1, sz(2), p(1, :), sz(2), p(j + 1, :));
end
elseif sz(2) == np + 1;
ic = d.componentIndex(c{j});
callct('sim1D_setProfile', s.stID, ...
ctFunc('sim1D_setProfile', s.stID, ...
n - 1, ic - 1, sz(1), p(:, 1), sz(1), p(:, j + 1));
else
error('Wrong profile shape.');
@ -500,7 +500,7 @@ classdef Sim1D < handle
prune = -0.1;
end
callct('sim1D_setRefineCriteria', s.stID, ...
ctFunc('sim1D_setRefineCriteria', s.stID, ...
n - 1, ratio, slope, curve, prune);
end
@ -519,7 +519,7 @@ classdef Sim1D < handle
% attempted. If this failed, two time steps would be taken.
%
callct('sim1D_TimeStep', s.stID, ...
ctFunc('sim1D_TimeStep', s.stID, ...
stepsize, length(steps), steps);
end
@ -550,7 +550,7 @@ classdef Sim1D < handle
% Value to be set.
%
callct('sim1D_setValue', s.stID, ...
ctFunc('sim1D_setValue', s.stID, ...
n - 1, comp - 1, localPoints - 1, v);
end

View File

@ -70,7 +70,7 @@ classdef Interface < handle & ThermoPhase & Kinetics
nsp = s.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('surf_getCoverages', surfID, pt);
ctFunc('surf_getCoverages', surfID, pt);
c = pt.Value;
end
@ -84,7 +84,7 @@ classdef Interface < handle & ThermoPhase & Kinetics
nsp = s.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('surf_getConcentrations', surfID, xx);
ctFunc('surf_getConcentrations', surfID, xx);
c = pt.Value;
end
@ -125,12 +125,12 @@ classdef Interface < handle & ThermoPhase & Kinetics
end
if ((m == nsp && n == 1) || (m == 1 & n == nsp))
callct('surf_setCoverages', surfID, cov, norm_flag);
ctFunc('surf_setCoverages', surfID, cov, norm_flag);
else error('wrong size for coverage array');
end
elseif isa(cov, 'char')
callct('surf_setCoveragesByName', surfID, cov);
ctFunc('surf_setCoveragesByName', surfID, cov);
end
end
@ -147,7 +147,7 @@ classdef Interface < handle & ThermoPhase & Kinetics
% kmol/m for edge phases.
surfID = s.tpID;
callct('surf_setSiteDensity', surfID, d);
ctFunc('surf_setSiteDensity', surfID, d);
end
end

View File

@ -140,7 +140,7 @@ classdef Kinetics < handle
inb1 = n1.tpID;
end
kin.kinID = callct('kin_newFromFile', src, id, ...
kin.kinID = ctFunc('kin_newFromFile', src, id, ...
iph, inb1, inb2, inb3, inb4);
end
@ -149,7 +149,7 @@ classdef Kinetics < handle
function delete(kin)
% Delete the :mat:class:`Kinetics` object.
callct('kin_del', kin.kinID);
ctFunc('kin_del', kin.kinID);
end
%% Get scalar attributes
@ -164,7 +164,7 @@ classdef Kinetics < handle
% :return:
% Index of the species.
n = callct('kin_speciesIndex', kin.kinID, name, phase);
n = ctFunc('kin_speciesIndex', kin.kinID, name, phase);
end
function n = multiplier(kin, irxn)
@ -176,19 +176,19 @@ classdef Kinetics < handle
% :return:
% Multiplier of the rate of progress of reaction irxn.
n = callct('kin_multiplier', kin.kinID, irxn - 1);
n = ctFunc('kin_multiplier', kin.kinID, irxn - 1);
end
function n = get.nPhases(kin)
n = callct('kin_nPhases', kin.kinID);
n = ctFunc('kin_nPhases', kin.kinID);
end
function n = get.nReactions(kin)
n = callct('kin_nReactions', kin.kinID);
n = ctFunc('kin_nReactions', kin.kinID);
end
function n = get.nTotalSpecies(kin)
n = callct('kin_nSpecies', kin.kinID);
n = ctFunc('kin_nSpecies', kin.kinID);
end
function n = phaseIndex(kin, phase)
@ -199,7 +199,7 @@ classdef Kinetics < handle
% :return:
% Index of the phase.
n = callct('kin_phaseIndex', kin.kinID, phase);
n = ctFunc('kin_phaseIndex', kin.kinID, phase);
end
function n = stoichReactant(kin, species, rxns)
@ -239,7 +239,7 @@ classdef Kinetics < handle
for k = krange
for i = irange
t = callct('kin_reactantStoichCoeff', ...
t = ctFunc('kin_reactantStoichCoeff', ...
kin.kinID, k - 1, i - 1);
if t ~= 0.0
@ -284,7 +284,7 @@ classdef Kinetics < handle
for k = krange
for i = irange
t = callct('kin_productStoichCoeff', ...
t = ctFunc('kin_productStoichCoeff', ...
kin.kinID, k - 1, i - 1);
if t ~= 0.0
@ -328,7 +328,7 @@ classdef Kinetics < handle
nsp = kin.nTotalSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('kin_getCreationRates', kin.kinID, nsp, pt);
ctFunc('kin_getCreationRates', kin.kinID, nsp, pt);
cdot = pt.Value;
end
@ -336,7 +336,7 @@ classdef Kinetics < handle
nsp = kin.nTotalSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('kin_getDestructionRates', kin.kinID, nsp, pt);
ctFunc('kin_getDestructionRates', kin.kinID, nsp, pt);
ddot = pt.Value;
end
@ -350,14 +350,14 @@ classdef Kinetics < handle
% :return:
% 1 if reaction number i is reversible. 0 if irreversible.
n = callct('kin_isReversible', kin.kinID, i);
n = ctFunc('kin_isReversible', kin.kinID, i);
end
function wdot = get.netProdRates(kin)
nsp = kin.nTotalSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('kin_getNetProductionRates', kin.kinID, nsp, pt);
ctFunc('kin_getNetProductionRates', kin.kinID, nsp, pt);
wdot = pt.Value;
end
@ -365,7 +365,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getFwdRatesOfProgress', kin.kinID, nr, pt);
ctFunc('kin_getFwdRatesOfProgress', kin.kinID, nr, pt);
q = pt.Value;
end
@ -373,7 +373,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getRevRatesOfProgress', kin.kinID, nr, pt);
ctFunc('kin_getRevRatesOfProgress', kin.kinID, nr, pt);
q = pt.Value;
end
@ -381,7 +381,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getNetRatesOfProgress', kin.kinID, nr, pt);
ctFunc('kin_getNetRatesOfProgress', kin.kinID, nr, pt);
q = pt.Value;
end
@ -412,7 +412,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getDelta', kin.kinID, 0, nr, pt);
ctFunc('kin_getDelta', kin.kinID, 0, nr, pt);
enthalpy = pt.Value;
end
@ -420,7 +420,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getDelta', kin.kinID, 3, nr, pt);
ctFunc('kin_getDelta', kin.kinID, 3, nr, pt);
enthalpy = pt.Value;
end
@ -428,7 +428,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getDelta', kin.kinID, 2, nr, pt);
ctFunc('kin_getDelta', kin.kinID, 2, nr, pt);
entropy = pt.Value;
end
@ -436,7 +436,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getDelta', kin.kinID, 5, nr, pt);
ctFunc('kin_getDelta', kin.kinID, 5, nr, pt);
entropy = pt.Value;
end
@ -444,7 +444,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getDelta', kin.kinID, 1, nr, pt);
ctFunc('kin_getDelta', kin.kinID, 1, nr, pt);
gibbs = pt.Value;
end
@ -452,7 +452,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getDelta', kin.kinID, 4, nr, pt);
ctFunc('kin_getDelta', kin.kinID, 4, nr, pt);
gibbs = pt.Value;
end
@ -460,7 +460,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getEquilibriumConstants', kin.kinID, nr, pt);
ctFunc('kin_getEquilibriumConstants', kin.kinID, nr, pt);
k = pt.Value;
end
@ -468,7 +468,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getFwdRateConstants', kin.kinID, nr, pt);
ctFunc('kin_getFwdRateConstants', kin.kinID, nr, pt);
k = pt.Value;
end
@ -476,7 +476,7 @@ classdef Kinetics < handle
nr = kin.nReactions;
xx = zeros(1, nr);
pt = libpointer('doublePtr', xx);
callct('kin_getRevRateConstants', kin.kinID, 1, nr, pt);
ctFunc('kin_getRevRateConstants', kin.kinID, 1, nr, pt);
k = pt.Value;
end
@ -484,7 +484,7 @@ classdef Kinetics < handle
nsp = kin.nTotalSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('kin_getSourceTerms', kin.kinID, nsp, pt);
ctFunc('kin_getSourceTerms', kin.kinID, nsp, pt);
ydot = pt.Value;
end
@ -514,7 +514,7 @@ classdef Kinetics < handle
end
for i = 1:n
callct('kin_setMultiplier', kin.kinID, irxn(i) - 1, v);
ctFunc('kin_setMultiplier', kin.kinID, irxn(i) - 1, v);
end
end
@ -528,7 +528,7 @@ classdef Kinetics < handle
% Time interval by which the coverages should be advanced.
%
callct('kin_advanceCoverages', kin.kinID, dt);
ctFunc('kin_advanceCoverages', kin.kinID, dt);
end
end

View File

@ -258,7 +258,7 @@ classdef ThermoPhase < handle
error('ThermoPhase expects 2 input arguments.');
end
tp.tpID = callct('thermo_newFromFile', src, id);
tp.tpID = ctFunc('thermo_newFromFile', src, id);
tp.basis = 'molar';
end
@ -267,7 +267,7 @@ classdef ThermoPhase < handle
function tpClear(tp)
% Delete the :mat:class:`ThermoPhase` object.
callct('thermo_del', tp.tpID);
ctFunc('thermo_del', tp.tpID);
end
%% ThermoPhase Utility Methods
@ -343,7 +343,7 @@ classdef ThermoPhase < handle
loglevel = 0;
end
callct('thermo_equilibrate', tp.tpID, xy, solver, ...
ctFunc('thermo_equilibrate', tp.tpID, xy, solver, ...
rtol, maxsteps, maxiter, loglevel);
end
@ -353,7 +353,7 @@ classdef ThermoPhase < handle
nel = tp.nElements;
aa = zeros(1, nel);
pt = libpointer('doublePtr', aa);
callct('thermo_getAtomicWeights', tp.tpID, nel, pt);
ctFunc('thermo_getAtomicWeights', tp.tpID, nel, pt);
amu = pt.Value;
end
@ -361,7 +361,7 @@ classdef ThermoPhase < handle
nsp = tp.nSpecies;
yy = zeros(1, nsp);
pt = libpointer('doublePtr', yy);
callct('thermo_getCharges', tp.tpID, nsp, pt);
ctFunc('thermo_getCharges', tp.tpID, nsp, pt);
e = pt.Value;
end
@ -398,7 +398,7 @@ classdef ThermoPhase < handle
for i = 1:m
for j = 1:n
k(i, j) = callct('thermo_elementIndex', ...
k(i, j) = ctFunc('thermo_elementIndex', ...
tp.tpID, name{i, j}) + 1;
if k(i, j) > 1e3
@ -412,7 +412,7 @@ classdef ThermoPhase < handle
end
elseif ischar(name)
k = callct('thermo_elementIndex', tp.tpID, name) + 1;
k = ctFunc('thermo_elementIndex', tp.tpID, name) + 1;
if k > 1e3
warning(['Element ', name, ' does not exist in the phase']);
@ -480,18 +480,18 @@ classdef ThermoPhase < handle
end
function mmw = get.meanMolecularWeight(tp)
mmw = callct('thermo_meanMolecularWeight', tp.tpID);
mmw = ctFunc('thermo_meanMolecularWeight', tp.tpID);
end
function density = get.molarDensity(tp)
density = callct('thermo_molarDensity', tp.tpID);
density = ctFunc('thermo_molarDensity', tp.tpID);
end
function mw = get.molecularWeights(tp)
nsp = tp.nSpecies;
yy = zeros(1, nsp);
pt = libpointer('doublePtr', yy);
callct('thermo_getMolecularWeights', tp.tpID, nsp, pt);
ctFunc('thermo_getMolecularWeights', tp.tpID, nsp, pt);
mw = pt.Value;
end
@ -529,16 +529,16 @@ classdef ThermoPhase < handle
return
end
n = callct('thermo_nAtoms', tp.tpID, k - 1, m - 1);
n = ctFunc('thermo_nAtoms', tp.tpID, k - 1, m - 1);
end
function nel = get.nElements(tp)
nel = callct('thermo_nElements', tp.tpID);
nel = ctFunc('thermo_nElements', tp.tpID);
end
function nsp = get.nSpecies(tp)
nsp = callct('thermo_nSpecies', tp.tpID);
nsp = ctFunc('thermo_nSpecies', tp.tpID);
end
function k = speciesIndex(tp, name)
@ -576,7 +576,7 @@ classdef ThermoPhase < handle
for i = 1:m
for j = 1:n
k(i, j) = callct('thermo_speciesIndex', ...
k(i, j) = ctFunc('thermo_speciesIndex', ...
tp.tpID, name{i, j}) + 1;
if k(i, j) > 1e6
@ -590,7 +590,7 @@ classdef ThermoPhase < handle
end
elseif ischar(name)
k = callct('thermo_speciesIndex', ...
k = ctFunc('thermo_speciesIndex', ...
tp.tpID, name) + 1;
if k > 1e6
@ -636,15 +636,15 @@ classdef ThermoPhase < handle
end
function temperature = get.T(tp)
temperature = callct('thermo_temperature', tp.tpID);
temperature = ctFunc('thermo_temperature', tp.tpID);
end
function pressure = get.P(tp)
pressure = callct('thermo_pressure', tp.tpID);
pressure = ctFunc('thermo_pressure', tp.tpID);
end
function density = get.D(tp)
density = callct('thermo_density', tp.tpID);
density = ctFunc('thermo_density', tp.tpID);
end
function volume = get.V(tp)
@ -655,7 +655,7 @@ classdef ThermoPhase < handle
nsp = tp.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('thermo_getMoleFractions', tp.tpID, nsp, pt);
ctFunc('thermo_getMoleFractions', tp.tpID, nsp, pt);
moleFractions = pt.Value;
end
@ -705,7 +705,7 @@ classdef ThermoPhase < handle
nsp = tp.nSpecies;
yy = zeros(1, nsp);
pt = libpointer('doublePtr', yy);
callct('thermo_getMassFractions', tp.tpID, nsp, pt);
ctFunc('thermo_getMassFractions', tp.tpID, nsp, pt);
massFractions = pt.Value;
end
@ -757,16 +757,16 @@ classdef ThermoPhase < handle
nsp = tp.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('thermo_chemPotentials', tp.tpID, nsp, pt);
ctFunc('thermo_chemPotentials', tp.tpID, nsp, pt);
mu = pt.Value;
end
function c = get.cv(tp)
if strcmp(tp.basis, 'molar')
c = callct('thermo_cv_mole', tp.tpID);
c = ctFunc('thermo_cv_mole', tp.tpID);
elseif strcmp(tp.basis, 'mass')
c = callct('thermo_cv_mass', tp.tpID);
c = ctFunc('thermo_cv_mass', tp.tpID);
else error("basis not specified");
end
@ -775,28 +775,28 @@ classdef ThermoPhase < handle
function c = get.cp(tp)
if strcmp(tp.basis, 'molar')
c = callct('thermo_cp_mole', tp.tpID);
c = ctFunc('thermo_cp_mole', tp.tpID);
elseif strcmp(tp.basis, 'mass')
c = callct('thermo_cp_mass', tp.tpID);
c = ctFunc('thermo_cp_mass', tp.tpID);
else error("basis not specified");
end
end
function d = get.critDensity(tp)
d = callct('thermo_critDensity', tp.tpID);
d = ctFunc('thermo_critDensity', tp.tpID);
end
function p = get.critPressure(tp)
p = callct('thermo_critPressure', tp.tpID);
p = ctFunc('thermo_critPressure', tp.tpID);
end
function t = get.critTemperature(tp)
t = callct('thermo_critTemperature', tp.tpID);
t = ctFunc('thermo_critTemperature', tp.tpID);
end
function v = get.electricPotential(tp)
v = callct('thermo_electricPotential', tp.tpID);
v = ctFunc('thermo_electricPotential', tp.tpID);
end
function e = get.eosType(tp)
@ -814,19 +814,19 @@ classdef ThermoPhase < handle
end
function b = get.isothermalCompressibility(tp)
b = callct('thermo_isothermalCompressibility', tp.tpID);
b = ctFunc('thermo_isothermalCompressibility', tp.tpID);
end
function t = get.maxTemp(tp)
t = callct('thermo_maxTemp', tp.tpID, -1);
t = ctFunc('thermo_maxTemp', tp.tpID, -1);
end
function t = get.minTemp(tp)
t = callct('thermo_minTemp', tp.tpID, -1);
t = ctFunc('thermo_minTemp', tp.tpID, -1);
end
function p = get.refPressure(tp)
p = callct('thermo_refPressure', tp.tpID, -1);
p = ctFunc('thermo_refPressure', tp.tpID, -1);
end
function p = satPressure(tp, t)
@ -842,7 +842,7 @@ classdef ThermoPhase < handle
% :return:
% Saturation pressure for temperature T. Units: Pa.
p = callct('thermo_satPressure', tp.tpID, t);
p = ctFunc('thermo_satPressure', tp.tpID, t);
end
function t = satTemperature(tp, p)
@ -858,7 +858,7 @@ classdef ThermoPhase < handle
% :return:
% Saturation temperature for pressure p. Units: K.
t = callct('thermo_satTemperature', tp.tpID, p);
t = ctFunc('thermo_satTemperature', tp.tpID, p);
end
function c = get.soundSpeed(tp)
@ -883,19 +883,19 @@ classdef ThermoPhase < handle
end
function a = get.thermalExpansionCoeff(tp)
a = callct('thermo_thermalExpansionCoeff', tp.tpID);
a = ctFunc('thermo_thermalExpansionCoeff', tp.tpID);
end
function v = get.vaporFraction(tp)
v = callct('thermo_vaporFraction', tp.tpID);
v = ctFunc('thermo_vaporFraction', tp.tpID);
end
function enthalpy = get.H(tp)
if strcmp(tp.basis, 'molar')
enthalpy = callct('thermo_enthalpy_mole', tp.tpID);
enthalpy = ctFunc('thermo_enthalpy_mole', tp.tpID);
elseif strcmp(tp.basis, 'mass')
enthalpy = callct('thermo_enthalpy_mass', tp.tpID);
enthalpy = ctFunc('thermo_enthalpy_mass', tp.tpID);
else error("basis not specified");
end
@ -905,16 +905,16 @@ classdef ThermoPhase < handle
nsp = tp.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('thermo_getEnthalpies_RT', tp.tpID, nsp, pt);
ctFunc('thermo_getEnthalpies_RT', tp.tpID, nsp, pt);
enthalpy = pt.Value;
end
function entropy = get.S(tp)
if strcmp(tp.basis, 'molar')
entropy = callct('thermo_entropy_mole', tp.tpID);
entropy = ctFunc('thermo_entropy_mole', tp.tpID);
elseif strcmp(tp.basis, 'mass')
entropy = callct('thermo_entropy_mass', tp.tpID);
entropy = ctFunc('thermo_entropy_mass', tp.tpID);
else error("basis not specified");
end
@ -923,9 +923,9 @@ classdef ThermoPhase < handle
function intEnergy = get.U(tp)
if strcmp(tp.basis, 'molar')
intEnergy = callct('thermo_intEnergy_mole', tp.tpID);
intEnergy = ctFunc('thermo_intEnergy_mole', tp.tpID);
elseif strcmp(tp.basis, 'mass')
intEnergy = callct('thermo_intEnergy_mass', tp.tpID);
intEnergy = ctFunc('thermo_intEnergy_mass', tp.tpID);
else error("basis not specified");
end
@ -934,9 +934,9 @@ classdef ThermoPhase < handle
function gibbs = get.G(tp)
if strcmp(tp.basis, 'molar')
gibbs = callct('thermo_gibbs_mole', tp.tpID);
gibbs = ctFunc('thermo_gibbs_mole', tp.tpID);
elseif strcmp(tp.basis, 'mass')
gibbs = callct('thermo_gibbs_mass', tp.tpID);
gibbs = ctFunc('thermo_gibbs_mass', tp.tpID);
else error("basis not specified");
end
@ -1125,7 +1125,7 @@ classdef ThermoPhase < handle
% :param phi:
% Electric potential. Units: V
%
callct('thermo_setElectricPotential', tp.tpID, phi);
ctFunc('thermo_setElectricPotential', tp.tpID, phi);
end
function tp = setState_Psat(tp, p, q)
@ -1145,7 +1145,7 @@ classdef ThermoPhase < handle
% :param q:
% Vapor fraction
%
callct('thermo_setState_Psat', tp.tpID, p, q);
ctFunc('thermo_setState_Psat', tp.tpID, p, q);
end
function tp = setState_Tsat(tp, t, q)
@ -1165,7 +1165,7 @@ classdef ThermoPhase < handle
% :param q:
% Vapor fraction
%
callct('thermo_setState_Tsat', tp.tpID, t, 1 - q);
ctFunc('thermo_setState_Tsat', tp.tpID, t, 1 - q);
end
function tp = set.basis(tp, b)
@ -1181,15 +1181,15 @@ classdef ThermoPhase < handle
end
function set.T(tp, temperature)
callct('thermo_setTemperature', tp.tpID, temperature);
ctFunc('thermo_setTemperature', tp.tpID, temperature);
end
function set.P(tp, pressure)
callct('thermo_setPressure', tp.tpID, pressure);
ctFunc('thermo_setPressure', tp.tpID, pressure);
end
function set.D(tp, density)
callct('thermo_setDensity', tp.tpID, density);
ctFunc('thermo_setDensity', tp.tpID, density);
end
function set.X(tp, xx)
@ -1203,9 +1203,9 @@ classdef ThermoPhase < handle
else norm = 1;
end
callct('thermo_setMoleFractions', tp.tpID, nsp, xx, norm);
ctFunc('thermo_setMoleFractions', tp.tpID, nsp, xx, norm);
elseif isa(xx, 'char')
callct('thermo_setMoleFractionsByName', tp.tpID, xx);
ctFunc('thermo_setMoleFractionsByName', tp.tpID, xx);
end
end
@ -1220,9 +1220,9 @@ classdef ThermoPhase < handle
else norm = 1;
end
callct('thermo_setMassFractions', tp.tpID, nsp, yy, norm);
ctFunc('thermo_setMassFractions', tp.tpID, nsp, yy, norm);
elseif isa(yy, 'char')
callct('thermo_setMassFractionsByName', tp.tpID, yy);
ctFunc('thermo_setMassFractionsByName', tp.tpID, yy);
end
end
@ -1232,7 +1232,7 @@ classdef ThermoPhase < handle
function set.DP(tp, input)
d = input{1};
p = input{2};
callct('thermo_set_RP', tp.tpID, [d, p]);
ctFunc('thermo_set_RP', tp.tpID, [d, p]);
end
function set.DPX(tp, input)
@ -1248,7 +1248,7 @@ classdef ThermoPhase < handle
function set.HP(tp, input)
h = input{1};
p = input{2};
callct('thermo_set_HP', tp.tpID, [h, p]);
ctFunc('thermo_set_HP', tp.tpID, [h, p]);
end
function set.HPX(tp, input)
@ -1264,7 +1264,7 @@ classdef ThermoPhase < handle
function set.PV(tp, input)
p = input{1};
v = input{2};
callct('thermo_set_PV', tp.tpID, [p, v]);
ctFunc('thermo_set_PV', tp.tpID, [p, v]);
end
function set.PVX(tp, input)
@ -1280,7 +1280,7 @@ classdef ThermoPhase < handle
function set.SH(tp, input)
s = input{1};
h = input{2};
callct('thermo_set_SH', tp.tpID, [s, h]);
ctFunc('thermo_set_SH', tp.tpID, [s, h]);
end
function set.SHX(tp, input)
@ -1296,7 +1296,7 @@ classdef ThermoPhase < handle
function set.SP(tp, input)
s = input{1};
p = input{2};
callct('thermo_set_SP', tp.tpID, [s, p]);
ctFunc('thermo_set_SP', tp.tpID, [s, p]);
end
function set.SPX(tp, input)
@ -1312,7 +1312,7 @@ classdef ThermoPhase < handle
function set.ST(tp, input)
s = input{1};
t = input{2};
callct('thermo_set_ST', tp.tpID, [s, t]);
ctFunc('thermo_set_ST', tp.tpID, [s, t]);
end
function set.STX(tp, input)
@ -1328,7 +1328,7 @@ classdef ThermoPhase < handle
function set.SV(tp, input)
s = input{1};
v = input{2};
callct('thermo_set_SV', tp.tpID, [s, v]);
ctFunc('thermo_set_SV', tp.tpID, [s, v]);
end
function set.SVX(tp, input)
@ -1361,7 +1361,7 @@ classdef ThermoPhase < handle
function set.TH(tp, input)
t = input{1};
h = input{2};
callct('thermo_set_TH', tp.tpID, [t, h]);
ctFunc('thermo_set_TH', tp.tpID, [t, h]);
end
function set.THX(tp, input)
@ -1394,7 +1394,7 @@ classdef ThermoPhase < handle
function set.TV(tp, input)
t = input{1};
v = input{2};
callct('thermo_set_TV', tp.tpID, [t, v]);
ctFunc('thermo_set_TV', tp.tpID, [t, v]);
end
function set.TVX(tp, input)
@ -1410,7 +1410,7 @@ classdef ThermoPhase < handle
function set.UP(tp, input)
u = input{1};
p = input{2};
callct('thermo_set_UP', tp.tpID, [u, p]);
ctFunc('thermo_set_UP', tp.tpID, [u, p]);
end
function set.UPX(tp, input)
@ -1426,7 +1426,7 @@ classdef ThermoPhase < handle
function set.UV(tp, input)
u = input{1};
v = input{2};
callct('thermo_set_UV', tp.tpID, [u, v]);
ctFunc('thermo_set_UV', tp.tpID, [u, v]);
end
function set.UVX(tp, input)
@ -1442,7 +1442,7 @@ classdef ThermoPhase < handle
function set.VH(tp, input)
v = input{1};
h = input{2};
callct('thermo_set_VH', tp.tpID, [v, h]);
ctFunc('thermo_set_VH', tp.tpID, [v, h]);
end
function set.VHX(tp, input)

View File

@ -72,9 +72,9 @@ classdef Transport < handle
tr.th = tp;
if strcmp(model, 'default')
tr.trID = callct('trans_newDefault', tp.tpID, loglevel);
tr.trID = ctFunc('trans_newDefault', tp.tpID, loglevel);
else
tr.trID = callct('trans_new', model, tp.tpID, loglevel);
tr.trID = ctFunc('trans_new', model, tp.tpID, loglevel);
end
tr.tpID = tp.tpID;
@ -85,28 +85,28 @@ classdef Transport < handle
function delete(tr)
% Delete the :mat:class:`Transport` object.
callct('trans_del', tr.trID);
ctFunc('trans_del', tr.trID);
end
%% Transport Get Methods
function v = get.viscosity(tr)
v = callct('trans_viscosity', tr.trID);
v = ctFunc('trans_viscosity', tr.trID);
end
function v = get.thermalConductivity(tr)
v = callct('trans_thermalConductivity', tr.trID);
v = ctFunc('trans_thermalConductivity', tr.trID);
end
function v = get.electricalConductivity(tr)
v = callct('trans_electricalConductivity', tr.trID);
v = ctFunc('trans_electricalConductivity', tr.trID);
end
function v = get.mixDiffCoeffs(tr)
nsp = tr.th.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('trans_getMixDiffCoeffs', tr.trID, nsp, pt);
ctFunc('trans_getMixDiffCoeffs', tr.trID, nsp, pt);
v = pt.Value;
end
@ -114,7 +114,7 @@ classdef Transport < handle
nsp = tr.th.nSpecies;
xx = zeros(1, nsp);
pt = libpointer('doublePtr', xx);
callct('trans_getThermalDiffCoeffs', tr.trID, nsp, pt);
ctFunc('trans_getThermalDiffCoeffs', tr.trID, nsp, pt);
v = pt.Value;
end
@ -122,7 +122,7 @@ classdef Transport < handle
nsp = tr.th.nSpecies;
xx = zeros(nsp, nsp);
pt = libpointer('doublePtr', xx);
callct('trans_getBinDiffCoeffs', tr.trID, nsp, pt);
ctFunc('trans_getBinDiffCoeffs', tr.trID, nsp, pt);
v = pt.Value;
end
@ -130,7 +130,7 @@ classdef Transport < handle
nsp = tr.th.nSpecies;
xx = zeros(nsp, nsp);
pt = libpointer('doublePtr', xx);
callct('trans_getMultiDiffCoeffs', tr.trID, nsp, pt);
ctFunc('trans_getMultiDiffCoeffs', tr.trID, nsp, pt);
v = pt.Value;
end
@ -145,7 +145,7 @@ classdef Transport < handle
% :param k:
% :param p:
callct('trans_setParameters', tr.trID, type, k, p);
ctFunc('trans_setParameters', tr.trID, type, k, p);
end
function setThermalConductivity(tr, lam)

View File

@ -81,12 +81,12 @@ classdef Func < handle
if itype < 20
[msize, nsize] = size(p);
lenp = msize * nsize;
nn = callct('func_new', itype, n, lenp, p);
nn = ctFunc('func_new', itype, n, lenp, p);
elseif itype < 45
m = p;
nn = callct('func_new', itype, n, m, 0);
nn = ctFunc('func_new', itype, n, m, 0);
else
nn = callct('func_new', itype, n, 0, p);
nn = ctFunc('func_new', itype, n, 0, p);
end
end
@ -136,7 +136,7 @@ classdef Func < handle
function delete(f)
% Delete the :mat:class:`Func` object.
callct('func_del', f.id);
ctFunc('func_del', f.id);
end
%% Func Class Utility Methods
@ -174,7 +174,7 @@ classdef Func < handle
b = zeros(1, length(ind));
for k = 1:length(ind)
b(k) = callct('func_value', a.id, ind(k));
b(k) = ctFunc('func_value', a.id, ind(k));
end
elseif strcmp(s.type, '.')

View File

@ -68,7 +68,7 @@ classdef FlowDevice < handle
end
x.type = typ;
x.id = callct('flowdev_new', typ);
x.id = ctFunc('flowdev_new', typ);
x.upstream = -1;
x.downstream = -1;
end
@ -78,7 +78,7 @@ classdef FlowDevice < handle
function delete(f)
% Delete the :mat:class:`FlowDevice` object.
callct('flowdev_del', f.id);
ctFunc('flowdev_del', f.id);
end
%% Utility Methods
@ -106,7 +106,7 @@ classdef FlowDevice < handle
i = upstream.id;
j = downstream.id;
callct('flowdev_install', f.id, i, j);
ctFunc('flowdev_install', f.id, i, j);
else error('install requires 3 arguments');
end
@ -115,7 +115,7 @@ classdef FlowDevice < handle
%% Flowdevice Get Methods
function mdot = get.massFlowRate(f)
mdot = callct('flowdev_massFlowRate2', f.id);
mdot = ctFunc('flowdev_massFlowRate2', f.id);
end
%% Flowdevice Set Methods
@ -124,9 +124,9 @@ classdef FlowDevice < handle
if strcmp(f.type, 'MassFlowController')
if isa(mdot, 'double')
k = callct('flowdev_setMassFlowCoeff', f.id, mdot);
k = ctFunc('flowdev_setMassFlowCoeff', f.id, mdot);
elseif isa(mdot, 'Func')
k = callct('flowdev_setTimeFunction', f.id, mdot.id);
k = ctFunc('flowdev_setTimeFunction', f.id, mdot.id);
else
error('Mass flow rate must either be a value or function.');
end
@ -148,7 +148,7 @@ classdef FlowDevice < handle
% Instance of class :mat:class:`Func`
%
if strcmp(f.type, 'PressureController')
k = callct('flowdev_setMaster', f.id, d);
k = ctFunc('flowdev_setMaster', f.id, d);
else
error('Master flow device can only be set for pressure controllers.');
end
@ -161,7 +161,7 @@ classdef FlowDevice < handle
error('Valve coefficient can only be set for valves.');
end
ok = callct('flowdev_setValveCoeff', f.id, k);
ok = ctFunc('flowdev_setValveCoeff', f.id, k);
end
end

View File

@ -125,7 +125,7 @@ classdef Reactor < handle
end
r.type = char(typ);
r.id = callct('reactor_new', typ);
r.id = ctFunc('reactor_new', typ);
if isa(content, 'Solution')
r.contents = content;
@ -133,10 +133,10 @@ classdef Reactor < handle
error('Wrong object type');
end
callct('reactor_setThermoMgr', r.id, content.tpID);
ctFunc('reactor_setThermoMgr', r.id, content.tpID);
if ~strcmp(r.type, 'Reservoir')
callct('reactor_setKineticsMgr', r.id, content.kinID);
ctFunc('reactor_setKineticsMgr', r.id, content.kinID);
end
elseif ~(isa(content, 'double') && content == 0)
@ -150,7 +150,7 @@ classdef Reactor < handle
function delete(r)
% Delete the :mat:class:`Reactor` object.
callct('reactor_del', r.id);
ctFunc('reactor_del', r.id);
end
%% Reactor Utility Methods
@ -166,37 +166,37 @@ classdef Reactor < handle
% Index number of reaction.
%
callct('reactor_addSensitivityReaction', r.id, m);
ctFunc('reactor_addSensitivityReaction', r.id, m);
end
%% Reactor Get Methods
function temperature = get.T(r)
temperature = callct('reactor_temperature', r.id);
temperature = ctFunc('reactor_temperature', r.id);
end
function pressure = get.P(r)
pressure = callct('reactor_pressure', r.id);
pressure = ctFunc('reactor_pressure', r.id);
end
function rho = get.D(r)
rho = callct('reactor_density', r.id);
rho = ctFunc('reactor_density', r.id);
end
function mass = get.M(r)
mass = callct('reactor_mass', r.id);
mass = ctFunc('reactor_mass', r.id);
end
function volume = get.V(r)
volume = callct('reactor_volume', r.id);
volume = ctFunc('reactor_volume', r.id);
end
function enthalpy_mass = get.H(r)
enthalpy_mass = callct('reactor_enthalpy_mass', r.id);
enthalpy_mass = ctFunc('reactor_enthalpy_mass', r.id);
end
function intEnergy_mass = get.U(r)
intEnergy_mass = callct('reactor_intEnergy_mass', r.id);
intEnergy_mass = ctFunc('reactor_intEnergy_mass', r.id);
end
function yi = massFraction(r, species)
@ -210,7 +210,7 @@ classdef Reactor < handle
else k = species - 1;
end
yi = callct('reactor_massFraction', r.id, k);
yi = ctFunc('reactor_massFraction', r.id, k);
end
function massFractions = get.Y(r)
@ -228,13 +228,13 @@ classdef Reactor < handle
function set.V(r, v0)
callct('reactor_setInitialVolume', r.id, v0);
ctFunc('reactor_setInitialVolume', r.id, v0);
end
function set.massFlowRate(r, MFR)
callct('reactor_setMassFlowRate', r.id, MFR);
ctFunc('reactor_setMassFlowRate', r.id, MFR);
r.massFlowRate = MFR;
end
@ -248,7 +248,7 @@ classdef Reactor < handle
else error('Input must be "on" or "off"');
end
callct('reactor_setChemistry', r.id, cflag);
ctFunc('reactor_setChemistry', r.id, cflag);
end
function set.energy(r, flag)
@ -260,7 +260,7 @@ classdef Reactor < handle
else error('Input must be "on" or "off".');
end
callct('reactor_setEnergy', r.id, eflag);
ctFunc('reactor_setEnergy', r.id, eflag);
end

View File

@ -73,13 +73,13 @@ classdef ReactorNet < handle
reactors = {reactor};
end
r.id = callct('reactornet_new');
r.id = ctFunc('reactornet_new');
% add reactors
nr = length(reactors);
for i = 1:nr
callct('reactornet_addreactor', r.id, reactors{i}.id);
ctFunc('reactornet_addreactor', r.id, reactors{i}.id);
end
end
@ -89,7 +89,7 @@ classdef ReactorNet < handle
function delete(r)
% Delete the :mat:class:`ReactorNet` object object.
callct('reactornet_del', r.id);
ctFunc('reactornet_del', r.id);
end
%% ReactorNet Utility Methods
@ -110,13 +110,13 @@ classdef ReactorNet < handle
% End time of the integration. Unit: s.
%
callct('reactornet_advance', r.id, tout);
ctFunc('reactornet_advance', r.id, tout);
end
%% ReactorNet set methods
function set.time(r, t)
callct('reactornet_setInitialTime', r.id, t);
ctFunc('reactornet_setInitialTime', r.id, t);
end
function set.maxTimeStep(r, maxstep)
@ -136,7 +136,7 @@ classdef ReactorNet < handle
% Scalar max time step.
%
callct('reactornet_setMaxTimeStep', r.id, maxstep);
ctFunc('reactornet_setMaxTimeStep', r.id, maxstep);
end
function setSensitivityTolerances(r, rerr, aerr)
@ -149,35 +149,35 @@ classdef ReactorNet < handle
% :param aerr:
% Scalar absolute error tolerance.
callct('reactornet_setSensitivityTolerances', r.id, rerr, aerr);
ctFunc('reactornet_setSensitivityTolerances', r.id, rerr, aerr);
end
function set.atol(r, aeer)
rerr = r.rtol;
callct('reactornet_setTolerances', r.id, rerr, aerr);
ctFunc('reactornet_setTolerances', r.id, rerr, aerr);
end
function set.rtol(r, reer)
aerr = r.atol;
callct('reactornet_setTolerances', r.id, rerr, aerr);
ctFunc('reactornet_setTolerances', r.id, rerr, aerr);
end
%% ReactorNet get methods
function t = get.dt(r)
t = callct('reactor_step', r.id);
t = ctFunc('reactor_step', r.id);
end
function t = get.time(r)
t = callct('reactornet_time', r.id);
t = ctFunc('reactornet_time', r.id);
end
function t = get.atol(r)
t = callct('reactornet_atol', r.id);
t = ctFunc('reactornet_atol', r.id);
end
function t = get.rtol(r)
t = callct('reactornet_rtol', r.id);
t = ctFunc('reactornet_rtol', r.id);
end
function s = sensitivity(r, component, p, rxtr)
@ -194,7 +194,7 @@ classdef ReactorNet < handle
% Instance of class 'reactor'.
if isa(component, 'string')
callct('reactornet_sensitivity', r.id, component, p, rxtr.id);
ctFunc('reactornet_sensitivity', r.id, component, p, rxtr.id);
end
end

View File

@ -48,7 +48,7 @@ classdef ReactorSurface < handle
ctIsLoaded;
s.surfID = callct('reactorsurface_new', 0);
s.surfID = ctFunc('reactorsurface_new', 0);
s.reactor = -1;
if nargin >= 1
@ -58,14 +58,14 @@ classdef ReactorSurface < handle
ikin = surf.kinID;
end
callct('reactorsurface_setkinetics', s.surfID, ikin);
ctFunc('reactorsurface_setkinetics', s.surfID, ikin);
end
if nargin >= 2
if isa(reactor, 'Reactor')
s.reactor = reactor;
callct('reactorsurface_install', s.surfID, reactor.id);
ctFunc('reactorsurface_install', s.surfID, reactor.id);
else
warning('Reactor was not installed due to incorrect type');
end
@ -89,7 +89,7 @@ classdef ReactorSurface < handle
function delete(s)
% Delete the :mat:class:`ReactorSurface` object.
callct('reactorsurface_del', s.surfID);
ctFunc('reactorsurface_del', s.surfID);
end
%% ReactorSurface Utility Methods
@ -104,19 +104,19 @@ classdef ReactorSurface < handle
% :param m:
% Index number of reaction.
callct('reactorsurface_addSensitivityReaction', s.surfID, m);
ctFunc('reactorsurface_addSensitivityReaction', s.surfID, m);
end
%% ReactorSurface Get Methods
function a = get.area(s)
a = callct('reactorsurface_area', s.surfID);
a = ctFunc('reactorsurface_area', s.surfID);
end
%% ReactorSurface Set Methods
function set.area(s, a)
callct('reactorsurface_setArea', s.surfID, a);
ctFunc('reactorsurface_setArea', s.surfID, a);
end
end

View File

@ -94,12 +94,12 @@ classdef Wall < handle
typ = 'Wall';
w.type = char(typ);
w.id = callct('wall_new', w.type);
w.id = ctFunc('wall_new', w.type);
% Install the wall between left and right reactors
w.left = l;
w.right = r;
callct('wall_install', w.id, l.id, r.id);
ctFunc('wall_install', w.id, l.id, r.id);
% Set default values.
w.area = 1.0;
@ -107,7 +107,7 @@ classdef Wall < handle
w.heatTransferCoeff = 0.0;
% Check whether the wall is ready.
ok = callct('wall_ready', w.id);
ok = ctFunc('wall_ready', w.id);
if ok
disp('The wall object is ready.');
else
@ -121,54 +121,54 @@ classdef Wall < handle
function delete(w)
% Clear the :mat:class:`Wall` object.
callct('wall_del', w.id);
ctFunc('wall_del', w.id);
end
%% ReactorNet get methods
function a = get.area(w)
a = callct('wall_area', w.id);
a = ctFunc('wall_area', w.id);
end
function q = qdot(w, t)
% Total heat transfer rate through a wall at a given time t.
q = callct('wall_Q', w.id, t);
q = ctFunc('wall_Q', w.id, t);
end
function v = vdot(w, t)
% Rate of volumetric change at a given time t.
v = callct('wall_vdot', w.id, t);
v = ctFunc('wall_vdot', w.id, t);
end
%% ReactorNet set methods
function set.area(w, a)
callct('wall_setArea', w.id, a);
ctFunc('wall_setArea', w.id, a);
end
function set.thermalResistance(w, r)
callct('wall_setThermalResistance', w.id, r);
ctFunc('wall_setThermalResistance', w.id, r);
end
function set.heatTransferCoeff(w, u)
callct('wall_setHeatTransferCoeff', w.id, u);
ctFunc('wall_setHeatTransferCoeff', w.id, u);
end
function set.emissivity(w, epsilon)
callct('wall_setEmissivity', w.id, epsilon);
ctFunc('wall_setEmissivity', w.id, epsilon);
end
function set.expansionRateCoeff(w, k)
callct('wall_setExpansionRateCoeff', w.id, k);
ctFunc('wall_setExpansionRateCoeff', w.id, k);
end
function set.heatFlux(w, f)
callct('wall_setHeatFlux', w.id, f.id);
ctFunc('wall_setHeatFlux', w.id, f.id);
end
function set.velocity(w, f)
callct('wall_setVelocity', w.id, f.id);
ctFunc('wall_setVelocity', w.id, f.id);
end
end

View File

@ -1,4 +1,4 @@
function output = callct(varargin)
function output = ctFunc(varargin)
% Calls Cantera library functions with single outputs and returns
% errors if necessary.