### Run an example (standard) Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Run a tutorial case after installing the python package and OpenFOAM solver. ```bash cd tutorial_cases/bubble_column_20L bash run.sh ``` -------------------------------- ### Run an example (pixi) Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Run a tutorial case using pixi after installing the python package and OpenFOAM solver. ```bash cd tutorial_cases/bubble_column_20L bash run_pixi.sh ``` -------------------------------- ### Installation for users Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Steps to install the BioReactorDesign python package for users. ```bash conda create -c conda-forge --name bird python=3.14 paraview conda activate bird pip install nlr-bird ``` -------------------------------- ### Installation for developers (pixi) Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Steps to install the BioReactorDesign python package for developers using pixi. ```bash git clone https://github.com/NREL/BioReactorDesign.git cd BioReactorDesign pixi shell ``` -------------------------------- ### Installation of BiRD OpenFOAM solver (compile) Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Compile the BiRD OpenFOAM solver. ```bash cd OFsolvers/birdmultiphaseEulerFoam/ ./Allwmake ``` -------------------------------- ### Install dependencies Source: https://natlabrockies.github.io/BioReactorDesign/calibration_normal_beta.html Commands to activate the environment, set the BIRD_DIR, and install additional dependencies for calibration. ```bash conda activate bird BIRD_DIR = `python -c "import bird; print(bird.BIRD_DIR)"` cd ${BIRD_DIR}/../ pip install .[calibration] ``` -------------------------------- ### Installation for developers (conda) Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Steps to install the BioReactorDesign python package for developers using conda. ```bash conda create -c conda-forge --name bird python=3.14 paraview conda activate bird git clone https://github.com/NREL/BioReactorDesign.git cd BioReactorDesign pip install -e . ``` -------------------------------- ### Installation of BiRD OpenFOAM solver (activate environment) Source: https://natlabrockies.github.io/BioReactorDesign/quickstart.html Activate the OpenFOAM-9 environment. ```bash source /etc/rc ``` -------------------------------- ### Setup environment and case folder Source: https://natlabrockies.github.io/BioReactorDesign/python_interface_tut.html This snippet shows how to activate the 'bird' environment, set the BIRD_HOME path, and navigate to the case directory. ```bash conda activate bird BIRD_HOME=`python -c "import bird; print(bird.BIRD_DIR)" DCM_CASE=${BIRD_HOME}/postprocess/data_conditional_mean/ cd $DCM_CASE ``` -------------------------------- ### Boundary Patch Shapes Source: https://natlabrockies.github.io/BioReactorDesign/meshing.html Example JSON configuration for defining boundary conditions with circular inlets. ```json { "inlets": [ {"type": "circle", "centx": 5.0, "centy": 0.0, "centz": 0.5, "radius": 0.4, "normal_dir": 1,"nelements": 50}, {"type": "circle", "centx": 2.5, "centy": 0.0, "centz": 0.5, "radius": 0.4, "normal_dir": 1,"nelements": 50}, {"type": "circle", "centx": 7.5, "centy": 0.0, "centz": 0.5, "radius": 0.4, "normal_dir": 1,"nelements": 50} ], } ``` -------------------------------- ### Setup environment and case path Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Commands to activate the 'bird' conda environment and set the BIRD_HOME and BCE_CASE environment variables. ```bash conda activate bird BIRD_HOME=`python -c "import bird; print(bird.BIRD_DIR)" BCE_CASE=${BIRD_HOME}/../tutorial_cases/bubble_column_20L ``` -------------------------------- ### Run Unit Tests with Conda Source: https://natlabrockies.github.io/BioReactorDesign/contribute.html Steps to activate the 'bird' conda environment, install pytest, set the BIRD_HOME environment variable, and run unit tests. ```bash conda activate bird pip install pytest BIRD_HOME=`python -c "import bird; print(bird.BIRD_DIR))" cd ${BIRD_HOME}/../ pytest . ``` -------------------------------- ### Coarsening Configuration Example Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Configuration snippet for defining radial and vertical coarsening ratios to adjust mesh density. ```json "Meshing": { ... "verticalCoarsening":[ {"ratio": 0.5, "direction": "+", "directionRef": "-"}, {"ratio": 1.0, "direction": "+", "directionRef": "-"}, {"ratio": 1.0, "direction": "+", "directionRef": "-"} ], "radialCoarsening": [ {"ratio": 1.0, "direction": "+", "directionRef": "-"}, {"ratio": 1.0, "direction": "+", "directionRef": "-"} ] ``` -------------------------------- ### Meshing Configuration Example Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Configuration snippet for defining the base mesh resolution in radial and vertical directions. ```json "Meshing": { "NRSmallest": 4, "NVertSmallest": 12, ``` -------------------------------- ### Run Regression Tests Source: https://natlabrockies.github.io/BioReactorDesign/contribute.html Steps to run regression tests, including sourcing OpenFOAM environment variables, activating the 'bird' conda environment, installing pytest, setting BIRD_HOME, and executing the regression test script. ```bash source /etc/rc conda activate bird pip install pytest BIRD_HOME=`python -c "import bird; print(bird.BIRD_DIR))" cd ${BIRD_HOME}/../tutorial_cases bash run_all.sh ``` -------------------------------- ### Unrecognized Drag and Mass Transfer Model Error Source: https://natlabrockies.github.io/BioReactorDesign/troubleshoot.html An example of a FATAL ERROR message indicating an unrecognized dragModelType, suggesting the use of the wrong OpenFOAM solver. ```text [6] --> FOAM FATAL ERROR: [6] Unknown dragModelType type Grace ``` -------------------------------- ### Run the entire tutorial Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Commands to navigate to the case directory and execute the main run script. ```bash cd ${BCE_CASE} bash run.sh ``` -------------------------------- ### Run the tutorial with pixi Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Commands to navigate to the case directory and execute the run script when using pixi. ```bash cd ${BCE_CASE} bash run_pixi.sh ``` -------------------------------- ### Generate Target Data Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Generates the target data for the calibration tutorial. ```bash cd make_dataset bash gen_target.sh cd .. ``` -------------------------------- ### Generate Dataset Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Commands to navigate to the dataset generation directory and execute the dataset generation script. This creates a file 'data/dataset.npz' containing BSD of simulations. ```bash cd make_dataset bash gen_dataset.sh cd .. ``` -------------------------------- ### Run Unit Tests with Pixi Source: https://natlabrockies.github.io/BioReactorDesign/contribute.html Steps to enter a Pixi shell, set the BIRD_HOME environment variable, and run unit tests. ```bash pixi shell BIRD_HOME=`python -c "import bird; print(bird.BIRD_DIR))" cd ${BIRD_HOME}/../ pixi run test ``` -------------------------------- ### Train Neural Net Surrogate Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Command to train a neural network surrogate model. This process generates a loss history plot ('loss.png') and model weights ('Modeltmp'). ```bash bash train_surrogate.sh ``` -------------------------------- ### Apply Initial Conditions Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Commands to copy the initial condition folder and run the `setFields` utility. ```bash cd ${BCE_CASE} cp -r 0.orig 0 setFields -dict system/setFieldsDict ``` -------------------------------- ### Check Generated Dataset Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Commands to navigate to the data directory and run a Python script to check the generated dataset, visualizing Bf and Cr values and their relation to runaway conditions. ```bash cd data python check_real.py -ter cd .. ``` -------------------------------- ### Calibrate with a surrogate Source: https://natlabrockies.github.io/BioReactorDesign/calibration_normal_beta.html Calibrate with a surrogate for alpha=5, beta=5. ```python python tut_calibration.py -useNN --alpha 5 --beta 5 ``` -------------------------------- ### Calibrate with a surrogate Source: https://natlabrockies.github.io/BioReactorDesign/calibration_normal_beta.html Calibrate with a surrogate for alpha=2, beta=5. ```python python tut_calibration.py -useNN --alpha 2 --beta 5 ``` -------------------------------- ### Running the BiRD multiphase solver Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Command to execute the BiRD multiphase solver. ```bash cd ${BCE_CASE} birdmultiphaseEulerFoam ``` -------------------------------- ### Bioreactor Simulation Computations Source: https://natlabrockies.github.io/BioReactorDesign/python_interface_tut.html Demonstrates the computation of superficial gas velocity, reactor-averaged CO2 mass fraction, concentration, kLa, and bubble diameter. It also shows how fields are stored and reused. ```python sup_vel, field_dict = compute_superficial_gas_velocity( field_dict=field_dict, **kwargs ) print("fields stored = ", list(field_dict.keys())) print(f"Superficial velocity = {sup_vel:.4g} m/s") # Compute reactor-averaged CO2 mass fraction y_ave_co2, field_dict = compute_ave_y_liq( species_name="CO2", field_dict=field_dict, **kwargs ) print("fields stored = ", list(field_dict.keys())) print(f"Reactor averaged YCO2 = {y_ave_co2:.4g}") # Compute reactor-averaged CO2 concentration c_ave_co2, field_dict = compute_ave_conc_liq( species_name="CO2", field_dict=field_dict, **kwargs, ) print("fields stored = ", list(field_dict.keys())) print(f"Reactor averaged [CO2] = {c_ave_co2:.4g} mol/m3") kla, cstar, field_dict = compute_instantaneous_kla( species_names=["CO2"], field_dict=field_dict, **kwargs, ) print("fields stored = ", list(field_dict.keys())) print(f"Reactor averaged kLa = {kla['CO2']:.4g} h-1") print(f"Reactor averaged cstar_co2 = {cstar['CO2']:.4g} mol/m3") # Compute reactor-averaged bubble diameter diam, field_dict = compute_ave_bubble_diam( field_dict=field_dict, **kwargs ) print("fields stored = ", list(field_dict.keys())) print(f"Reactor averaged bubble diameter = {diam:.4g} m") ``` -------------------------------- ### Calibrate against Binary Breakup and Coalescence Data Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Python command to calibrate the model against target data obtained with binary breakup and coalescence. ```python python tut_calibration.py ``` -------------------------------- ### Calibrate against Ternary Breakup and Coalescence Data Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Python command to calibrate the model against target data obtained with ternary breakup and coalescence. ```python python tut_calibration.py -ter ``` -------------------------------- ### Setting up the constant diameter bubble model Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Commands to copy the template for the constant diameter bubble model to the main phaseProperties file. ```bash cd ${BCE_CASE} cp constant/phaseProperties_constantd constant/phaseProperties ``` -------------------------------- ### Generating a mesh object file with OpenFOAM utility Source: https://natlabrockies.github.io/BioReactorDesign/python_interface.html Command to generate a mesh object file using OpenFOAM's writeMeshObj utility. ```bash writeMeshObj -case {case_folder} ``` -------------------------------- ### Perform early prediction Source: https://natlabrockies.github.io/BioReactorDesign/uq.html This script performs early prediction using a specified data file. ```python python applications/early_prediction.py -df bird/postprocess/data_early ``` -------------------------------- ### Compute kLa with uncertainty estimates Source: https://natlabrockies.github.io/BioReactorDesign/uq.html This script computes kLa with uncertainty estimates using Bayesian calibration and data bootstrapping. It takes input data file, time index, concentration index, and Monte Carlo simulations as arguments. ```python python applications/compute_kla_uq.py -i bird/postprocess/data_kla/volume_avg.dat -ti 0 -ci 1 -mc 10 ``` ```text Chopping index = 0 Chopping index = 1 Chopping index = 2 Chopping index = 3 Chopping index = 4 Doing data bootstrapping scenario 0 scenario 1 scenario 2 scenario 3 For bird/postprocess/data_kla/volume_avg.dat with time index: 0, concentration index: 1 kla = 324 +/- 2.446 [h-1] cstar = 0.3107 +/- 0.0006522 [mol/m3] Without data bootstrap kla = 324.5 +/- 2.075 [h-1] cstar = 0.3105 +/- 0.0005444 [mol/m3] ``` -------------------------------- ### Enforce Formatting with Pixi Source: https://natlabrockies.github.io/BioReactorDesign/contribute.html Commands to enforce code formatting, import sorting, and spell checks using Pixi. ```bash pixi shell pixi run lint-write pixi run spell-write ``` -------------------------------- ### Calibrate without a surrogate Source: https://natlabrockies.github.io/BioReactorDesign/calibration_normal_beta.html Calibrate without a surrogate for alpha=5, beta=5. ```python python tut_calibration.py --alpha 5 --beta 5 ``` -------------------------------- ### Calibrate without a surrogate Source: https://natlabrockies.github.io/BioReactorDesign/calibration_normal_beta.html Calibrate without a surrogate for alpha=2, beta=5. ```python python tut_calibration.py --alpha 2 --beta 5 ``` -------------------------------- ### Reading cell centers Source: https://natlabrockies.github.io/BioReactorDesign/python_interface_tut.html This snippet demonstrates how to read cell center coordinates using the `bird.utilities.ofio` module. ```python # Set case folder from pathlib import Path case_folder = os.path.join( Path(__file__).parent, ) from bird.utilities.ofio import * cell_centers = read_cell_centers(case_folder=case_folder) ``` -------------------------------- ### Calibrate Likelihood Uncertainty (Binary) Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Python command to calibrate the likelihood uncertainty against target data obtained with binary breakup and coalescence, using the '-cal_err' flag. ```python python tut_calibration.py -cal_err ``` -------------------------------- ### Activate Debug Logs Source: https://natlabrockies.github.io/BioReactorDesign/troubleshoot.html This code snippet shows how to activate debug logging in BiRD by setting the logger level to DEBUG at the beginning of a script. ```python from bird import logger logger.setLevel(level="DEBUG") ``` -------------------------------- ### Calibrate Likelihood Uncertainty (Ternary) Source: https://natlabrockies.github.io/BioReactorDesign/calibration_bsd.html Python command to calibrate the likelihood uncertainty against target data obtained with ternary breakup and coalescence, using the '-cal_err' flag. ```python python tut_calibration.py -ter -cal_err ``` -------------------------------- ### Reading fields Source: https://natlabrockies.github.io/BioReactorDesign/python_interface_tut.html This snippet shows how to read scalar and vector fields like 'CO2.gas', 'alpha.gas', and 'U.liquid' at a specific time step. ```python co2_gas, _ = read_field(case_folder, "80", field_name="CO2.gas") alpha_gas, _ = read_field(case_folder, "80", field_name="alpha.gas") u_liq, _ = read_field(case_folder, "80", field_name="U.liquid") print("cell CO2 gas shape = ", co2_gas.shape) print("cell alpha gas shape = ", alpha_gas.shape) print("cell u liq shape = ", u_liq.shape) ``` -------------------------------- ### Calibrate without a surrogate Source: https://natlabrockies.github.io/BioReactorDesign/calibration_normal_beta.html Calibrate without a surrogate for alpha=2, beta=5, calibrating likelihood uncertainty. ```python python tut_calibration.py --alpha 2 --beta 5 -cal_err ``` -------------------------------- ### Enforce Formatting with Nox Source: https://natlabrockies.github.io/BioReactorDesign/contribute.html Commands to automatically enforce code formatting, import sorting, and spell checks using Nox. ```bash pip install nox nox -s lint -- write nox -s spell -- write ``` -------------------------------- ### Block rectangular meshing Source: https://natlabrockies.github.io/BioReactorDesign/meshing.html Generates system/blockMeshDict for a block rectangular mesh and then constructs the mesh using OpenFOAM utilities. ```bash 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 ``` ```bash cd $caseFolder blockMesh cd $root ``` -------------------------------- ### Compute mean statistics with uncertainty Source: https://natlabrockies.github.io/BioReactorDesign/uq.html This script computes mean statistics with uncertainty for a time-series signal. It demonstrates averaging a discretized time-series signal and estimating statistical error. ```python python applications/compute_time_series_mean.py ``` ```text 2025-09-02 12:36:15,016 [DEBUG] bird: Making the time series equally spaced over time 2025-09-02 12:36:15,016 [DEBUG] bird: Time series already equally spaced 2025-09-02 12:36:15,016 [DEBUG] bird: T0 = 1.270553916086648 2025-09-02 12:36:15,016 [INFO] bird: Mean = 0.01 +/- 0.081 ``` ```text 2025-09-02 12:36:15,016 [DEBUG] bird: Making the time series equally spaced over time 2025-09-02 12:36:15,016 [DEBUG] bird: Time series already equally spaced 2025-09-02 12:36:15,030 [DEBUG] bird: T0 = 126.6515206796017 2025-09-02 12:36:15,030 [INFO] bird: Mean = 0.0001 +/- 0.08 ``` -------------------------------- ### BiRD Software Citations Source: https://natlabrockies.github.io/BioReactorDesign/references.html BibTeX entries for citing the BiRD software and related research on CO2 interphase mass transfer and butanediol synthesis. ```bibtex @article{hassanaly2025inverse, title={Bayesian calibration of bubble size dynamics applied to CO2 gas fermenters}, author={Hassanaly, Malik and Parra-Alvarez, John M and Rahimi, Mohammad J and Municchi, Federico and Sitaraman, Hariswaran}, journal={Chemical Engineering Research and Design}, volume={215}, pages={312--328}, year={2025}, publisher={Elsevier} } @article{rahimi2018computational, title={Computational fluid dynamics study of full-scale aerobic bioreactors: Evaluation of gas--liquid mass transfer, oxygen uptake, and dynamic oxygen distribution}, author={Rahimi, Mohammad J and Sitaraman, Hariswaran and Humbird, David and Stickel, Jonathan J}, journal={Chemical Engineering Research and Design}, volume={139}, pages={283--295}, year={2018}, publisher={Elsevier} } @article{sitaraman2023reacting, title={A reacting multiphase computational flow model for 2, 3-butanediol synthesis in industrial-scale bioreactors}, author={Sitaraman, Hariswaran and Lischeske, James and Lu, Yimin and Stickel, Jonathan}, journal={Chemical Engineering Research and Design}, volume={197}, pages={38--52}, year={2023}, publisher={Elsevier} } ``` -------------------------------- ### Compute Gas Holdup Source: https://natlabrockies.github.io/BioReactorDesign/python_interface_tut.html This snippet demonstrates computing the gas holdup using the `compute_gas_holdup` function and storing intermediate fields. ```python from bird.postprocess.post_quantities import * # Compute Gas hold up kwargs = {"case_folder": case_folder, "time_folder": "80"} gh, field_dict = compute_gas_holdup( field_dict={"cell_centers": cell_centers}, **kwargs ) print("fields stored = ", list(field_dict.keys())) print(f"Gas Holdup = {gh:.4g}") ``` -------------------------------- ### parse_yaml Function Source: https://natlabrockies.github.io/BioReactorDesign/bird.utilities.html Parses a YAML file into a Python dictionary. ```python bird.utilities.parser.parse_yaml(_file_path : str_) -> dict Parse a yaml file into a dictionary Parameters: file_path (_str_) – path to yaml file Returns: inpt – Dictionary that contains the yaml file content Return type: dict ``` -------------------------------- ### Reading cell volumes with OpenFOAM utility Source: https://natlabrockies.github.io/BioReactorDesign/python_interface.html Command to generate a cell volume field using OpenFOAM's postProcess utility. ```bash postProcess -func writeCellVolumes -time {time_folder} -case {case_folder} ``` -------------------------------- ### Block cylindrical meshing Source: https://natlabrockies.github.io/BioReactorDesign/meshing.html Generates system/blockMeshDict for a block cylindrical mesh and then constructs the mesh using OpenFOAM utilities. ```bash 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 ``` ```bash cd $caseFolder blockMesh transformPoints "scale=(0.001 0.001 0.001)" transformPoints "rotate=((0 0 1) (0 1 0))" cd $root ``` -------------------------------- ### Initial Conditions Definition Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Configuration for the `setFields` utility in OpenFOAM to define initial volume fractions for gas and liquid. ```plaintext defaultFieldValues ( volScalarFieldValue alpha.gas 0.99 volScalarFieldValue alpha.liquid 0.01 ); regions ( boxToCell { box (-1.0 -1.0 -1.0) (10 7 10); fieldValues ( volScalarFieldValue alpha.gas 0.01 volScalarFieldValue alpha.liquid 0.99 ); } ); ``` -------------------------------- ### Generate stirred tank reactor mesh Source: https://natlabrockies.github.io/BioReactorDesign/meshing.html Generates a blockMeshDict for a stirred tank reactor using a Python script and then meshes the domain using OpenFOAM utilities. ```bash 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 ``` ```bash 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))" ``` -------------------------------- ### plot_stl Function Source: https://natlabrockies.github.io/BioReactorDesign/bird.utilities.html Plots a 2D STL file using Matplotlib, useful for checking boundary conditions. ```python bird.utilities.stl_plotting.plot_stl(_stl_file : str_) -> Axes Plot a 2D STL file with matplotlib This is useful to check boundary condition definition with STL Parameters: stl_file (_str_) – Name of the STL file to display Returns: axes – Axes of the plot created Return type: matplotlib.axes.Axes ``` -------------------------------- ### bissection function Source: https://natlabrockies.github.io/BioReactorDesign/bird.utilities.html Solves a 1D non-linear equation using the bisection method. Useful for adjusting mesh grading for smooth mesh size variation. ```python bird.utilities.mathtools.bissection(_fun_val : float_, _nonlin_fun : Callable_, _num_iter : int = 1000_, _x_min : float = 1e-06_, _x_max : float = 1000000.0_) → float ``` -------------------------------- ### Generate mesh and topology Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Python command to generate the blockMeshDict file based on mesh and topology configuration. ```bash python ${BIRD_HOME}/../applications/write_block_cyl_mesh.py -i system/mesh.json -t system/topology.json -o system ``` -------------------------------- ### Generate STL patch mesh Source: https://natlabrockies.github.io/BioReactorDesign/meshing.html Generates an STL patch mesh using a Python script, with an option to visualize the STL mesh. ```bash python applications/write_stl_patch.py -v ``` -------------------------------- ### Updating global variables Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Commands to update global variables, including calculating inlet area, volumes, and running a Python script to write the correct globalVars file. ```bash cd ${BCE_CASE} postProcess -func "patchIntegrate(patch=\"inlet\", field=\"alpha.gas\")" postProcess -func writeCellVolumes writeMeshObj python writeGlobalVars.py ``` -------------------------------- ### parse_json Function Source: https://natlabrockies.github.io/BioReactorDesign/bird.utilities.html Parses a JSON file into a Python dictionary. ```python bird.utilities.parser.parse_json(_file_path : str_) -> dict Parse a json file into a dictionary Parameters: file_path (_str_) – path to json file Returns: inpt – Dictionary that contains the json file content Return type: dict ``` -------------------------------- ### BlockMesh Generation Command Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Command to generate the mesh using the blockMesh utility in OpenFOAM. ```bash blockMesh -dict system/blockMeshDict ``` -------------------------------- ### Mesh Post-treatment Scaling Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Command to scale the mesh points, likely to adjust the reactor volume. ```bash transformPoints "scale=(0.19145161188225573 0.19145161188225573 0.19145161188225573)" ``` -------------------------------- ### Surface to Patch Conversion Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html OpenFOAM commands to convert the generated STL patch into a boundary patch in the mesh, including renaming and copying mesh files. ```bash cd ${BCE_CASE}/ surfaceToPatch -tol 1e-3 inlets.stl export newmeshdir=$(foamListTimes -latestTime) rm -rf constant/polyMesh/ cp -r $newmeshdir/polyMesh ./constant rm -rf $newmeshdir cp ${BCE_CASE}/constant/polyMesh/boundary /tmp sed -i -e 's/inlets.stl/inlet/g' /tmp/boundary cat /tmp/boundary > constant/polyMesh/boundary ``` -------------------------------- ### Scale Points Transformation Source: https://natlabrockies.github.io/BioReactorDesign/bubbleColumn.html Command to transform points to convert units from mm to m. ```bash transformPoints "scale=(0.001 0.001 0.001)" ```