Tutorials/Sconscript/Docs

This commit is contained in:
ssun30 2022-06-30 20:56:51 -04:00 committed by Ray Speth
parent 1df1da16d9
commit c8e024d73e
5 changed files with 13 additions and 11 deletions

View File

@ -1,3 +0,0 @@
function SetCanteraPath(cantera_root)
save('Utility/cantera_root.mat','cantera_root');
end

View File

@ -1,21 +1,16 @@
function LoadCantera
addpath('Class', 'Utility', 'PresetFlowDevices', 'PresetFunctors', ...
'PresetMixtures', 'PresetReactors', '1D');
if ispc
ctname = 'cantera_shared.dll';
elseif ismac
ctname = 'libcantera_shared.dylib';
elseif isunix
ctname = 'libcantera_shared.so';
else
error('Operating System Not Supported!');
return;
end
if ~libisloaded(ct)
load('Utility/cantera_root.mat');
addpath([cantera_root, '/samples/matlab_new']);
[~,warnings] = loadlibrary([cantera_root '/lib/' ctname], ...
[~,warnings] = loadlibrary([cantera_root '/Lib/' ctname], ...
[cantera_root '/include/cantera/clib/ctmatlab.h'], ...
'includepath', [cantera_root '/include'], ...
'addheader','ct','addheader','ctfunc', ...
@ -23,8 +18,6 @@ function LoadCantera
'ctonedim','addheader','ctreactor', ...
'addheader','ctrpath','addheader','ctsurf', ...
'addheader','ctxml');
example_dir = [cantera_root, '/samples/matlab_new'];
addpath(example_dir);
end
disp('Cantera is ready for use');
end

View File

@ -0,0 +1,12 @@
% runs selected examples without pausing
equil();
isentropic();
reactor1();
reactor2();
surfreactor;
periodic_cstr;
rankine(300.0, 2.0*oneatm, 0.8, 0.7);
prandtl1();
flame1;
catcomb;
exit;