Skip to content

Commit

Permalink
Merge pull request #87 from NREL/bsd_cal_tut
Browse files Browse the repository at this point in the history
Readable and labelled figures for the doc+ inverse model case upload
  • Loading branch information
malihass authored Jan 17, 2025
2 parents 8af4eb9 + e02e845 commit f4b7c67
Show file tree
Hide file tree
Showing 112 changed files with 5,058 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Bio reactor design version"""

__version__ = "0.0.15"
__version__ = "0.0.16"
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_cal_binary_corner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_cal_binary_prop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_cal_ternary_corner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_cal_ternary_prop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_opt_binary_corner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_opt_binary_prop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_opt_ternary_corner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/calibration/tutorial_bsd/Surr_opt_ternary_prop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/calibration_bsd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Generate the target data by running
This creates a folder ``data/`` with the file ``target_n_3_br_0.5_cr_0.5.npz`` and ``target_n_2_br_1.6_cr_2.0.npz``

The numerical model is always a binary breakup and coalescence model with adjustable breakup and coalescence rate. To avoid breakup or coalescence runaway, we ensure that breakup rate is close to the coalescence rate. Specifically, the coalescence rate `Cr` varies in the interval `[0.02, 2]`. A breakup rate factor `Bf` varies in the interval [`0.8, 1.1]` and the breakup rate `Br = Bf Cr`. This ensures that the breakup rate and coalescence rate are close to one another, thereby avoiding breakup and coalescence runaway.
The numerical model is always a binary breakup and coalescence model with adjustable breakup and coalescence rate. To avoid breakup or coalescence runaway, we ensure that breakup rate is close to the coalescence rate. Specifically, the coalescence rate `Cr` varies in the interval `[0.02, 2]`. A breakup rate factor `Bf` varies in the interval `[0.8, 1.1]` and the breakup rate `Br = Bf Cr`. This ensures that the breakup rate and coalescence rate are close to one another, thereby avoiding breakup and coalescence runaway.

Each simulation (target and from the numerical model) uses a timeste `dt = 0.01s` and the simulations are run for 150s to reach statistical stationarity and allow for sufficient averaging of the BSD. Since each forward simulation is expensive (~30s on a M1 Mac), a surrogate needs to be constructed.

Expand Down
6 changes: 0 additions & 6 deletions fixFormat.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
source .github/linters/formatting.sh

format .
#blockCyclindricalMeshing
#format inhomogeneousBC
#format spiderSparger
#format conditionalMean
#format computeQoI
#format process_geom

42 changes: 42 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/CO2.gas
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object CO2.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];

internalField uniform 0.0;

#include "${FOAM_CASE}/constant/globalVars"

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value uniform $f_CO2;
}

outlet
{
type zeroGradient;
}

walls
{
type zeroGradient;
}
}

// ************************************************************************* //
41 changes: 41 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/CO2.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object CO2.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.0;

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value $internalField;
}

outlet
{
type zeroGradient;
}

walls
{
type zeroGradient;
}
}

// ************************************************************************* //
42 changes: 42 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/N2.gas
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object N2.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];

internalField uniform 1.0;

#include "${FOAM_CASE}/constant/globalVars"

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value uniform $f_N2;
}

outlet
{
type zeroGradient;
}

walls
{
type zeroGradient;
}
}

// ************************************************************************* //
41 changes: 41 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/T.gas
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object T.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField uniform 273.15;

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value $internalField;
}

outlet
{
type zeroGradient;
}

walls
{
type zeroGradient;
}
}

// ************************************************************************* //
41 changes: 41 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/T.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object T.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField uniform 287.15;

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value $internalField;
}

outlet
{
type zeroGradient;
}

walls
{
type zeroGradient;
}
}

// ************************************************************************* //
49 changes: 49 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/U.gas
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volVectorField;
object U.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

#include "${FOAM_CASE}/constant/globalVars"

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
//type flowRateInletVelocity;
//massFlowRate $mflowRateGas;
//rho thermo:rho.gas;
//value $internalField;
type fixedValue;
value uniform (0 $uGasPhase 0);
}

outlet
{
type pressureInletOutletVelocity;
phi phi.gas;
value $internalField;
}

walls
{
type slip;
}
}

// ************************************************************************* //
49 changes: 49 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/U.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2;
format ascii;
class volVectorField;
object U.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

#include "${FOAM_CASE}/constant/globalVars"

internalField uniform (0 $uLiqPhase 0);

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
//type flowRateInletVelocity;
//massFlowRate $mflowRateLiq;
//rho thermo:rho.liquid;
//value $internalField;
type fixedValue;
value uniform (0 $uLiqPhase 0);
}
outlet
{
type pressureInletOutletVelocity;
phi phi.liquid;
value $internalField;
}
walls
{
type noSlip;
}
}


// ************************************************************************* //
42 changes: 42 additions & 0 deletions papers/co2_model/cases/breakup_17_mesh1_opt/IC/0/Ydefault.gas
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
object Ydefault.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 0 0 0 0];

internalField uniform 0.0;

boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"

inlet
{
type fixedValue;
value uniform 0.0;
}

outlet
{
type zeroGradient;
}

walls
{
type zeroGradient;
}
}


// ************************************************************************* //
Loading

0 comments on commit f4b7c67

Please sign in to comment.