-
-
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
Deprecate all instances of gri30_mix
and gri30_multi
#736
Comments
My opinion, which I acknowledge may differ from the expectations of some users, is that the input files that come with Cantera should mostly be regarded as examples, not a source of data to be used as the basis of applications built for scientific or engineering purposes. As such, I don't think that there should be an expectation that the phase names in these files is part of Cantera's stable API, and we should be able to change or remove these files as needed. I think it still makes sense for the |
@speth I disagree with the following statement (recognizing that you acknowledged that your opinion my differ):
If these files were not intended as data, why are they in a folder called In other words, I am very strongly in favor of retaining the historical Regarding the differences between the versions generated by |
@bryanwweber ... I agree with you with regard of not breaking code, but I also agree that the imho superfluous phase definitions should be phased out (except for what My suggested solution would be to simply catch the |
But if I'm interpreting what @speth said correctly, the phase specification is not superfluous and indeed preferred, i.e.
|
True. I guess I meant to say that duplicate phase definitions are superfluous (sorry). I am essentially assuming that going forward, most YAML files will use the
setting as the default. For |
But if we view the purpose of these cti files as providing examples, I think this provides a clear example of how one can vary the transport model for a given thermodynamic and chemical phase definition, from within the input file. The page definition itself is superfluous, but one could say that about gri-3.0, in general. It’s not the phase definition that is the resource, but the example of how one can mix and match transport models.
…Sent from my iPhone
On Oct 29, 2019, at 8:52 PM, Ingmar Schoegl ***@***.***> wrote:
True. I guess I meant to say that duplicate phase definitions are superfluous (sorry). I am essentially assuming that going forward, most YAML files will use the
transport: mixture-averaged
setting as the default.
For gri30, the historical differentiation really only pertains to those lines, hence my suggestion to catch the behavior internally until it can be phased out.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
My biggest hangup about this is that multiple phase definitions are only differentiated by a single entry. Yet, they need to be hand-coded (i.e. generate a YAML file using I believe that letting users know that the |
@decaluwe ... regarding CTI files, this may be pretty discipline specific. If you're only dealing with gas phase kinetics (like myself), there isn't much of a reason to ever open the CTI/XML or YAML files that are generated from chemkin input. If you're looking at other thermo phases, there's a lot more reason to look at (and edit) input files. From my perspective, I have never viewed the CTI (or YAML) format as examples. It's really the python example suite (or matlab/C++) that illustrates how things are being used. |
Given the multiple issues that have cropped up with errors in I often find that the fact that the default phase for Regarding @decaluwe's point, I'm not sure whether the "multiple slightly different phase definitions" approach is the one that we want to recommend to users. I know I use the If there's a place in the C++ layer where we can catch the use of the |
Also, I'd like to point out that there's no case here where code silently goes from working to not working. Errors associated with |
For the record, the point I was making was not about “demonstrating the creation of multiple, slightly diff phase definitions in a single file,” but rather “demonstrating, in a single file, the creation of of phase definitions with varying transport models.” I.e., my suggestion wasn’t that the example teaches users to create multiple instances of the same phase, only with different transport models. More like if one is building a phase model and has not done so before, a common approach is to go to an existing cti file and copy example of what is demonstrated there. Even if proper documentation exists, my guess is that most users will start from a previous example before going through the docs. Again, if the cti files are there for demonstration purposes, having some form of explicit demonstration of how the difft transport models are instantiated at the input file level is a good and valid thing.
Now, there is probably a more efficient way to achieve this goal, in terms of having one model, and then a comment listing other keyword options. Also agree that multiple phase defs in a single input serves no purpose, as a user. Lastly, I’m not even necessarily opposing the depreciation, but it’s just something to keep in mind: if the input files are there for demonstration purposes, it would be good if they explicitly demonstrated a range of phase definition options, for the user.
…Sent from my iPhone
On Oct 29, 2019, at 9:30 PM, Ray Speth ***@***.***> wrote:
Given the multiple issues that have cropped up with errors in gri30.cti, I would prefer the gri30.yaml file that we include to be exactly what is generated by ck2yaml, even if we don't continue to generate it on the fly [in order to simplify the requirements for the build environment].
I often find that the fact that the default phase for gri30.cti doesn't specify a transport model to be an annoyance, given that any input file that a user generates using ck2cti will have a transport model set, assuming that they provided transport data.
Regarding @decaluwe's point, I'm not sure whether the "multiple slightly different phase definitions" approach is the one that we want to recommend to users. I know I use the transport_model=... keyword argument far more often than I add an additional phase definition to the input file.
If there's a place in the C++ layer where we can catch the use of the gri30_mix and gri30_multi phase names and issue a warning without too much hassle, I would like to see them deprecated.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I guess I'm in the minority here... It seems like the consensus is that users should not use the
This is true, but removing those phase definitions makes the advice we give much more complicated. If we leave them there, we can tell people "just change
I think this is the best argument I've heard for removing those extra phase definitions. However, I sure hope we've caught all the differences at this point, given the work in #718 and that GRI 3.0 won't be changing in the future (I suppose we could have said this before...). So I hope that As I said before, I think it could make sense to remove the use of these extra phases in our examples and demonstrate some of the other ways to set the transport model. But I really don't think that we should remove them from the |
I'll stay out of the rationale of what exact YAML version is distributed, but do have a preference for the one generated by default (i.e. However, I think that the introduction of an entirely new format can bring some changes, which imho should not be entirely unexpected (all my code broke when cython was introduced in the transition to Python 3.x). Imho, some well-placed warnings is all that should be needed to nudge the users to the correct action, which should avoid the cavalcade of questions, which I agree no one wants to (or should have to!) answer. Admittedly, some people will not read the actual messages that are issued, but this can be dealt with pretty efficiently ... |
The way I interpret this, the In [1]: import cantera as ct
In [2]: gas = ct.Solution('gri30.xml', 'gri30_mix')
In [3]: gas.name, gas.composite
Out[3]: ('gri30_mix', ('IdealGas', 'Gas', 'Mix'))
In [4]: gas.transport_model = 'Multi'
In [5]: gas.name, gas.composite
Out[5]: ('gri30_mix', ('IdealGas', 'Gas', 'Multi')) is imho not consistent. |
It's not that I think the I mainly want to get rid of the gas = ct.Solution('gri30.cti', 'gri30_mix') But then, if I want to use my own mechanism that I have converted from a Chemkin input file, how am I supposed to understand that the correct way to adapt this is: gas = ct.Solution('mymech.cti') Or worse, that the corresponding call to: gas = ct.Solution('gri30.cti', 'gri30_multi') is gas = ct.Solution('mymech.cti', transport_model='Multi') I thought that the CTI -> YAML transition would be the best (if still imperfect) time to make this change, given that users have to make some modifications to their code to use the YAML format anyway, and that otherwise we don't really have a clear way to provide a deprecation warning relating to the use of a particular input file.
I agree that it makes the instructions for "how to start using YAML" more complicated, but those instructions are at least a natural place to describe the appropriate modifications to the user's code, and I don't think they're really that complicated. Is there anything that isn't covered by the following (for Python, at least):
In any case, these instructions will also have to cover conversion of the user's own CTI / XML files using
I am definitely not advocating removing these phase names from the existing CTI/XML files.
Removing these files is an interesting suggestion. It would be consistent with the fact that we don't currently keep the original input files for other models (e.g.
That's an interesting point, and not one I had considered. If a user looks at |
All: I created PR #737 to illustrate my suggestion of catching the phase definitions with a transitional warning. |
This can be closed per #768 |
I think this was partially resolved by #768, since I listed a URL for a wiki page in the warning message that doesn't exist 😂 I'd like to leave this open until that's resolved. |
Here is the wiki page: https://github.com/Cantera/cantera/wiki/deprecate_gri30_phases Comments/edits welcome |
Looks ok to me |
I made a couple of small edits. I think with that, we can actually close this now. |
Thanks @speth! |
Cantera version
2.5.0a3
Operating System / Python/MATLAB version
all
Expected Behavior
The
gri30_mix
andgri30_multi
phases are deprecated and are not part of allgri30.yaml
versions (the version intest/work/python
defines those, the default version does not). For consistency, all instances should be removed for 2.5, as the transport model can be specified using a flag. I.e. the differentiation of transport models in phases is largely obsolete:Questions
There are two questions:
gri_mix
andgri_multi
phases, as they may be widely used in user-developed code. Should there be a customized error message (or warning)?mixture-averaged
or should no transport manager be instantiated if thetransport_model
flag is not used? (i.e. under many circumstances, the transport manager is not used)Actual Behavior
gri30.yaml
are not consistent, i.e. some have hand-coded entries.Deprecating
gri30_mix
is straight-forward (it is replacable bygri30
):There aren't many instances of
gri30_multi
:Steps to reproduce
The text was updated successfully, but these errors were encountered: