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

Fix examples #905

Merged
merged 18 commits into from
Aug 21, 2020
Merged

Fix examples #905

merged 18 commits into from
Aug 21, 2020

Commits on Aug 20, 2020

  1. [Cython/Examples] Fix extract_submechanism example

    When loading reactions from a YAML file, an instance of a Kinetics
    object is required so that the species associated with the reactions are
    available. The required object is now constructed from the already
    loaded species definitions.
    
    Fixes Cantera#821, problem introduced in 1866e35
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    b929916 View commit details
    Browse the repository at this point in the history
  2. Fix infinite loop in diffusion_flame_extinction.py

    This change reworks the abortion criteria for the diffusion flame
    extinction example. Previously, the loop was only aborted when the flame
    temperature was above the inlet temperature, the difference of the flame
    temperature in the prior two iterations was less than the threshold, AND
    the change in strain rate parameter was less than the threshold.
    However, I found that this combination of conditions was never reached,
    because the only way to change the strain rate delta was to have an
    extinguished flame, and eventually the flame remains extinguished even
    if the delta_alpha is reduced. This leads to an infinite loop, since the
    abortion criteria check are only done if the flame is burning. This
    change moves the abortion criteria check into the case where the flame
    is not burning.
    
    In addition, the flame temperature check is modified to use
    np.isclose(). I found that on the last burning iteration, the maximum
    flame temperature was only just barely above the oxidizer inlet
    temperature. Thus, the result printed to the screen was not very useful.
    The change to np.isclose() produces a more useful result for the final
    burning iteration before extinction. The last non-burning iteration is
    also saved to the output file(s) for reference.
    
    Fixes Cantera#872
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    25abfad View commit details
    Browse the repository at this point in the history
  3. Typo fixes

    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    4f55735 View commit details
    Browse the repository at this point in the history
  4. Fix boundary emissivities deprecation warning

    The set_boundary_emissivities method is deprecated and will be removed
    after Cantera 2.5.0. This change switches one example to use the new
    property. The property was also missing from the FlameBase class.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    bd78c7b View commit details
    Browse the repository at this point in the history
  5. [Example] Specify data file path in flame_fixed_T

    This allows the script to be run from the installed location, or from
    the root of the source tree.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    4e48f02 View commit details
    Browse the repository at this point in the history
  6. [Examples] Replace argon.yaml with air.yaml

    argon.yaml is deprecated, use air.yaml and specify the composition
    instead.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    4568d36 View commit details
    Browse the repository at this point in the history
  7. [Reactor/1D] Fix gas phase production on surfaces

    The calculation for the production of gas phase species from
    surface reactions assumed that the gas phase species were stored at the
    beginning of the rate-of-production array. This is only the case when
    the gas ThermoPhase instance is the first phase in the Kinetics thermo
    vector, which is not guaranteed to be the case.
    
    It happens that XML input usually forced the gas phase to be the first
    phase in the thermo vector, so everything worked out fine. This was
    because the associated phase(s) for a surface phase had to be listed in
    an XML file, and the XML initializer reads that list to fill the
    Kinetics thermo vector.
    
    In the YAML format, the associated phase does not need to be explicitly
    listed. Instead, instances of the appropriate phases are passed to the
    constructor when the InterfaceKinetics is created. The gas phase can
    then come before or after the surface phase, meaning there is no
    guarantee of the order of species.
    
    This change checks for the starting index of the gas phase species in
    the InterfaceKinetics species-length arrays to make sure that the
    appropriate rates of production are added for the gas phase species.
    
    Fixes Cantera#902, Cantera#877, Cantera#873
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    f2c2ab4 View commit details
    Browse the repository at this point in the history
  8. [1D] Add coverage_enabled getter

    Adds a getter function for the coverage_enabled property on the
    ReactingSurface1D Python class, and the corresponding C++ method.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    8b349cf View commit details
    Browse the repository at this point in the history
  9. [Examples] Fix sofc.py divide-by-zero warning

    The switch to the YAML input file revealed that the calculation of the
    anode and cathode currents in sofc.py relied on a particular order of
    the phases. This change corrects that by finding the index of the
    electron "species" in the anode and cathode phases.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    dde4118 View commit details
    Browse the repository at this point in the history
  10. [Examples] Fix UserWarning in ic_engine.py

    Matplotlib issues a UserWarning if the xticklabels are explicitly set
    but the xticks are not explicitly set. We choose to set ticks every 360
    degrees of crank angle, which corresponds to every 0.02 seconds in the
    simulation.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    68df649 View commit details
    Browse the repository at this point in the history
  11. [Fortran] Add extra_inc_dirs to compile Fortran sample

    One of the Fortran samples needs to include the extra_inc_dirs variable
    so that system header files in non-standard locations will be found.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    b727b1d View commit details
    Browse the repository at this point in the history
  12. [ReactionPath] Fix IO warning about unclosed file

    Use pathlib to write the text content to a file in write_dot. This
    automatically closes the file handle after the text is written.
    
    Also modify the reaction_path.py example to use pathlib and subprocess.
    These are available since at least Python 3.5 and represent modern
    best-practices in Python scripts.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    3578c03 View commit details
    Browse the repository at this point in the history
  13. [Examples] Properly close multiprocessing.Pool

    The multiprocess.Pool object must be closed properly, or the process can
    hang according to the Python docs. The recommended method for short code
    blocks is to use the context manager. The format of the arguments to
    Pool is chosen to allow the last line to be de-dented to remove
    ambiguity about the definition of the context manager and the content.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    7ff4af2 View commit details
    Browse the repository at this point in the history
  14. [Examples] Fix FutureWarning in diamond_cvd.py

    pandas v1.1.0 issues a FutureWarning when plotting single columns from a
    DataFrame using the Matplotlib pyplot API. This can be avoided by using
    the pandas plotting API instead.
    bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    9c3c7cc View commit details
    Browse the repository at this point in the history
  15. [unittests] Fix ch4_ion.yaml

    The content of ch4_ion.yaml now matches ch4_ion.cti (the file was re-created
    using cti2yaml)
    ischoegl authored and bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    3e6edb8 View commit details
    Browse the repository at this point in the history
  16. [examples] Apply band-aid fix to ion_burner_flame.py

    A reduction of domain size makes the example more stable.
    ischoegl authored and bryanwweber committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    0767e54 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    148a6c7 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    42fbd1d View commit details
    Browse the repository at this point in the history