Metadata-Version: 2.5
Name: degadisx
Version: 0.1.4
Summary: A Python reimplementation of EPA DEGADIS 2.1
Project-URL: Source, https://github.com/lyullee/degadisx
Project-URL: Documentation, https://github.com/lyullee/degadisx#readme
Project-URL: Changelog, https://github.com/lyullee/degadisx/blob/main/CHANGELOG.md
Author: Ugwiyeon Lee
License: MIT License
        
        Copyright (c) 2026 degali contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        ---
        
        DEGADIS 2.1, on which this work is based, was developed by Thomas O. Spicer
        and Jerry A. Havens at the University of Arkansas under US Coast Guard
        contract DT-CG-23-80-C-20029, with subsequent support from the Gas Research
        Institute, the American Petroleum Institute and the US Environmental
        Protection Agency. The original source is in the public domain and is
        distributed by EPA through SCRAM. Copies of it are included under
        reference/fortran for validation purposes.
License-File: LICENSE
Keywords: DEGADIS,consequence modelling,dense gas,dispersion,process safety
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.10
Requires-Dist: numpy>=1.23
Requires-Dist: scipy>=1.10
Provides-Extra: pool
Requires-Dist: lh2poolx>=0.1.0; extra == 'pool'
Provides-Extra: test
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

# DEGADISx

**DEGADISx** is a Python reimplementation of the U.S. EPA **DEGADIS 2.1** dense-gas dispersion model. Its public interface deliberately retains the legacy DEGADIS thermodynamic and numerical route; it is not an LH2 extension and does not contain DEGALI research modules.

## Scope

DEGADISx provides the original model's ground-level steady and transient routes, pressurised-jet route, deck readers, and bridge from jet touchdown to the ground-level model. It is intended for transparent reproduction, software inspection, and research use. It is not a substitute for site-specific consequence-model selection or safety engineering review.

## Install

```bash
pip install degadisx
```

From a checkout:

```bash
pip install .
degadisx --help
```

For a separately qualified LH2 pool source term, install the optional adapter:

```bash
pip install "lh2poolx @ git+https://github.com/lyullee/lh2poolx.git"
```

`degadisx.lh2pool.source_table_from_lh2pool()` converts declared LH2PoolX
time-window terms into the original ground-source-table convention. It refuses
confined or non-equilibrium terms; it does not add an LH2 pool or jet-impact
model to the reproduced DEGADIS physics.

## Reproduction evidence and data policy

The implementation was checked against the EPA DEGADIS 2.1 reference distribution and published EPA benchmark listings. The quantitative audit, its limits, and exact source locations are in [docs/reproduction.md](docs/reproduction.md).

This repository deliberately contains **no** third-party Fortran source, EPA input/output decks, experimental measurements, reduced observation data, or PDFs. See [docs/data-policy.md](docs/data-policy.md).

## Source-ledger handoff

Version 0.1.2 adds `degadisx.SourceLedger` and `SourceState`, a model-neutral
record for a resolved source-plane state. The adapter converts H2 contaminant
rate and mass fraction into DEGADIS source-table rows while preserving area
and time history. It rejects unresolved liquid fractions: flash, impact,
droplet, and pool-inventory physics must be resolved upstream before the
ground-layer route is started.

## Directed JETPLU source handoff

Version 0.1.3 also exposes
`SourceLedger.to_directed_jet_initial_conditions()`. It converts one resolved,
single-phase gas source-plane record into the existing JETPLU initial state;
callers then run the normal JETPLU driver with that state. The adapter checks
the declared H2/total-flow mass balance and rejects remaining liquid. It does
not modify the JETPLU equations or the historical vertical `SETJET` route.

The directed entry is a two-dimensional wind--vertical calculation. A yawed
horizontal release or a cross-axis wind component is not converted into a
three-dimensional fixed-receptor prediction by this interface.

## Citation

Please cite both this software (see [CITATION.cff](CITATION.cff)) and the original model:

> Spicer, T. O., and Havens, J. A. (1989). *User’s Guide for the DEGADIS 2.1 Dense Gas Dispersion Model*. U.S. Environmental Protection Agency, EPA-450/4-89-019.

## License

The Python implementation is MIT licensed. DEGADIS is cited as the original model; the original Fortran distribution and source materials are not redistributed here.
