Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
malihass committed Dec 16, 2024
0 parents commit c10b63e
Show file tree
Hide file tree
Showing 80 changed files with 7,384 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 5323d8be09131c0fa917404abdc54afd
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
6 changes: 6 additions & 0 deletions _sources/acknowledgments.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Acknowledgments
=====

This work was authored by the National Renewable Energy Laboratory (NREL), operated by Alliance for Sustainable Energy, LLC, for the U.S. Department of Energy (DOE) under Contract No. DE-AC36-08GO28308. This work was supported by funding from DOE Bioenergy Technologies Office (BETO) `CO2RUe consortium <https://www.energy.gov/eere/co2rue>`_. The research was performed using computational resources sponsored by the Department of Energy's Office of Energy Efficiency and Renewable Energy and located at the National Renewable Energy Laboratory. The views expressed in the article do not necessarily represent the views of the DOE or the U.S. Government. The U.S. Government retains and the publisher, by accepting the article for publication, acknowledges that the U.S. Government retains a nonexclusive, paid-up, irrevocable, worldwide license to publish or reproduce the published form of this work, or allow others to do so, for U.S. Government purposes.


25 changes: 25 additions & 0 deletions _sources/contribute.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Contributing
=====

We welcome pull requests from anybody!

Formatting
------------

Code formatting and import sorting are done automatically with ``black`` and ``isort``.

You can automatically enforce the formatting guidelines with

.. code-block:: console
pip install black isort
bash fixFormat.sh
Spelling is checked but not automatically fixed using ``codespell``


Test
------------
Please ensure your contribution passes the tests in ``tests``


31 changes: 31 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Bio Reactor Design (BiRD)
===================================

`BiRD` is a toolbox aimed a facilitating the numerical simulation of bioreactors with OpenFOAM.
The purpose of `BiRD` is

1. to ensure reproducibility of numerical simulations of bioreactors.
2. to create a suite of test cases that can be used to test different reactor configurations.
3. to facilitate validation of multiphase flow models against several experimental campaigns.
4. to facilitate optimization (geometry and operating conditions) of bioreactors.

It contains a python module ``bird`` that can be used to generate input files that may be read by OpenFOAM to generate meshes and cases. It can also be used to post process the output of OpenFOAM simulations.

We also provide a solver ``birdmultiphaseEulerFoam`` that contains custom models added to the base OpenFOAM-v9.


.. note::

This project is under active development. We welcome community contributions and testing!


.. toctree::
:hidden:

quickstart
meshing
preprocess
postprocess
contribute
references
acknowledgments
240 changes: 240 additions & 0 deletions _sources/meshing.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
Meshing
=====


.. _stir_tank:

Generate stirred tank reactor mesh
------------

Generate a ``blockMeshDict`` with

.. code-block:: console
inp=bird/meshing/stirred_tank_mesh_templates/base_tank/tank_par.yaml
out=bird/meshing/stirred_tank_case_templates/base/system/blockMeshDict
python applications/write_stirred_tank_mesh.py -i $inp -o $out
Then activate openFoam environment and mesh with

.. code-block:: console
blockMesh -dict system/blockMeshDict
stitchMesh -perfect -overwrite inside_to_hub inside_to_hub_copy
stitchMesh -perfect -overwrite hub_to_rotor hub_to_rotor_copy
transformPoints "rotate=((0 0 1)(0 1 0))"
Visualize mesh in Paraview

.. _fig:stirredtank:

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/stirred_tank.png
:width: 70%
:align: center
:name: fig-str
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/stirred_tank.png
:alt: Stirred-tank reactor

Related tutorial
^^^^^^^^^^^^^^^

- ``tutorial_cases/stirred_tank``



.. _block_cyl:

Block cylindrical meshing
------------

Generates ``system/blockMeshDict``

.. code-block:: console
root=`pwd`
caseFolder=bird/meshing/block_cyl_cases_templates/case
mesh_temp=bird/meshing/block_cyl_mesh_templates/sideSparger
python applications/write_block_cyl_mesh.py -i $mesh_temp/input.json -t $mesh_temp/topology.json -o $caseFolder/system
Then activate openFoam environment and mesh with

.. code-block:: console
cd $caseFolder
blockMesh
transformPoints "scale=(0.001 0.001 0.001)"
transformPoints "rotate=((0 0 1) (0 1 0))"
cd $root
Visualize mesh in Paraview

.. _fig:sidesparger:

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/3dsparger.png
:width: 50%
:align: center
:name: fig-sidesparger
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/3dsparger.png
:alt: Reactor with a side sparger

How to change the dimensions or mesh refinement?
^^^^^^^^^^^^^^^

All dimensions and mesh are controlled by the input file ``input.json``.
The input file can also be in ``.yaml`` format. The parser will decide the file format based on its extension.
See ``bird/meshing/block_cyl_mesh_templates/baseColumn/`` for an example of ``.yaml``

How to change the arrangement of concentric cylinders?
^^^^^^^^^^^^^^^

