-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
1 d continuation #541
1 d continuation #541
Conversation
This function is used to transfer control between the python code and C++ Cantera code. The information passed is Dom, StrainEq, UnityLewisNumber, OnePointControl, TwoPointControl, Tfuel_fixed, Tfuel_j, Toxid_fixed, Toxid_j, EnableReaction.
This cython definition calls setFlameControl and passes arguments. The information passed is Dom, StrainEq, UnityLewisNumber, OnePointControl, TwoPointControl, Tfuel_fixed, Tfuel_j, Toxid_fixed, Toxid_j, EnableReaction. This function can be called from python scripts by instantiating cantera.CounterFlowDiffusionFlame(arg1, arg2).
For two-point control continuation methods the oxidizer velocity is not known and needs to computed.
The modifications allow for continuation procedures as well as application of Unity Lewis number, alternative pseudo-one dimensional equation. The latter replaces the pressure curvature with the strain rate eigenvalue. In addition, the net reaction rate of species needs to be deactivated to facilitate the calculationof the lower branch.
In numerical continuation methods interior boundaries replace exterior boundaries. When one or two point control continuation methods are enabled at least one mass flux is obtained as a result of the calculation for opposed flow flamems.
Reinstating c_offset_P with index 3
ePotential variable and uo variable shared the same index right now. This means that continuation methods and ion flow models are incompatible.
Only the upper branch calculation is working. There might be an error with the compiled Cantera because middle branch fails. Cantera, however, is okay with the test.
I fixed the merge conflict, which was caused by the fact that both a change to However, I think most of the comments that I previously made on this set of changes in the previous PR (#534) still need to be addressed. Also note that a unity Lewis number transport model has been added (see #510), so it is not necessary to implement that feature as part of this PR. |
This is only for debugging purposes
…into 1D-continuation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running the test added here (after fixing the path to the h2o2.cti
file), I get the output:
test_diffusion_flame_cont (cantera.test.test_onedim.TestOneDimNumCont) ... Start flamelet generation of FPV type
Precalculations
Pressure Tmax Fuel_mdot
101325.0 3095.4 0.10
#n Tmax Amax dT branch FlameControl? # gridpoints
1 3094.9 131.7 20.00 upper False 85
2 3093.0 327.7 20.00 upper False 87
3 3090.1 652.1 20.00 upper False 91
4 3084.9 1134.8 20.00 upper False 94
5 3077.0 1805.4 20.00 upper False 95
6 3066.5 2692.6 20.00 upper False 95
7 3051.8 3824.2 20.00 upper False 97
8 3032.1 5227.0 20.00 upper False 97
9 3008.9 6910.7 20.00 upper False 99
#n Tmax Amax dT branch FlameControl? # gridpoints
10 2981.0 8929.0 20.00 upper False 100
False True False True 2664.53392123918 37 2703.1656996269094 52
Calculation failed; the new value of dT is 10.000000
False True False True 2674.53392123918 37 2713.165699626909 52
Calculation failed; the new value of dT is 5.000000
False True False True 2679.53392123918 37 2718.165699626909 52
Calculation failed; the new value of dT is 2.500000
False True False True 2682.03392123918 37 2720.665699626909 52
Calculation failed; the new value of dT is 1.250000
False True False True 2683.28392123918 37 2721.915699626909 52
Calculation failed; the new value of dT is 1.000000
11 300.0 819517.4 1.00 lower False 100
which suggests that at least for this example, it is unable to find solutions along the middle branch. Can we at start with an example that actually exercises the the control algorithm working in each branch? I think this issue needs to be resolved before we put any effort into modifying things so that this fits nicely with Cantera's existing code.
@speth Two questions. A.) If this PR gets out-of-date a bit with respect to changes on the main cantera master branch, what would be the best way for me to set up a clone of this repo so that I could create a new PR with changes? Something like this? B.) I'm trying to replicate the error that you posted most recently. This is what I'm doing: If I go into build/python2/cantera/test and run: python test_onedim.py , I get import errors (which I'm pretty sure are because that is not how the tests are supposed to be run). |
@wandadars Regarding the tests, you can run just the Python tests by
My suggestion to bring this PR up-to-date is to rebase it onto the current master branch. The following code will checkout a new branch with the existing changes:
Then, assuming that you have Cantera/cantera as a remote named
Most likely this will cause merge conflicts that you'll have to fix. |
I'm a little torn on the best way to move forward here. Normally, I would agree with Bryan's suggestion of rebasing onto the current master and fixing the conflicts where they occur. However, given that the code doesn't work as-is, I'd hesitate to suggest investing time on dealing with resolving merge conflicts while untangling the commit history (which risks introducing new bugs) before seeing if you can get this code working. On the other hand, the rebase will just become harder as you do more work on this branch. To just run the tests of the 1D solver, you can run |
@speth Is the reason you're suggesting |
@speth @bryanweber Hello, sorry that I've out of the loop for a while. I'm planning to start working in this project again in about two weeks . |
@bryanwweber I mentioned Python 2 because @wandadars specified that path in his message. Running the tests with Python 3 would be slightly preferable, but is well behind the two major issues that need to be resolved here. |
Please fill in the issue number this pull request is fixing:
Fixes #534
Changes proposed in this pull request: