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

[WIP] Add time histories #104

Merged
merged 25 commits into from
Dec 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2c02061
First attempt at time-histories schema
bryanwweber Nov 19, 2017
dd1e877
Update schema with isvalid_history and remove unused isvalid_unit
bryanwweber Nov 20, 2017
9ce8b6d
Pass basic validation tests for time-histories
bryanwweber Nov 20, 2017
3ea7dbb
Print validation errors in the basic validation
bryanwweber Nov 20, 2017
9ec584e
Add remaining time history options
bryanwweber Nov 20, 2017
28b15c6
Add more time history types to validation
bryanwweber Nov 27, 2017
d1bf317
Allow a filename to specify the time history
bryanwweber Nov 27, 2017
3f78c2e
Test the time history validation function
bryanwweber Nov 27, 2017
98dc636
Add back volume-history for backwards compatibility
bryanwweber Dec 9, 2017
1a7619f
Fix line length warning in validator
bryanwweber Dec 9, 2017
f79dd40
Deprecate the volume-history field
bryanwweber Dec 9, 2017
0cbdb6b
Specifying both time-histories and volume-history is an error
bryanwweber Dec 9, 2017
47ab2de
Process time-histories into DataPoint class attributes
bryanwweber Dec 9, 2017
1fdb073
Update converters to use time-histories instead of volume-history
bryanwweber Dec 9, 2017
c3a06a4
Add time-histories to docs and CHANGELOG
bryanwweber Dec 9, 2017
78665ca
Move processing of quantities to separate function
bryanwweber Dec 10, 2017
71b2731
Fix validator function docstrings
bryanwweber Dec 10, 2017
02674c7
Remove unnecessary print in tests
bryanwweber Dec 10, 2017
0020369
Add RCM data field with additional information
bryanwweber Dec 10, 2017
a37929b
Update docs and CHANGELOG for rcm-data field
bryanwweber Dec 10, 2017
2525c44
Fix line too long in converters
bryanwweber Dec 11, 2017
a2ae3a5
Fix under-indented continuation line in tests
bryanwweber Dec 11, 2017
4df9d23
Add thermo properties polynomial to composition
bryanwweber Dec 11, 2017
188f5ea
Test the thermo properties validation
bryanwweber Dec 11, 2017
f047fc7
Fix typos
bryanwweber Dec 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- New method to instantiate a `ChemKED` class directly from a ReSpecTh XML file
- The `__version__` attribute can be imported from the top-level module
- New `time-histories` field to replace the `volume-history`. This field allows specification of several other relevant parameters besides volume.
- Added `rcm-data` field and moved `compressed-temperature`, `compressed-pressure`, and `compression-time` to this field
- Added `stroke`, `clearance`, and `compression-ratio` to the `rcm-data` field

### Changed
- Crossref lookups via Habanero now comply with the "be-nice" policy
Expand All @@ -17,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- ReSpecTh->ChemKED converter function now returns a dictionary, while the command-line entry points write out files
- Require Habanero>=0.6.0 to support the `mailto` argument
- Require pytest>=3.2.0 to support the `pytest.mark.filterwarnings` decorator
- Deprecate the `volume-history` field in the ChemKED YAML file and replace with `time-histories`

### Fixed
- Crossref lookups in the converters use the common API instance from validation
Expand Down
156 changes: 109 additions & 47 deletions docs/schema-docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,81 +225,81 @@ for the :ref:`datapoints <meta-datapoints>` schema.
The ignition delay measurement, with dimensions of time. Must conform to
:ref:`value-unit-required <schema-value-unit-required>`

.. _ignition-first-stage-ignition-delay:

* ``first-stage-ignition-delay``: sequence, optional
If two stages of ignition are present, this is the value of the first stage of ignition, with
dimensions of time. Must conform to :ref:`value-unit-optional <schema-value-unit-optional>`

.. _ignition-pressure-rise:

* ``pressure-rise``: sequence, optional
The pressure rise after the passage of the reflected shock, with dimensions of inverse time.
Must conform to :ref:`value-unit-optional <schema-value-unit-optional>`

.. _ignition-compression-time:
.. _ignition-equivalence-ratio:

* ``compression-time``: sequence, optional
The time taken during the compression stroke of a rapid compression machine experiment, with
dimensions of time. Must conform to :ref:`value-unit-optional <schema-value-unit-optional>`
* ``equivalence-ratio``: float, optional
The equivalence ratio of the experiment, dimensionless. Minimum value is 0.0.

.. _ignition-first-stage-ignition-delay:
.. _ignition-rcm-data:

* ``first-stage-ignition-delay``: sequence, optional
If two stages of ignition are present, this is the value of the first stage of ignition, with
* ``rcm-data``: mapping, optional
Data related to rapid compression machine (RCM) experiments. The keys of the mapping are
detailed in the :ref:`Rapid Compression Machine Data Keys <rcm-data-keys>` section.

.. _ignition-time-histories:

* ``time-histories``: sequence, optional
A sequence of mappings conforming to the :ref:`time-history <ignition-time-history>`
schema. Used to specify a time-varying history of values during an experiment.

.. _rcm-data-keys:

Rapid Compression Machine Data Keys
-----------------------------------

