New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples from "Defining Phases" to the documentation #313
Comments
It's left over from when I was converting the "Defining Phases" guide (SourceForge download) to RST. I never got around to adding the examples from that guide to the CTI guide (and it's not entirely clear to me that they belong there anyway). |
OK I changed the title to reflect what could be done to resolve the issue. |
This is a somewhat stale issue, but adding an example/some documentation here seems like something I can do... |
I am new and would like to start contributing.Can I take up this issue? |
Sure, see the comment on the other PR for where a good place to get started it. |
@speth Is the example on page 52 (55 of the PDF, copied below) already in the examples? It seems functionally the same as https://cantera.org/examples/matlab/reactor2.m.html gas = importPhase(’h2mech.cti’,’hydrogen_oxygen’);
nsp = nSpecies(gas);
% set the initial conditions
set(gas,’T’,1001.0,’P’,0.1*oneatm,’X’,’H2:2, O2:1, AR:4’); % create a reactor, and insert the gas
r = Reactor(gas);
t = 0;
dt = 3.0e-4;
tnow = 0;
m = 0;
for n = 1:15
t = t + dt;
while tnow < t
tnow = step(r, t); % take one internal timestep m = m + 1;
tim(m) = tnow;
temp(m) = temperature(r);
xm(:,m) = moleFractions(gas);
end
end
% make plots
figure(1);
plot(tim, temp);
xlabel(’time’);
ylabel(’Temperature’);
figure(2);
plot(tim, xm);
xlabel(’time’);
ylabel(’Mole Fraction’);
legend(speciesNames(gas)); |
@bryanwweber Yes, I agree that these examples are functionally equivalent. I think the The other example in the old CTI guide is the same as diamond_cvd.py, using diamond.cti as the input file. The main additions are a bit of explanatory text and the plots, which could be brought over from the PDF and added to the Python script. There's also the discrepancy between the two versions of |
@bryanwweber Should I open a PR to replace the diamond.cti in data/inputs with the one in test_problems/diamondSurf? |
@agarwalrounak Sure. Please also update the diamond_cvd.py example, as mentioned by @speth |
This file: https://github.com/Cantera/cantera/blob/master/doc/sphinx/cti/example-combustion.rst is presently blank. Is it left over from an old version of the documentation?
As reported on the Google Group: https://groups.google.com/d/msg/cantera-users/h0s-vJ6iELY/RgqsyqGnCQAJ
The text was updated successfully, but these errors were encountered: