Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing to FireSciPy

Thank you for your interest in contributing! FireSciPy is a community-driven project,
and contributions of all kinds are welcome — including code, documentation, examples,
bug reports, feature requests, and discussion.

---

## How to Contribute

### 1. Reporting Issues
If you find a bug, have a question, or want to request a new feature, please open an
issue on GitHub. When reporting a bug, try to include:
- A clear description of the problem
- Steps to reproduce
- Expected behavior
- Your Python version and platform

### 2. Making Code Contributions
1. Fork the repository
2. Create a **new branch** for your work:
`git checkout -b feature/my-improvement`
3. Make your changes
4. Add tests if applicable
5. Submit a pull request with a clear explanation of what the change does and why

We try to keep the code readable and maintainable. If you're unsure about design
choices, open an issue or draft PR first and we can discuss.

---

## Licensing (Important)

FireSciPy is licensed under the **Mozilla Public License Version 2.0 (MPL-2.0)**.

By submitting a pull request, **you agree that your contributions will be licensed under
the MPL-2.0**, which ensures:
- Your improvements to FireSciPy remain open and available to the community
- You retain your own copyright to your contributions

No Contributor License Agreement (CLA) is required.

For more information on MPL-2.0:
https://www.mozilla.org/en-US/MPL/2.0/

---

## Code Style

