Skip to content

Commit

Permalink
Changed several naming conventions to match main branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssun30 authored and speth committed May 11, 2023
1 parent 7f7a0fa commit df17f4e
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 25 deletions.
13 changes: 7 additions & 6 deletions interfaces/matlab_experimental/Base/Solution.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
% ``phase_name``. If a :mat:class:`Transport` model is included in ``input.yaml``,
% it will be included in the :mat:class:`Solution` instance with the default
% transport modeling as set in the input file. To specify the transport modeling,
% set the input argument ``trans`` to one of ``'default'``, ``'None'``, ``'Mix'``,
% or ``'Multi'``.
% set the input argument ``trans`` to one of ``'default'``, ``'none'``,
% ``'mixture-averaged'``, or ``'multicomponent'``.
% In this case, the phase name must be specified as well. Alternatively,
% change the ``transport`` node in the YAML file, or ``transport``
% property in the CTI file before loading the phase. The transport
Expand All @@ -41,8 +41,9 @@
% :param id:
% ID of the phase to import as specified in the YAML file.
% :param trans:
% String, transport modeling. Possible values are ``'default'``, ``'None'``,
% ``'Mix'``, or ``'Multi'``. If not specified, ``'default'`` is used.
% String, transport modeling. Possible values are ``'default'``, ``'none'``,
% ``'mixture-averaged'``, or ``'multicomponent'``. If not specified,
% ``'default'`` is used.
% :return:
% Instance of class :mat:class:`Solution`.

