Deleted Preset Mixture Phases and Removed Unnecessary Code

This commit is contained in:
ssun30 2022-09-07 15:02:46 -04:00 committed by Ray Speth
parent e54cc97c56
commit 4331aec4ad
14 changed files with 16 additions and 76 deletions

View File

@ -29,22 +29,22 @@ function flame = CounterFlowDiffusionFlame(left, flow, right, tp_f, tp_o, oxidiz
if nargin ~= 6
error('CounterFlowDiffusionFlame expects six input arguments.');
end
if ~isIdealGas(tp_f)
if ~tp_f.isIdealGas
error('Fuel gas object must represent an ideal gas mixture.');
end
if ~isIdealGas(tp_o)
if ~tp_o.isIdealGas
error('Oxidizer gas object must represent an ideal gas mixture.');
end
if ~isInlet(left)
if ~left.isInlet
error('Left inlet object of wrong type.');
end
if ~isFlow(flow)
if ~flow.isFlow
error('Flow object of wrong type.');
end
if ~isInlet(right)
if ~right.isInlet
error('Right inlet object of wrong type.');
end
if ~ischar(oxidizer)
if ~oxidizer.ischar
error('Oxidizer name must be of format character.');
end
@ -74,8 +74,8 @@ function flame = CounterFlowDiffusionFlame(left, flow, right, tp_f, tp_o, oxidiz
% conditions. The stoichiometric mixture fraction, Zst, is then
% calculated.
sFuel = elMoles(tp_f, 'O')- 2*elMoles(tp_f, 'C')- 0.5*elMoles(tp_f, 'H');
sOx = elMoles(tp_o, 'O')- 2*elMoles(tp_o, 'C')- 0.5*elMoles(tp_o, 'H');
sFuel = tp_f.elMoles('O')- 2*tp_f.elMoles('C')- 0.5*tp_f.elMoles('H');
sOx = tp_o.elMoles('O')- 2*tp_o.elMoles('C')- 0.5*tp_o.elMoles('H');
phi = sFuel/sOx;
zst = 1.0/(1.0 - phi);

View File

@ -87,9 +87,6 @@ classdef Domain1D < handle
error('Unknown domain type.');
end
end
% if d.domainID < 0
% error(geterr);
% end
d.type = a;
end

View File

@ -39,9 +39,6 @@ classdef Stack < handle
help(Stack);
error('Wrong number of :parameters.');
end
% if s.stID < 0
% error(geterr);
% end
end
%% Utility Methods

View File

@ -1,12 +0,0 @@
function gas = Air()
% Create an object representing air.
% gas = Air()
% Air is modeled as an ideal gas mixture. The specification is taken
% from file ``air.yaml``. Several reactions among oxygen and nitrogen are
% defined. Mixture-averaged transport is specified by default.
%
% :return:
% Instance of class :mat:func:`Solution`
%
gas = Solution('air.yaml', 'air');
end

View File

@ -291,7 +291,7 @@ classdef ThermoPhase < handle
if nargin ~= 2
error('elementalMassFraction expects two input arguments.');
end
if ~isIdealGas(tp)
if ~tp.isIdealGas
error('Gas object must represent an ideal gas mixture.');
end
if ~ischar(element)
@ -584,16 +584,6 @@ classdef ThermoPhase < handle
callct('thermo_getMoleFractions', ...
tp.tpID, nsp, pt);
moleFractions = pt.Value;
% if no output argument is specified, a bar plot is produced.
if nargout == 0
figure
set(gcf, 'Name', 'Mole Fractions')
bar(moleFractions)
xlabel('Species Number')
ylabel('Mole Fraction')
title('Species Mole Fractions')
end
end
function x = moleFraction(tp, species)
@ -646,16 +636,6 @@ classdef ThermoPhase < handle
callct('thermo_getMassFractions', ...
tp.tpID, nsp, pt);
massFractions = pt.Value;
% If no output argument is specified, a bar plot is produced.
if nargout == 0
figure
set(gcf, 'Name', 'Mole Fractions')
bar(massFractions)
xlabel('Species Number')
ylabel('Mole Fraction')
title('Species Mole Fractions')
end
end
function y = massFraction(tp, species)
@ -838,7 +818,6 @@ classdef ThermoPhase < handle
else
v = 0;
end
v = 1;
end
function b = isothermalCompressibility(tp)

View File

@ -52,11 +52,6 @@ classdef Transport < handle
% Double dynamic viscosity. Unit: Pa*s.
v = callct('trans_viscosity', tr.trID);
if v == -1.0
error(geterr);
elseif v < 0.0
error('exception raised');
end
end
function v = thermalConductivity(tr)
@ -66,11 +61,6 @@ classdef Transport < handle
% Double thermal conductivity. Unit: W/m-K.
v = callct('trans_thermalConductivity', tr.trID);
if v == -1.0
error(geterr);
elseif v < 0.0
error('exception raised');
end
end
function v = electricalConductivity(tr)
@ -80,11 +70,6 @@ classdef Transport < handle
% Double electrical conductivity. Unit: S/m.
v = callct('trans_electricalConductivity', tr.trID);
if v == -1.0
error(geterr);
elseif v < 0.0
error('exception raised');
end
end
function v = mixDiffCoeffs(tr)

View File

@ -38,9 +38,6 @@ classdef ReactorSurface < handle
s.surfID = callct('reactorsurface_new', 0);
s.reactor = -1;
if s.surfID < 0
error(geterr);
end
if nargin >= 1
s.setKinetics(kleft);

View File

@ -75,9 +75,6 @@ classdef Wall < handle
x.type = char(typ);
x.id = callct('wall_new', x.type);
if x.id < 0
error(geterr);
end
x.left = -1;
x.right = -1;

View File

@ -40,8 +40,8 @@ refine_grid = 1; % 1 to enable refinement, 0 to disable
% These objects will be used to evaluate all thermodynamic, kinetic, and
% transport properties.
fuel = GRI30(transport);
ox = GRI30(transport);
fuel = Solution('gri30.yaml', 'gri30', transport);
ox = Solution('gri30.yaml', 'gri30', transport);
oxcomp = 'O2:0.21, N2:0.78'; % Air composition
fuelcomp = 'C2H6:1'; % Fuel composition
% Set each gas mixture state with the corresponding composition.

View File

@ -16,7 +16,7 @@ function equil(g)
if nargin == 1
gas = g;
else
gas = GRI30;
gas = Solution('gri30.yaml', 'gri30');
end
nsp = gas.nSpecies;

View File

@ -17,7 +17,7 @@ function prandtl1(g)
if nargin == 1
gas = g;
else
gas = GRI30('Mix');
gas = Solution('gri30.yaml', 'gri30', 'Mix');
end
pr = zeros(31,31);

View File

@ -16,7 +16,7 @@ function prandtl2(g)
if nargin == 1
gas = g;
else
gas = GRI30('Multi');
gas = Solution('gri30.yaml', 'gri30', 'Multi');
end
pr = zeros(31,31);

View File

@ -17,7 +17,7 @@ function reactor1(g)
if nargin == 1
gas = g;
else
gas = GRI30('None');
gas = Solution('gri30.yaml', 'gri30', 'None');
end
P = 101325.0;

View File

@ -17,7 +17,7 @@ function reactor2(g)
if nargin == 1
gas = g;
else
gas = GRI30('None');
gas = Solution('gri30.yaml', 'gri30', 'None');
end
% set the initial conditions