From 19d426fd7526a8704e6769154d205e692f267efb Mon Sep 17 00:00:00 2001 From: Malik Hassanaly Date: Mon, 30 Mar 2026 14:46:37 -0600 Subject: [PATCH 1/3] fix federico and will's issues --- bird/postprocess/post_quantities.py | 38 +++-- bird/utilities/ofio.py | 140 +++++++++------- noxfile.py | 4 + pixi.lock | 66 ++++++-- pyproject.toml | 1 + .../putida_test_non_calc/constant/globalVars | 153 ++++++++++++++++++ tests/io/test_read_global_vars.py | 17 ++ 7 files changed, 335 insertions(+), 84 deletions(-) create mode 100644 tests/io/putida_test_non_calc/constant/globalVars diff --git a/bird/postprocess/post_quantities.py b/bird/postprocess/post_quantities.py index 13456859..655abcb0 100644 --- a/bird/postprocess/post_quantities.py +++ b/bird/postprocess/post_quantities.py @@ -932,13 +932,13 @@ def compute_instantaneous_kla( where: - :math:`kLa_{\rm spec}` is the mass transfer rate in :math:`h^{-1}` - - :math:`d_{\rm gas}` is the bubble diameter in :math:`m` - - :math:`\alpha_{\rm gas}` is the volume fraction of gas - - :math:`\mu_{\rm liq}` is the liquid viscosity in :math:`kg.m^{-1}.s^{-1}` - - :math:`\rho_{\rm liq}` is the liquid density in :math:`kg.m^{-3}` - - :math:`D_{\rm spec}` is the species molecular diffusivity in :math:`m^2.s^{-1}` - - :math:`|u_{\rm slip}|` is the magnitude of the slip velocity in :math:`m.s^{-1}` - - :math:`V_{\rm liq}` is the volume of liquid in :math:`m^3` + - :math:`d_{\rm gas}` is the bubble diameter in :math:`m`. Either read from the time folder, or looked up from phaseProperties + - :math:`\alpha_{\rm gas}` is the volume fraction of gas. Read from the time folder. + - :math:`\mu_{\rm liq}` is the liquid viscosity in :math:`kg.m^{-1}.s^{-1}`. Either read from the time folder or globalVars. + - :math:`\rho_{\rm liq}` is the liquid density in :math:`kg.m^{-3}`. Either read from the time folder or assumed to be 1000kg/m3 + - :math:`D_{\rm spec}` is the species molecular diffusivity in :math:`m^2.s^{-1}`. Read from globalVars + - :math:`|u_{\rm slip}|` is the magnitude of the slip velocity in :math:`m.s^{-1}`. Read from the time folder. + - :math:`V_{\rm liq}` is the volume of liquid in :math:`m^3`. Read from the time folder. .. math:: @@ -952,10 +952,10 @@ def compute_instantaneous_kla( and - :math:`C^{*}_{\rm spec}` is the saturation concentration of species spec in :math:`mol.m^{-3}` - - :math:`\rho_{\rm gas}` is the density of the gas in :math:`kg.m^{-3}` - - :math:`Y_{\rm spec, gas}` is the mass fraction of species spec in the gas phase - - :math:`He_{\rm spec}` is the Henry's constant of species spec - - :math:`W_{\rm spec}` is the molar mass of species spec in :math:`kg.mol^{-1}` + - :math:`\rho_{\rm gas}` is the density of the gas in :math:`kg.m^{-3}`. Read from the time folder. + - :math:`Y_{\rm spec, gas}` is the mass fraction of species spec in the gas phase. Read from the time folder. + - :math:`He_{\rm spec}` is the Henry's constant of species spec. Read from globalVars. + - :math:`W_{\rm spec}` is the molar mass of species spec in :math:`kg.mol^{-1}`. Read from globalVars. Parameters @@ -1032,9 +1032,18 @@ def compute_instantaneous_kla( alpha_gas, field_dict = read_field( field_name="alpha.gas", field_dict=field_dict, **kwargs ) - rho_liq, field_dict = read_field( - field_name="thermo:rho.liquid", field_dict=field_dict, **kwargs - ) + try: + rho_liq, field_dict = read_field( + field_name="thermo:rho.liquid", field_dict=field_dict, **kwargs + ) + except FileNotFoundError: + abs_time_path = os.path.join(case_folder, time_folder) + logger.warning( + f"thermo:rho.liquid not found in {abs_time_path}, assuming it is 1000kg/m3" + ) + rho_liq = 1000.0 + field_dict["rho_liq"] = rho_liq + rho_gas, field_dict = read_field( field_name="thermo:rho.gas", field_dict=field_dict, **kwargs ) @@ -1045,6 +1054,7 @@ def compute_instantaneous_kla( field_name="U.liquid", field_dict=field_dict, **kwargs ) d_gas, field_dict = read_bubble_diameter(field_dict=field_dict, **kwargs) + mu_liq, field_dict = read_mu_liquid(field_dict=field_dict, **kwargs) species_gas = {} for species_name in species_names: diff --git a/bird/utilities/ofio.py b/bird/utilities/ofio.py index 478a3882..f034a16b 100644 --- a/bird/utilities/ofio.py +++ b/bird/utilities/ofio.py @@ -1274,6 +1274,41 @@ def read_mu_liquid( return mu_liq, field_dict +def _cross_reference_math(expr): + """ + Resolve math in cross referencing in the globalVars dictionary + """ + # Replace 'Foam::pow' with 'math.pow' + if "Foam::pow" in expr: + expr = expr.replace("Foam::pow", "math.pow") + + if "pow" in expr: + indstr = [m.start() for m in re.finditer("pow", expr)] + new_expr = expr + count_replace = 0 + for ind in indstr: + if not "mat" in new_expr[ind - 6 : ind + 3]: + tmp = new_expr + new_expr = ( + tmp[: ind + 5 * count_replace] + + "math.pow" + + tmp[ind + 5 * count_replace + 3 :] + ) + count_replace += 1 + expr = new_expr + # Replace 'exp' with 'math.exp' + expr = expr.replace("exp", "math.exp") + # Replace 'sin' with 'math.sin' + expr = expr.replace("sin", "math.sin") + # Replace 'cos' with 'math.cos' + expr = expr.replace("cos", "math.cos") + # Replace 'tan' with 'math.tan' + expr = expr.replace("tan", "math.tan") + + degToRad = lambda x: x * np.pi / 180.0 + return expr, degToRad + + def _cross_reference_global_vars( globalVars_dict: dict, ) -> dict: @@ -1289,61 +1324,57 @@ def _cross_reference_global_vars( for key, value in globalVars_dict.items(): # Check if we need to do cross referencing - if isinstance(value, str) and value.startswith("#calc"): + if isinstance(value, str): + # CALC case + if value.startswith("#calc"): + # Extract expression inside quotes + expr = value.split('"', 1)[1].rsplit('"', 1)[0] + + # Replace $Var with its numeric value from globalVars_dict + def repl(match): + varname = match.group(1) + if varname not in cross_referenced_globalVars_dict: + raise KeyError( + f"Variable '{varname}' not found for expression {expr}" + ) + return str(cross_referenced_globalVars_dict[varname]) - # Extract expression inside quotes - expr = value.split('"', 1)[1].rsplit('"', 1)[0] + expr = var_pattern.sub(repl, expr) - # Replace $Var with its numeric value from globalVars_dict - def repl(match): - varname = match.group(1) - if varname not in cross_referenced_globalVars_dict: - raise KeyError( - f"Variable '{varname}' not found for expression {expr}" + expr, degToRad = _cross_reference_math(expr) + try: + result = eval(expr, {"math": math, "degToRad": degToRad}) + result = float(result) + # Convert to int if whole number + # if result.is_integer(): + # result = int(result) + cross_referenced_globalVars_dict[key] = result + + except Exception as e: + logger.warning( + f"Could not evaluate globalVars expression for {key}: {expr}" + ) + # Direct variable references + elif "$" in value: + + def repl_direct(match): + varname = match.group(1) + return str(cross_referenced_globalVars_dict[varname]) + + try: + # Substitute the variable + expr = var_pattern.sub(repl_direct, value) + expr, degToRad = _cross_reference_math(expr) + result = eval(expr, {"math": math, "degToRad": degToRad}) + # Convert to int if whole number + result = float(result) + # if result.is_integer(): + # result = int(result) + cross_referenced_globalVars_dict[key] = result + except Exception as e: + logger.warning( + f"Could not evaluate globalVars expression for {key}: {expr}" ) - return str(cross_referenced_globalVars_dict[varname]) - - expr = var_pattern.sub(repl, expr) - - # Replace 'Foam::pow' with 'math.pow' - if "Foam::pow" in expr: - expr = expr.replace("Foam::pow", "math.pow") - - if "pow" in expr: - indstr = [m.start() for m in re.finditer("pow", expr)] - new_expr = expr - count_replace = 0 - for ind in indstr: - if not "mat" in new_expr[ind - 6 : ind + 3]: - tmp = new_expr - new_expr = ( - tmp[: ind + 5 * count_replace] - + "math.pow" - + tmp[ind + 5 * count_replace + 3 :] - ) - count_replace += 1 - expr = new_expr - # Replace 'exp' with 'math.exp' - expr = expr.replace("exp", "math.exp") - # Replace 'sin' with 'math.sin' - expr = expr.replace("sin", "math.sin") - # Replace 'cos' with 'math.cos' - expr = expr.replace("cos", "math.cos") - # Replace 'tan' with 'math.tan' - expr = expr.replace("tan", "math.tan") - - degToRad = lambda x: x * np.pi / 180.0 - try: - result = eval(expr, {"math": math, "degToRad": degToRad}) - # Convert to int if whole number - if isinstance(result, float) and result.is_integer(): - result = int(result) - cross_referenced_globalVars_dict[key] = result - - except Exception as e: - logger.warning( - f"Could not evaluate globalVars expression for {key}: {expr}" - ) return cross_referenced_globalVars_dict @@ -1374,7 +1405,6 @@ def read_global_vars( globalVars_dict : dict Dictionary that contains the globals vars variable values """ - # Set the filename to read if case_folder is None: if filename is None or not os.path.isfile(filename): @@ -1416,8 +1446,8 @@ def read_global_vars( # Try numeric conversion otherwise store value as str try: val = float(value) - if val.is_integer(): - val = int(val) + # if val.is_integer(): + # val = int(val) globalVars_dict[key] = val except ValueError: globalVars_dict[key] = value diff --git a/noxfile.py b/noxfile.py index 4abb248e..a2d12355 100644 --- a/noxfile.py +++ b/noxfile.py @@ -63,6 +63,8 @@ def run_lint(session: nox.Session) -> None: "py314", "--exclude", ".pixi", + "--exclude", + "pixi*", ".", ] isort_command = [ @@ -79,6 +81,8 @@ def run_lint(session: nox.Session) -> None: "--use-parentheses", "--skip", ".pixi", + "--skip", + "pixi*", ".", ] diff --git a/pixi.lock b/pixi.lock index 6f963850..bf3daa3e 100644 --- a/pixi.lock +++ b/pixi.lock @@ -179,6 +179,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-12.1.1-py312h50c33e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -228,6 +229,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/viskores-1.1.0-hca82ae8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/vtk-base-9.5.2-py312h6fba518_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.24.0-hd6090a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -289,7 +291,6 @@ environments: - pypi: https://files.pythonhosted.org/packages/33/d1/8bb87d21e9aeb323cc03034f5eaf2c8f69841e40e4853c2627edf8111ed3/termcolor-3.3.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/27/c4/0bb64e4e16f689b2e7abf825cd8fa1d24c8f9c9ceb6f6b248f517b6cbcc4/tf2jax-0.3.8-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/4d/ec/d58832f89ede95652fd01f4f24236af7d32b70cab2196dfcc2d2fd13c5c2/werkzeug-3.1.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/87/22/b76d483683216dde3d67cba61fb2444be8d5be289bf628c13fc0fd90e5f9/wheel-0.46.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/af/aa/ead46a88f9ec3a432a4832dfedb84092fc35af2d0ba40cd04aea3889f247/wrapt-2.1.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl - pypi: ./ osx-arm64: @@ -443,6 +444,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.47-h30297fc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-12.1.1-py312h4e908a4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pixman-0.46.4-h81086ad_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -491,6 +493,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.1.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/viskores-1.1.0-h052cd35_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/vtk-base-9.5.2-py312h50b3ee4_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -536,7 +539,6 @@ environments: - pypi: https://files.pythonhosted.org/packages/33/d1/8bb87d21e9aeb323cc03034f5eaf2c8f69841e40e4853c2627edf8111ed3/termcolor-3.3.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fe/79/fdec31e94374d8cad1780ac35c12b602d286826e5d9372fe97c200927316/tf2jax-0.3.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/4d/ec/d58832f89ede95652fd01f4f24236af7d32b70cab2196dfcc2d2fd13c5c2/werkzeug-3.1.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/87/22/b76d483683216dde3d67cba61fb2444be8d5be289bf628c13fc0fd90e5f9/wheel-0.46.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a2/16/9b02a6b99c09227c93cd4b73acc3678114154ec38da53043c0ddc1fba0dc/wrapt-2.1.2-cp312-cp312-macosx_11_0_arm64.whl - pypi: ./ default: @@ -712,6 +714,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-12.1.1-py312h50c33e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -755,6 +758,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/viskores-1.1.0-hca82ae8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/vtk-base-9.5.2-py312h6fba518_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.24.0-hd6090a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -943,6 +947,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.47-h30297fc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-12.1.1-py312h4e908a4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pixman-0.46.4-h81086ad_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -985,6 +990,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.1.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/viskores-1.1.0-h052cd35_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/vtk-base-9.5.2-py312h50b3ee4_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -1219,6 +1225,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-12.1.1-py312h50c33e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -1291,6 +1298,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/viskores-1.1.0-hca82ae8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/vtk-base-9.5.2-py312h6fba518_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.24.0-hd6090a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -1355,7 +1363,6 @@ environments: - pypi: https://files.pythonhosted.org/packages/33/d1/8bb87d21e9aeb323cc03034f5eaf2c8f69841e40e4853c2627edf8111ed3/termcolor-3.3.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/27/c4/0bb64e4e16f689b2e7abf825cd8fa1d24c8f9c9ceb6f6b248f517b6cbcc4/tf2jax-0.3.8-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/4d/ec/d58832f89ede95652fd01f4f24236af7d32b70cab2196dfcc2d2fd13c5c2/werkzeug-3.1.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/87/22/b76d483683216dde3d67cba61fb2444be8d5be289bf628c13fc0fd90e5f9/wheel-0.46.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/af/aa/ead46a88f9ec3a432a4832dfedb84092fc35af2d0ba40cd04aea3889f247/wrapt-2.1.2-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl - pypi: ./ osx-arm64: @@ -1535,6 +1542,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.47-h30297fc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-12.1.1-py312h4e908a4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pixman-0.46.4-h81086ad_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -1605,6 +1613,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.1.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/viskores-1.1.0-h052cd35_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/vtk-base-9.5.2-py312h50b3ee4_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -1653,7 +1662,6 @@ environments: - pypi: https://files.pythonhosted.org/packages/33/d1/8bb87d21e9aeb323cc03034f5eaf2c8f69841e40e4853c2627edf8111ed3/termcolor-3.3.0-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/fe/79/fdec31e94374d8cad1780ac35c12b602d286826e5d9372fe97c200927316/tf2jax-0.3.2-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/4d/ec/d58832f89ede95652fd01f4f24236af7d32b70cab2196dfcc2d2fd13c5c2/werkzeug-3.1.6-py3-none-any.whl - - pypi: https://files.pythonhosted.org/packages/87/22/b76d483683216dde3d67cba61fb2444be8d5be289bf628c13fc0fd90e5f9/wheel-0.46.3-py3-none-any.whl - pypi: https://files.pythonhosted.org/packages/a2/16/9b02a6b99c09227c93cd4b73acc3678114154ec38da53043c0ddc1fba0dc/wrapt-2.1.2-cp312-cp312-macosx_11_0_arm64.whl - pypi: ./ docs: @@ -1836,6 +1844,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-12.1.1-py312h50c33e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -1895,6 +1904,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/viskores-1.1.0-hca82ae8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/vtk-base-9.5.2-py312h6fba518_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.24.0-hd6090a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -2093,6 +2103,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.47-h30297fc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-12.1.1-py312h4e908a4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pixman-0.46.4-h81086ad_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -2151,6 +2162,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.1.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/viskores-1.1.0-h052cd35_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/vtk-base-9.5.2-py312h50b3ee4_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -2358,6 +2370,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-12.1.1-py312h50c33e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -2404,6 +2417,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/viskores-1.1.0-hca82ae8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/vtk-base-9.5.2-py312h6fba518_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.24.0-hd6090a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -2596,6 +2610,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.47-h30297fc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-12.1.1-py312h4e908a4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pixman-0.46.4-h81086ad_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -2641,6 +2656,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.1.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/viskores-1.1.0-h052cd35_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/vtk-base-9.5.2-py312h50b3ee4_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -2841,6 +2857,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pcre2-10.47-haa7fec5_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pillow-12.1.1-py312h50c33e8_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -2884,6 +2901,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/linux-64/viskores-1.1.0-hca82ae8_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/vtk-base-9.5.2-py312h6fba518_7.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/wayland-1.24.0-hd6090a7_1.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -3072,6 +3090,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/pbs-installer-2026.3.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pcre2-10.47-h30297fc_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pillow-12.1.1-py312h4e908a4_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/pixman-0.46.4-h81086ad_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/platformdirs-4.9.2-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/pluggy-1.6.0-pyhf9edf01_1.conda @@ -3114,6 +3133,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/virtualenv-21.1.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/viskores-1.1.0-h052cd35_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/vtk-base-9.5.2-py312h50b3ee4_7.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/wslink-2.5.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-2026.2.0-pyhcf101f3_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/xarray-einstats-0.10.0-pyhd8ed1ab_0.conda @@ -7247,8 +7267,8 @@ packages: timestamp: 1768670878127 - pypi: ./ name: nlr-bird - version: 0.0.53 - sha256: 9f6abad4aa8a402553f2c7ff9c771f4edacb5a0e1c556b24408a5a38634ee70b + version: 0.0.54 + sha256: 633e97dd18afe275b051de799e4f7e1ff52074cfb90dfd6925dc7111296213bf requires_dist: - numpy - prettyplot>=0.0.36,<0.0.37 @@ -7883,6 +7903,19 @@ packages: - pkg:pypi/pillow?source=compressed-mapping size: 954096 timestamp: 1770794152238 +- conda: https://conda.anaconda.org/conda-forge/noarch/pip-26.0.1-pyh8b19718_0.conda + sha256: 8e1497814a9997654ed7990a79c054ea5a42545679407acbc6f7e809c73c9120 + md5: 67bdec43082fd8a9cffb9484420b39a2 + depends: + - python >=3.10,<3.13.0a0 + - setuptools + - wheel + license: MIT + license_family: MIT + purls: + - pkg:pypi/pip?source=compressed-mapping + size: 1181790 + timestamp: 1770270305795 - conda: https://conda.anaconda.org/conda-forge/linux-64/pixman-0.46.4-h54a6638_1.conda sha256: 43d37bc9ca3b257c5dd7bf76a8426addbdec381f6786ff441dc90b1a49143b6a md5: c01af13bdc553d1a8fbfff6e8db075f0 @@ -9538,15 +9571,18 @@ packages: - markupsafe>=2.1.1 - watchdog>=2.3 ; extra == 'watchdog' requires_python: '>=3.9' -- pypi: https://files.pythonhosted.org/packages/87/22/b76d483683216dde3d67cba61fb2444be8d5be289bf628c13fc0fd90e5f9/wheel-0.46.3-py3-none-any.whl - name: wheel - version: 0.46.3 - sha256: 4b399d56c9d9338230118d705d9737a2a468ccca63d5e813e2a4fc7815d8bc4d - requires_dist: - - packaging>=24.0 - - pytest>=6.0.0 ; extra == 'test' - - setuptools>=77 ; extra == 'test' - requires_python: '>=3.9' +- conda: https://conda.anaconda.org/conda-forge/noarch/wheel-0.46.3-pyhd8ed1ab_0.conda + sha256: d6cf2f0ebd5e09120c28ecba450556ce553752652d91795442f0e70f837126ae + md5: bdbd7385b4a67025ac2dba4ef8cb6a8f + depends: + - packaging >=24.0 + - python >=3.10 + license: MIT + license_family: MIT + purls: + - pkg:pypi/wheel?source=hash-mapping + size: 31858 + timestamp: 1769139207397 - pypi: https://files.pythonhosted.org/packages/a2/16/9b02a6b99c09227c93cd4b73acc3678114154ec38da53043c0ddc1fba0dc/wrapt-2.1.2-cp312-cp312-macosx_11_0_arm64.whl name: wrapt version: 2.1.2 diff --git a/pyproject.toml b/pyproject.toml index 56643f35..54bbd0df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,6 +132,7 @@ corner = ">=2.2.3,<3" numpy-stl = ">=3.2.0,<4" pytest = ">=9.0.2,<10" pytest-cov = ">=7.0.0,<8" +pip = ">=26.0.1,<27" [tool.pixi.feature.docs.dependencies] sphinx = ">=8.2.3,<9" diff --git a/tests/io/putida_test_non_calc/constant/globalVars b/tests/io/putida_test_non_calc/constant/globalVars new file mode 100644 index 00000000..03808389 --- /dev/null +++ b/tests/io/putida_test_non_calc/constant/globalVars @@ -0,0 +1,153 @@ +T0 303.15; // initial T(K) which stays constant +// water thermophysical properties +muMixLiq #calc "2.414e-5 * pow(10,247.8/($T0 - 140.0))"; //viscosity (Pa.s) of water as a function of T(K) +CpMixLiq 4181; // J/kg-K +kThermLiq 0.62; // W/m-K +rho0MixLiq 1000; // kg/m^3 +sigmaLiq 0.07; //surface tension N/m +//Wilke-Chang params for diffusion coefficient of a given solute in water (solvent) +WC_psi 2.6; +WC_M 18; // kg/kmol +WC_V_O2 25.6e-3; // m3/kmol molar volume at normal boiling temperature (Treybal 1968) +WC_V_H2 14.3e-3; +WC_V_CO2 34e-3; +WC_V_CO 30.7e-3; +WC_V_CH4 35e-3; // V_b[cm3/mol]=0.285*V_critical^1.048 (Tyn and Calus; ESTIMATING LIQUID MOLAL VOLUME; Processing, Volume 21, Issue 4, Pages 16 - 17) +WC_V_N2 31.2e-3; +//****** diffusion coeff *********** +D_H2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_H2,0.6)"; +D_CO2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO2,0.6)"; +D_O2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_O2,0.6)"; +D_CO #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CO,0.6)"; +D_CH4 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_CH4,0.6)"; +D_N2 #calc "1.173e-16 * pow($WC_psi * $WC_M,0.5) * $T0 / $muMixLiq / pow($WC_V_N2,0.6)"; +// D_H2=3.4e-9, D_CO2=2e-9, D_CO=2.16e-9 at 25C +// Looks like the H2 diffusion is less than litr reported values ~ 4.5e-9 +//****** Henry coeff *************** +H_O2_298 0.032; +DH_O2 1700; +H_CO2_298 0.83; +DH_CO2 2400; +H_CO_298 0.023; +DH_CO 1300; +H_H2_298 0.019; +DH_H2 500; +H_CH4_298 0.032; +DH_CH4 1900; +H_N2_298 0.015; +DH_N2 1300; + +He_H2 #calc "$H_H2_298 * exp($DH_H2 *(1. / $T0 - 1./298.15))"; +He_CO #calc "$H_CO_298 * exp($DH_CO *(1. / $T0 - 1./298.15))"; +He_CO2 #calc "$H_CO2_298 * exp($DH_CO2 *(1. / $T0 - 1./298.15))"; +He_O2 #calc "$H_O2_298 * exp($DH_O2 *(1. / $T0 - 1./298.15))"; +He_CH4 #calc "$H_CH4_298 * exp($DH_CH4 *(1. / $T0 - 1./298.15))"; +He_N2 #calc "$H_N2_298 * exp($DH_N2 *(1. / $T0 - 1./298.15))"; +//*******inlet gas species mass frac************* +O2_ini 1.0; +f_H2 0.0; +f_CO2 0.0; +f_CO 0.0; +f_O2 $O2_ini; +f_N2 0.0; +//********************************* +LeLiqH2 #calc "$kThermLiq / $rho0MixLiq / $D_H2 / $CpMixLiq"; +LeLiqCO #calc "$kThermLiq / $rho0MixLiq / $D_CO / $CpMixLiq"; +LeLiqCO2 #calc "$kThermLiq / $rho0MixLiq / $D_CO2 / $CpMixLiq"; // = 74 +LeLiqO2 #calc "$kThermLiq / $rho0MixLiq / $D_O2 / $CpMixLiq"; +LeLiqCH4 #calc "$kThermLiq / $rho0MixLiq / $D_CH4 / $CpMixLiq"; +LeLiqN2 #calc "$kThermLiq / $rho0MixLiq / $D_N2 / $CpMixLiq"; + +LeLiqMix #calc "$f_N2*$LeLiqN2+$f_CO2*$LeLiqCO2+$f_O2*$LeLiqO2"; +PrMixLiq #calc "$CpMixLiq * $muMixLiq / $kThermLiq"; +// Pr number is ~ 7 for water and ~ 0.7 for air +//********************************* +kH2 #calc "$D_H2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; +PrH2 #calc "$muMixLiq*$CpMixLiq / $kH2"; + +kCO #calc "$D_CO*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; +PrCO #calc "$muMixLiq*$CpMixLiq / $kCO"; + +kCO2 #calc "$D_CO2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; +PrCO2 #calc "$muMixLiq*$CpMixLiq / $kCO2"; + +kO2 #calc "$D_O2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; +PrO2 #calc "$muMixLiq*$CpMixLiq / $kO2"; + +kCH4 #calc "$D_CH4*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; +PrCH4 #calc "$muMixLiq*$CpMixLiq / $kCH4"; + +kN2 #calc "$D_N2*$rho0MixLiq*$CpMixLiq*$LeLiqMix"; +PrN2 #calc "$muMixLiq*$CpMixLiq / $kN2"; +//*****Gas transport******************* +muMixGas 1.88e-05; +PrMixGas 0.7; +LeGas 1.0; +//dbubGas 0.001; +//********************************* +HtBcol 0.135; +DiaBcol 0.085; +LiqHt 0.051; +LiqHt_limit #calc "0.9*$HtBcol"; +liqVol 0.000337201; +inletA 0; +//********************************* +P0 #calc "101325*0.84974"; //86100; conditions in Golden. CO +//P0 101325.0; +//P0 85000.0; +Pbot #calc "$P0+1000.0*$LiqHt*9.8"; +Pmid #calc "$P0+1000.0*0.5*$LiqHt*9.8"; + +//bubble column cross-section divided by sparger area +ArbyAs 2.0; +uSupVel 0.02; +uGas #calc "$Pmid / $Pbot * $ArbyAs * $uSupVel"; +A_Bcol #calc "3.14159 * $DiaBcol * $DiaBcol / 4.0"; // 0.00567450173 +rho_gas #calc "$Pmid / 287.0 / $T0"; +mflowRate #calc "$uSupVel * $A_Bcol * $rho_gas"; //kg/s +//at .250 L working fluid, from t=6 to t=22.92h, 15 mL base added +// -> 4000x scale up for 1000 L working fluid? ignore for now +//Vb_flowRate #calc "0.015/(22.92 - 6)/3600/1000"; //m^3/s +Vb_flowRate 8.865e-06; + +VVM 1.0; //gas feed per vessel volume, m3 gas/m3 vessel min +V_flowRate #calc "$VVM * $liqVol / 60"; // 5.000217e-6 m^3/s => ~300 ccm +M_flowRate #calc "$V_flowRate * $rho_gas"; +base_flowRate #calc "$Vb_flowRate * $rho0MixLiq"; // 2.4635e-7 kg/s of base solution + +// Sparge holes +ang1 #calc "degToRad(22.5)"; +ang2 #calc "degToRad(45)"; +ang3 #calc "degToRad(67.5)"; +spargeRad 0.0219; + +x1 #calc "$spargeRad*cos($ang1)"; +x1neg #calc "-1.0*$x1"; +z1 #calc "$spargeRad*sin($ang1)"; +z1neg #calc "-1.0*$z1"; +x2 #calc "$spargeRad*cos($ang2)"; +x2neg #calc "-1.0*$x2"; +z2 #calc "$spargeRad*sin($ang2)"; +z2neg #calc "-1.0*$z2"; +x3 #calc "$spargeRad*cos($ang3)"; +x3neg #calc "-1.0*$x3"; +z3 #calc "$spargeRad*sin($ang3)"; +z3neg #calc "-1.0*$z3"; +x4 0.0; +z4 0.0219; +z4neg -0.0219; + + + +//********************************* +//intensity 0.01; +//k_inlet #calc "1.5 * Foam::pow(($uSupVel * Foam::pow($ArbyAs, 2)), 2) * Foam::pow($intensity, 2)"; +intensity 0.02; +k_inlet #calc "1.5 * pow($uSupVel * $intensity, 2)"; +//eps_gas_inlet #calc "0.09 * Foam::pow($k_inlet, 1.5) / (($DiaBcol / $ArbyAs) * 0.07)"; +eps_gas_inlet #calc "pow(0.09,0.75) * pow($k_inlet,1.5) / ($DiaBcol / $ArbyAs * 0.07)"; +//eps_liq_inlet #calc "0.09 * 1000 * Foam::pow($k_inlet, 2) * 0.05 / 0.00089"; +eps_liq_inlet #calc "pow(0.09,0.75) * pow($k_inlet,1.5) / ($DiaBcol / $ArbyAs * 0.07)"; +//omega_liq_inlet #calc "1000 * $k_inlet * 0.05 / 0.00089"; +omega_liq_inlet #calc "pow(0.09,-0.25) * pow($k_inlet,0.5) / ($DiaBcol / $ArbyAs * 0.07)"; +//************************************ diff --git a/tests/io/test_read_global_vars.py b/tests/io/test_read_global_vars.py index f19f8eee..9380e128 100644 --- a/tests/io/test_read_global_vars.py +++ b/tests/io/test_read_global_vars.py @@ -122,3 +122,20 @@ def test_read_global_vars_putida(): abs(globalVars_dict["z3"] - 0.0219 * np.sin(67.5 * np.pi / 180)) < 1e-12 ) + + +def test_read_global_vars_putida_non_calc(): + """ + Test for reading content of `constant/globalVars` for the Putida case with direct references + """ + case_folder = os.path.join(Path(__file__).parent, "putida_test_non_calc") + # Read globalVars from case_folder path + globalVars_dict = read_global_vars(case_folder=case_folder, cross_ref=True) + + assert abs(globalVars_dict["ang1"] - 22.5 * np.pi / 180) < 1e-12 + assert ( + abs(globalVars_dict["z3"] - 0.0219 * np.sin(67.5 * np.pi / 180)) + < 1e-12 + ) + assert abs(globalVars_dict["f_O2"] - 1.0) < 1e-12 + From b668a738a01072b0e3e73800f56e755d7cf93894 Mon Sep 17 00:00:00 2001 From: Malik Hassanaly Date: Mon, 30 Mar 2026 15:03:25 -0600 Subject: [PATCH 2/3] update version and deploy --- bird/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bird/version.py b/bird/version.py index a1dc9db8..6365d58c 100644 --- a/bird/version.py +++ b/bird/version.py @@ -1,3 +1,3 @@ """Bio reactor design version""" -__version__ = "0.0.54" +__version__ = "0.0.55" From 515662a439c6a14ad5b8bca529477fee73c1208f Mon Sep 17 00:00:00 2001 From: Malik Hassanaly Date: Mon, 30 Mar 2026 15:16:56 -0600 Subject: [PATCH 3/3] lint --- tests/io/test_read_global_vars.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/io/test_read_global_vars.py b/tests/io/test_read_global_vars.py index 9380e128..19935473 100644 --- a/tests/io/test_read_global_vars.py +++ b/tests/io/test_read_global_vars.py @@ -138,4 +138,3 @@ def test_read_global_vars_putida_non_calc(): < 1e-12 ) assert abs(globalVars_dict["f_O2"] - 1.0) < 1e-12 -