- Follow general [PEP 8](https://peps.python.org/pep-0008/) guidelines
- Write clear variable names, meaningful docstrings, and comments where helpful
- Keep functions small and focused where possible

---

## Thank You

Your contribution helps move the field of fire science forward.
We’re glad to have you here!
445 changes: 104 additions & 341 deletions LICENSE

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FireSciPy
Copyright (c) 2025 FireSciPy contributors

This project is licensed under the Mozilla Public License Version 2.0.
https://www.mozilla.org/en-US/MPL/2.0/

Some portions of this project may incorporate or adapt work from other open-source
projects. Attributions for such components are included in the relevant source files
and documentation where required.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Examples are available in Jupyter notebooks in the [FireSciPy repo on GitHub](ht

## Meta Information

Distributed under the CC-BY-4.0 license (Creative Commons Attribution 4.0 International Public License, https://creativecommons.org/licenses/by/4.0/). See ``LICENSE`` for more information.
This project is licensed under the Mozilla Public License Version 2.0.
https://www.mozilla.org/en-US/MPL/2.0/

See ``LICENSE`` for more information.

[https://github.com/FireDynamics/FireSciPy](https://github.com/FireDynamics/FireSciPy)

Expand All @@ -21,6 +24,8 @@ Contributions to this package are welcome!

Please feel free to use the [discussions forum](https://github.com/FireDynamics/FireSciPy/discussions) or the [issue tracker](https://github.com/FireDynamics/FireSciPy/issues) to get in contact with us. From there, we can talk about your ideas and see how to implement them.

Note: From version 0.1.0 onward, the main branch should contain only stable versions and no development on the main branch is permitted. Create new branches for development work, regardless if it is for fixing bugs or adding new features.

Practical summary for contributions directly to the repo:

1. Fork it (<https://github.com/FireDynamics/FireSciPy/fork>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"# SciPy version: 1.16.1\n",
"# Pandas version: 2.3.1\n",
"# Matplotlib version: 3.10.5\n",
"# FireSciPy version: 0.0.3\n",
"# FireSciPy version: 0.0.5\n",
"\n",
"\n",
"print('Package Versions')\n",
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ build-backend = "hatchling.build"

[project]
name = "firescipy"
version = "0.0.5"
version = "0.0.6"
description = "FireSciPy: Fundamental algorithms from the field of fire science, for computations with Python."
readme = "README.md"
keywords = ["Fire Safety Engineering", "fire", "pyrolysis", "kinetics", "FDS"]
requires-python = ">=3.9"
license = { text = "CC-BY-4.0" } # adjust if you use another license
license-files = ["LICEN[CS]E*"]
license = { file = "LICENSE" }
authors = [
{ name = "Tristan Hehnen", email = "you@example.com" },
{ name = "Lukas Arnold", email = "you@example.com" }
]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering"
]
Expand Down
5 changes: 5 additions & 0 deletions src/firescipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


from . import utils
from . import pyrolysis
from . import constants
Expand Down
5 changes: 5 additions & 0 deletions src/firescipy/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


"""
Physical and chemical constants used throughout FireSciPy.

Expand Down
5 changes: 5 additions & 0 deletions src/firescipy/handcalculation/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


from .design_fires import alpha_t_squared, simple_design_fire
116 changes: 11 additions & 105 deletions src/firescipy/handcalculation/design_fires.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


import numpy as np


Expand Down Expand Up @@ -214,106 +219,7 @@ def simple_design_fire(Q_max, Q_total, decay_model="t_squared", **kwargs):
Q_combined = np.concatenate((Q_growth, np.full(2, Q_max), Q_decay))

return t_combined, Q_combined
def ignition(model,**kwargs):
"""
Returnes pre defined fire curves that are usually used as ignition sources.

Parameters
----------
model : str
Name of the ignition source model.
- EN45545-1: Ignition model 5 from EN 45545-1
- TRStrab: Ignition model from TRStrab BS
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc

Optional keyword arguments (`**kwargs`) depending on the selected model:
sampling_rate : float
Sampling rate in Hz. Default is 1 Hz.

Returns
-------
time : np.ndarray
time array in seconds
hrr : np.ndarray
corresponding heat release rate array in kW.
"""
sampling_rate=kwargs.get("sampling_rate", 1)
ignitioncurves={'EN45545-1': np.array((np.array((0,2,2,10,10))*60,np.array((75,75,150,150,0)))),
'TRStrab BS': np.array(([0,300,480,1800],[0,120,150,0])),
'E-Bike': np.array(([0,12,45,84,900],[0,55,900,80,0]))}
values=ignitioncurves[model]
time=np.linspace(0,values[0].max(),values[0].max()*sampling_rate+1)
hrr=np.interp(time,values[0],values[1])
return time,hrr

def din5647(length=20,**kwargs):
"""
Returnes parametrized version of the design fire for trams from DIN 5647/TRStrab BS with six different
design fire phases.

Parameters
----------
length : int
Length of tram in meter. Original model designed for lengths of
- EN45545-1: Ignition model 5 from EN 45545-1
- TRStrab: Ignition model from TRStrab BS
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc

Optional keyword arguments (`**kwargs`) depending on the selected model:
alpha: [float,float]
alpha1 for design fire phase (alpha³ model) in kW/s^3 and alpha2 for design fire phase 2 (alpha² model) in kW/s^2
sampling_rate : float
Sampling rate in Hz. Default is 1 Hz.

Returns
-------
time : np.ndarray
time array in seconds
hrr : np.ndarray
corresponding heat release rate array in kW.
"""
sampling_rate=kwargs.get("sampling_rate", 1)
alpha1,alpha2=kwargs.get("alpha", [5.2E-5,0.025])
x=np.arange(0,4200)
q=np.full(4200,np.nan)
q1=x[0:421]**3*alpha1
q[0:421]=q1
q2=(x[421:901]-360)**2*alpha2+q1[-1]
q[421:901]=q2
qap=q2[-1]
i=900
q3=np.array(((q2[-1]),))
q3max=q3[(i-901)]
while round(q3max)<1387*length:
i+=60
q3=np.append(q3,np.array(((q3[-1]+252*np.exp(0.004*i-1.68)),)),axis=0)
q3max=q3[-1]
i+=61
q[901:i]=np.interp(x[901:i],x[901:i:60],q3)
i=np.where(q>1387*length)[0][0]+300
q4=np.full(300,1387*length)
q[i-300:i]=q4
j=i
q5=np.array(((q4[-1]),))
q5min=q5[-1]
while round(q5min)>0.78*length*1387:
i+=60
q5=np.append(q5,np.array(((0.94*q5[-1]),)),axis=0)
q5min=q5[-1]
#i=i-60
q[j:i]=np.interp(x[j:i],x[j:i+1:60],q5)
i=np.where(q[j:]<0.78*length*1387)[0][0]+j
j=i
q6=np.array((q[i],))
i+=60
while i<=4200:
q6=np.append(q6,np.array(((0.9*q6[-1]),)),axis=0)
i+=60
q[j:i]=np.interp(x[j:i],x[j:i+1:60],q6)
values=np.array((x,q))
time=np.linspace(0,values[0].max(),values[0].max()*sampling_rate+1)
hrr=np.interp(time,values[0],values[1])
return time,hrr

def ignition(model,**kwargs):
"""
Expand All @@ -326,7 +232,7 @@ def ignition(model,**kwargs):
- EN45545-1: Ignition model 5 from EN 45545-1
- TRStrab: Ignition model from TRStrab BS
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc

Optional keyword arguments (`**kwargs`) depending on the selected model:
sampling_rate : float
Sampling rate in Hz. Default is 1 Hz.
Expand All @@ -347,6 +253,7 @@ def ignition(model,**kwargs):
hrr=np.interp(time,values[0],values[1])
return time,hrr


def din5647(length=20,**kwargs):
"""
Returnes parametrized version of the design fire for trams from DIN 5647/TRStrab BS with six different
Expand All @@ -355,11 +262,11 @@ def din5647(length=20,**kwargs):
Parameters
----------
length : int
Length of tram in meter. Original model designed for lengths of
Length of tram in meter. Original model designed for lengths of
- EN45545-1: Ignition model 5 from EN 45545-1
- TRStrab: Ignition model from TRStrab BS
- E-Bike: Values from https://www.youtube.com/watch?v=2vir4_1qSSc

Optional keyword arguments (`**kwargs`) depending on the selected model:
alpha: [float,float]
alpha1 for design fire phase (alpha³ model) in kW/s^3 and alpha2 for design fire phase 2 (alpha² model) in kW/s^2
Expand Down Expand Up @@ -412,7 +319,6 @@ def din5647(length=20,**kwargs):
i+=60
q[j:i]=np.interp(x[j:i],x[j:i+1:60],q6)
values=np.array((x,q))
time=np.linspace(0,int(values[0].max()),int(values[0].max())*sampling_rate+1)
time=np.linspace(0,values[0].max(),values[0].max()*sampling_rate+1)
hrr=np.interp(time,values[0],values[1])
return time,hrr

return time,hrr
3 changes: 3 additions & 0 deletions src/firescipy/microscale/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 changes: 5 additions & 0 deletions src/firescipy/microscale/microscale.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


import numpy as np


Expand Down
5 changes: 5 additions & 0 deletions src/firescipy/pyrolysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


from .kinetics import initialize_investigation_skeleton, add_isothermal_tga, add_constant_heating_rate_tga, combine_repetitions, differential_conversion, integral_conversion, compute_conversion, compute_conversion_levels, KAS_Ea, compute_Ea_KAS

from .modeling import create_linear_temp_program, reaction_rate, solve_kinetics, get_reaction_model
5 changes: 5 additions & 0 deletions src/firescipy/pyrolysis/kinetics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


import warnings

import numpy as np
Expand Down
5 changes: 5 additions & 0 deletions src/firescipy/pyrolysis/modeling.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.


import numpy as np
import pandas as pd

Expand Down
Loading