The block topology is controlled by the ``topology.json``
We recomment always working with a schematic. Here is the schematic for this case

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/schematic.png
:width: 50%
:align: center
:name: fig-schematic
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/schematic.png
:alt: Side sparger schematic


The purple blocks are walls (not meshed) and the white blocks are fluid blocks (meshed). The symmetry axis is indicated as a dashed line

In the ``topology.json``, the purple blocks are defined as

.. code-block:: json
"Walls": {
"Support": [
{"R": 0, "L": 3},
{"R": 1, "L": 3}
],
"Sparger": [
{"R": 0, "L": 2},
{"R": 1, "L": 2},
{"R": 2, "L": 2}
]
}
How to change boundaries?
^^^^^^^^^^^^^^^

Boundaries are defined with three types, ``top``, ``bottom`` and ``lateral``

In the case of sparger walls shown below with the red lines

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/schematicSpargerWalls.png
:width: 50%
:align: center
:name: fig-schematicwalls
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/schematicSpargerWalls.png
:alt: Wall side sparger schematic


the boundary is defined in the ``topology.json`` as

.. code-block:: json
"Boundary": {
"wall_sparger":[
{"type": "bottom", "Rmin": 2, "Rmax": 2, "Lmin": 2, "Lmax": 3},
{"type": "top", "Rmin": 0, "Rmax": 0, "Lmin": 1, "Lmax": 2},
{"type": "top", "Rmin": 1, "Rmax": 1, "Lmin": 1, "Lmax": 2},
{"type": "top", "Rmin": 2, "Rmax": 2, "Lmin": 1, "Lmax": 2}
],
For the side sparger, the inlet is shown below with the red line
.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/schematicSpargerInlet.png
:width: 50%
:align: center
:name: fig-schematicinlet
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/schematicSpargerInlet.png
:alt: Inlet side sparger schematic
the boundary is defined in the ``topology.json`` as
.. code-block:: json
"Boundary": {
"inlet": [
{"type": "lateral", "Rmin": 2, "Rmax": 3, "Lmin": 2, "Lmax": 2}
],
Related tutorials
^^^^^^^^^^^^^^^
- ``tutorial_cases/side_sparger``
- ``tutorial_cases/bubble_column_20L``
Block rectangular meshing
------------
Generates ``system/blockMeshDict``
.. code-block:: console
root=`pwd`
caseFolder=bird/meshing/block_rect_cases_templates/case
mesh_temp=bird/meshing/block_rect_mesh_templates/loopReactor
python applications/write_block_rect_mesh.py -i $mesh_temp/input.json -o $caseFolder/system
Then activate openFoam environment and mesh with
.. code-block:: console
cd $caseFolder
blockMesh
cd $root
Visualize mesh in Paraview
.. _fig:loop_reactor:
.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/loop_react.png
:width: 80%
:align: center
:name: fig-loopreactor
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/loop_react.png
:alt: Loop reactor
How to change the block rectangular geometry?
^^^^^^^^^^^^^^^
The geometry of the block cylindrical mesh is defined within a 3D domain (X,Y,Z). The blocks that represent the fluid domain are a subset of a block rectangular background domain. The fluid blocks are defined using the geometry corners. For the mesh shown above, the geometry corners are the red blocks shown below
.. _fig:loop_reactor_schematic:
.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/bird/meshing/block_rect_mesh_templates/loopReactor/loop_schematic.png
:width: 80%
:align: center
:name: fig-loopreactor-schematic
:target: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/bird/meshing/block_rect_mesh_templates/loopReactor/loop_schematic.png
:alt: Loop reactor schematic
The corners are defined in the ``input.json``
.. code-block:: json
"Geometry": {
"Fluids": [
[ [0,0,0], [9,0,0], [9,0,4], [0,0,4] ],
[ [0,1,4], [0,4,4], [0,4,0], [0,1,0] ]
]
}
Related tutorials
^^^^^^^^^^^^^^^
- ``tutorial_cases/loop_reactor_mixing``
- ``tutorial_cases/loop_reactor_reacting``
55 changes: 55 additions & 0 deletions _sources/postprocess.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Postprocess
=====


.. _early_pred:


Perform early prediction
------------


.. code-block:: console
python applications/early_prediction.py -df bird/postprocess/data_early
Generates

.. container:: figures-early-pred

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/early_det.png
:width: 70%
:align: center
:alt: Determinisitc early prediction

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/early_uq.png
:width: 70%
:align: center
:alt: Uncertainty-aware early prediction


Plot conditional means
------------

.. code-block:: console
python applications/compute_conditional_mean.py -f bird/postprocess/data_conditional_mean -avg 2
Generates (among others)

.. container:: figures-cond-mean

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/gh_cond_mean.png
:width: 70%
:align: center
:alt: Height-conditional gas holdup

.. figure:: https://raw.githubusercontent.com/NREL/BioReactorDesign/main/assets/co2g_cond_mean.png
:width: 70%
:align: center
:alt: Height-conditional CO2 gas fraction





Loading

0 comments on commit c10b63e

Please sign in to comment.