Skip to content
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

Closed
bryanwweber opened this issue Dec 6, 2015 · 10 comments · Fixed by #630
Closed

Add examples from "Defining Phases" to the documentation #313

bryanwweber opened this issue Dec 6, 2015 · 10 comments · Fixed by #630

Comments

@bryanwweber
Copy link
Member

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

@speth
Copy link
Member

speth commented Dec 8, 2015

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).

@bryanwweber bryanwweber changed the title Blank file in CTI documentation Add examples from "Defining Phases" to the documentation Dec 11, 2015
@bryanwweber
Copy link
Member Author

OK I changed the title to reflect what could be done to resolve the issue.

@kyleniemeyer
Copy link
Member

This is a somewhat stale issue, but adding an example/some documentation here seems like something I can do...

@sameshl
Copy link
Contributor

sameshl commented Jan 10, 2019

I am new and would like to start contributing.Can I take up this issue?

@bryanwweber
Copy link
Member Author

Sure, see the comment on the other PR for where a good place to get started it.

@speth
Copy link
Member

speth commented Jan 10, 2019

Given the plans to deprecate the CTI format in the near future (#423, #584), I would hold off on this.

@bryanwweber
Copy link
Member Author

@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));

@speth
Copy link
Member

speth commented Feb 8, 2019

@bryanwweber Yes, I agree that these examples are functionally equivalent. I think the reactor2.m version is a better implementation than the one from the old CTI guide, as well.

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 diamond.cti in the repository -- the one in data/inputs versus the one in test_problems/diamondSurf. The latter looks to have more explanatory information, so we might want to replace the one in data/inputs.

@agarwalrounak
Copy link
Contributor

There's also the discrepancy between the two versions of diamond.cti in the repository -- the one in data/inputs versus the one in test_problems/diamondSurf. The latter looks to have more explanatory information, so we might want to replace the one in data/inputs.

@bryanwweber Should I open a PR to replace the diamond.cti in data/inputs with the one in test_problems/diamondSurf?

@bryanwweber
Copy link
Member Author

@agarwalrounak Sure. Please also update the diamond_cvd.py example, as mentioned by @speth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

5 participants