This section details the keys specific to rapid compression machine (RCM) experiments, which are
subkeys of the :ref:`rcm-data <ignition-rcm-data>` key.

.. _rcm-data-compression-time:

* ``compression-time``: sequence, optional
The time taken during the compression stroke of a rapid compression machine experiment, with
dimensions of time. Must conform to :ref:`value-unit-optional <schema-value-unit-optional>`

.. _ignition-compressed-pressure:
.. _rcm-data-compressed-pressure:

* ``compressed-pressure``: sequence, optional
The pressure at the end of the compression stroke for a rapid compression machine experiment,
with dimensions of mass per length per time squared. Must conform to
:ref:`value-unit-optional <schema-value-unit-optional>`

.. _ignition-compressed-temperature:
.. _rcm-data-compressed-temperature:

* ``compressed-temperature``: sequence, optional
The temperature at the end of the compression stroke for a rapid compression machine experiment,
with dimensions of temperature. Must conform to
:ref:`value-unit-optional <schema-value-unit-optional>`

.. _ignition-equivalence-ratio:

* ``equivalence-ratio``: float, optional
The equivalence ratio of the experiment, dimensionless. Minimum value is 0.0.

.. _ignition-volume-history:

* ``volume-history``: mapping, optional
Specify the volume history of the reaction chamber in a rapid compression machine experiment,
for use in simulating the complete experiment. Fields:
.. _rcm-data-compression-ratio:

- ``volume``: mapping, required
A mapping describing the volume in the history. Fields:

* ``units``: string, required
The units of the volume, with dimensions of length cubed

* ``column``: integer, required
The 0-based index of the column containing the volume information in the ``values``
array. Must be 0 or 1
* ``compression-ratio``: sequence, optional
The dimensionless volumetric compression ratio for a rapid compression machine experiment. Must
conform to :ref:`value-unit-optional <schema-value-unit-optional>`

- ``time``: mapping, required
A mapping describing the time in the history. Fields:
.. _rcm-data-stroke:

* ``units``: string, required
The units of the time, with dimensions of time

* ``column``: integer, required
The 0-based index of the column containing the time information in the ``values``
array. Must be 0 or 1

- ``values``: sequence, required
A sequence of sequences describing the values of the volume at the time points. Can be
entered in any supported syntax, including:
* ``stroke``: sequence, optional
The length of the stroke in a rapid compression machine experiment, with dimensions of length.
Must conform to :ref:`value-unit-optional <schema-value-unit-optional>`

.. code-block:: yaml
.. _rcm-data-clearance:

- [0.0, 0.0]
- [1.0, 1.0]
- - 2.0
- 2.0
- - 3.0
- 3.0
* ``clearance``: sequence, optional
The clearance from the piston face to the end wall of the reaction chamber at the end of
compression, with dimensions of length. Must conform to
:ref:`value-unit-optional <schema-value-unit-optional>`

.. _schema-only-keys:

Expand Down Expand Up @@ -374,3 +374,65 @@ should not be used in actual ChemKED files. These keys are documented in this se
A sequence conforming to either :ref:`value-with-uncertainty <schema-value-with-uncertainty>` or
:ref:`value-without-uncertainty <schema-value-without-uncertainty>`. May or may not be included
in the ChemKED file.

.. _ignition-time-history:

* ``time-history``: mapping, optional
Specify the time history of a quantity during an experiment. Fields:

- ``quantity``: mapping, required
A mapping describing the volume in the history. Fields:

* ``units``: string, required
The units of the volume, with dimensions of length cubed

* ``column``: integer, required
The 0-based index of the column containing the volume information in the ``values``
array. Must be 0 or 1

- ``time``: mapping, required
A mapping describing the time in the history. Fields:

* ``units``: string, required
The units of the time, with dimensions of time

* ``column``: integer, required
The 0-based index of the column containing the time information in the ``values``
array. Must be 0 or 1

- ``uncertainty``: mapping, optional
The uncertainty of the values in the ``quantity`` column. Can be specified either globally
by a single value in the sequence or by specifying a column that must be present in the
values array. Mapping keys:

* ``type``: string, required
Either ``absolute`` or ``relative`` to indicate the type of uncertainty

* ``value``: string, optional
A global value for the uncertainty applied to all points in the ``values`` array,
specified as a string with units. Either this key must be present, or the ``column`` and
``units`` keys must be present

* ``column``: integer, optional
The column in the ``values`` array containing the uncertainty of each point. Either this
key and the ``units`` key must be specified, or the ``value`` key must be specified.

* ``units``: string, optional
The units of the uncertainty in the ``column`` array. IF the ``type`` is relative, this
should be ``dimensionless``. Either this key and the ``column`` key must be specified,
or the ``value`` key must be specified.

- ``values``: sequence or mapping, required
Must be a sequence or mapping. If a mapping, the only key should be ``filename`` whose value
should be the filename of a comma-separated value file containing the values for the
history. If a sequence, should be a sequence of sequences describing the values of the
volume at the time points. Can be entered in any supported syntax, including:

.. code-block:: yaml

- [0.0, 0.0]
- [1.0, 1.0]
- - 2.0
- 2.0
- - 3.0
- 3.0
Loading