Expand All @@ -66,8 +67,8 @@
s@ThermoPhase(src, id);
s@Kinetics(tp, src, id);
if nargin == 3
if ~(strcmp(trans, 'default') || strcmp(trans, 'None')...
|| strcmp(trans, 'Mix') || strcmp(trans, 'Multi'))
if ~(strcmp(trans, 'default') || strcmp(trans, 'none')...
|| strcmp(trans, 'mixture-averaged') || strcmp(trans, 'multicomponent'))
error('Unknown transport modelling specified.');
end
else
Expand Down
10 changes: 6 additions & 4 deletions interfaces/matlab_experimental/Base/Transport.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@
% Create a new instance of class :mat:class:`Transport`. One to three
% arguments may be supplied. The first must be an instance of class
% :mat:class:`ThermoPhase`. The second (optional) argument is the type of
% model desired, specified by the string ``'default'``, ``'Mix'`` or
% ``'Multi'``. ``'default'`` uses the default transport specified in the
% phase definition. The third argument is the logging level desired.
% model desired, specified by the string ``'default'``,
% ``'mixture-averaged'`` or ``'multicomponent'``. ``'default'``
% uses the default transport specified in the phase definition.
% The third argument is the logging level desired.
%
% :param th:
% Instance of class :mat:class:`ThermoPhase`
% :param model:
% String indicating the transport model to use. Possible values
% are ``'default'``, ``'None'``, ``'Mix'``, and ``'Multi'``.
% are ``'default'``, ``'none'``, ``'mixture-averaged'``,
% and ``'multicomponent'``.
% Optional.
% :param loglevel:
% Level of diagnostic logging. Default if not specified is 4.
Expand Down
12 changes: 6 additions & 6 deletions interfaces/matlab_experimental/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Installation guide:
3. For first time users, launch Matlab, then navigate to [/path/to/cantera/source/code]
using "Browse for Folder". 3.5) Note for Ubuntu users, Matlab must be launched from
the terminal using the following command:
`LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6' matlab`. This is because
Matlab does not load the correct GLIBC++ library on start-up and will return an error
when loading the Cantera toolbox.
`LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6' matlab -softwareopengl`.
This is because Matlab does not load the correct GLIBC++ library on start-up and
will return an error when loading the Cantera toolbox.
4. In the Maltab command window, run
`addpath(genpath([pwd, '/interfaces/matlab_experimental']))` to add search path for
the experimental toolbox.
Expand All @@ -31,9 +31,9 @@ Installation guide:
and samples files are removed (if it's already installed). Having both the current
and experimental version of the toolbox in the search path will lead to conflicts.
9. In the Matlab command window, run `savepath` to save all search paths.
10. To start using the experimental toolbox, run `LoadCantera` command.
11. To stop using the new Cantera interface, run the following commands: `clear all`
`cleanup` `UnloadCantera`
10. To start using the experimental toolbox, run `ctLoad` command.
11. To stop using the new Cantera interface, run the following commands:
`ctCleanUp` `ctUnload`.
12. To switch back to the current matlab toolbox, undo steps 3, 4, 5, 8, and 9. The
command to remove search path in Matlab is `rmpath`.
13. A future updates will add automated installation.
2 changes: 1 addition & 1 deletion samples/matlab_experimental/catcomb.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
tinlet = 300.0; % inlet temperature
tsurf = 900.0; % surface temperature
mdot = 0.06; % kg/m^2/s
transport = 'Mix'; % transport model
transport = 'mixture-averaged'; % transport model

% Solve first for a hydrogen/air case for use as the initial estimate for
% the methane/air case.
Expand Down
2 changes: 1 addition & 1 deletion samples/matlab_experimental/flame1.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
% This object will be used to evaluate all thermodynamic, kinetic,
% and transport properties

gas = Solution(rxnmech, 'ohmech', 'Mix');
gas = Solution(rxnmech, 'ohmech', 'mixture-averaged');

% set its state to that of the unburned gas at the burner
gas.TPX = {tburner, p, comp};
Expand Down
2 changes: 1 addition & 1 deletion samples/matlab_experimental/flame2.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
% This object will be used to evaluate all thermodynamic, kinetic,
% and transport properties

gas = Solution(rxnmech, 'gri30', 'Mix');
gas = Solution(rxnmech, 'gri30', 'mixture-averaged');

% set its state to that of the fuel (arbitrary)
gas.TPX = {tin, p, comp2};
Expand Down
2 changes: 1 addition & 1 deletion samples/matlab_experimental/prandtl1.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function prandtl1(g)
if nargin == 1
gas = g;
else
gas = Solution('gri30.yaml', 'gri30', 'Mix');
gas = Solution('gri30.yaml', 'gri30', 'mixture-averaged');
end

pr = zeros(31, 31);
Expand Down
2 changes: 1 addition & 1 deletion samples/matlab_experimental/prandtl2.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function prandtl2(g)
if nargin == 1
gas = g;
else
gas = Solution('gri30.yaml', 'gri30', 'Multi');
gas = Solution('gri30.yaml', 'gri30', 'multicomponent');
end

pr = zeros(31, 31);
Expand Down
4 changes: 2 additions & 2 deletions samples/matlab_experimental/reactor1.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function reactor1(g)
if nargin == 1
gas = g;
else
gas = Solution('gri30.yaml', 'gri30', 'None');
gas = Solution('gri30.yaml', 'gri30', 'none');
end

P = 101325.0;
Expand All @@ -33,7 +33,7 @@ function reactor1(g)
r = IdealGasReactor(gas);

% create a reservoir to represent the environment
a = Solution('air.yaml', 'air', 'None');
a = Solution('air.yaml', 'air', 'none');
a.TP = {a.T, P};
env = Reservoir(a);

Expand Down
2 changes: 1 addition & 1 deletion samples/matlab_experimental/reactor2.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function reactor2(g)
if nargin == 1
gas = g;
else
gas = Solution('gri30.yaml', 'gri30', 'None');
gas = Solution('gri30.yaml', 'gri30', 'none');
end

% set the initial conditions
Expand Down
2 changes: 1 addition & 1 deletion samples/matlab_experimental/surf_reactor.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
r.V = 1.0e-6;

% create a reservoir to represent the environment
a = Solution('air.yaml', 'air', 'None');
a = Solution('air.yaml', 'air', 'none');
a.TP = {t, OneAtm};
env = Reservoir(a);

Expand Down

0 comments on commit df17f4e

Please sign in to comment.