Next Article in Journal
Influence of a Modified Procedure of Joining Ceramic Head and Adapter Sleeve on the Stem Taper in Revision: An Experimental Study
Next Article in Special Issue
Regression Metamodel-Based Digital Twin for an Industrial Dynamic Crossflow Filtration Process
Previous Article in Journal
FEA-Based Stress–Strain Barometers as Forecasters for Corneal Refractive Power Change in Orthokeratology
Previous Article in Special Issue
Architectural and Technological Improvements to Integrated Bioprocess Models towards Real-Time Applications
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Automatic Method for Generation of CFD-Based 3D Compartment Models: Towards Real-Time Mixing Simulations

by
Johan Le Nepvou De Carfort
1,†,
Tiago Pinto
2 and
Ulrich Krühne
1,*
1
Process and System Engineering Center, Department of Chemical and Biochemical Engineering, 2800 Kongens Lyngby, Denmark
2
R/D Department, UNIBIO A/S, 4000 Roskilde, Denmark
*
Author to whom correspondence should be addressed.
Current address: Sølvtofts Plads, Building 228A, 2800 Kongens Lyngby, Denmark.
Bioengineering 2024, 11(2), 169; https://doi.org/10.3390/bioengineering11020169
Submission received: 16 January 2024 / Revised: 2 February 2024 / Accepted: 4 February 2024 / Published: 9 February 2024
(This article belongs to the Special Issue The Role of Digital Twins in Bioprocessing)

Abstract

:
This article aims to develop a method to automatically generate CFD-based compartment models. This effort to simplify mixing models aims at capturing the interactions between material transport and chemical/biochemical conversions in large-scale reactors. The proposed method converts the CFD results into a system of mass balance equations for each defined component. The compartmentalization method is applied to two bioreactor geometries and was able to replicate tracer mixing profiles observed in CFD simulations. The generated compartment models were successfully coupled with, a simple Monod-type biokinetic model describing microbial growth, substrate consumption and product formation. The coupled model was used to simulate a four-hour fermentation in a 190 L reactor and a 10 m 3 reactor. Resolving the substrate gradients had a clear impact on the biokinetics, increasing with the scale of the reactor. Moreover, the coupled model could simulate the fermentation faster than real-time. Having a real-time-solvable model is essential for implementations in digital twins and other real-time applications using the models as predictive tools.

Graphical Abstract

1. Introduction

Large-scale bioreactors are challenging systems to model due to the multiple phenomena taking place during fermentation. Bioreactor models should account for mass transport limitations (due to gas–liquid mixing and interfacial mass transfer) taking place at larger scales as well as chemical and biochemical conversions. Although biological growth typically occurs over a timescale of hours/days, biochemical reactions taking place inside the cell such as enzymatic reactions and allosteric regulation typically occur over a timescale of milliseconds/seconds [1,2,3]. Moreover, the consumption of substrates can occur on a timescale lower than the fluid circulation time in large-scale bioreactors, leading to the formation of spatial concentration gradients. To capture the interactions between material transport and chemical/biochemical conversions, models should include both phenomena. Computational fluid dynamics (CFD) offers a fine resolution of liquid/gas–liquid hydrodynamics in various fermentation equipment but is computationally expensive and requires long computational times to simulate short periods of equipment operating time [4,5]. This is due to the fine spatial discretization required to solve the mass and momentum equations. The high computational demand of CFD simulations is a clear limitation for applications where real-time model evaluations are required, e.g., in the case of model-based monitoring and control and implementation in digital twins. The computational demand and the difficult coupling with chemical reactions make it infeasible to simulate entire fermentations using CFD. The forecasting of large-scale fermentation processes can be used for model predictive control, where measurements of the process are used as inputs to the predictive model, and the predictions are used to actuate process accordingly to achieve optimal performance. For that purpose, simplified mixing models are required to include spatial heterogeneity to the real-time models.
An alternative approach to modelling material transport is through compartment modelling, a network of ideally mixed compartments with given volumes and exchange flowrates [6]. This approach is less computationally demanding, as the flow between compartments are given as an input to the model, and the mass and momentum balances are not included (avoiding the fine CFD discretization). The traditional approach to compartment modelling is to define the compartment network manually [6,7,8,9,10,11]. This step introduces a large amount of uncertainty to the model as the volumes and exchange flowrates are arbitrarily chosen to fit experimental data or based on a priori knowledge of the mixing behaviour of the system. More recent work aims at utilizing results from CFD simulations to formulate the compartment volumes and exchange flowrates [12]. Some articles use the CFD results to determine the exchange flowrates between manually set compartments [12,13,14,15,16,17], while others also use the CFD results to identify a 2D compartment network [18,19,20].
In this article, the proposed method aims at generating CFD-based three-dimensional compartment models applicable to any type of vessel geometry. The approach focuses on extracting the CFD results on a Cartesian grid, used as the basis of the compartment model. An additional step is added to the method, to enforce mass continuity of the generated compartment model. The developed method is then applied to two tank geometries, and the resulting compartment models are coupled with a Monod-type biokinetic model to simulate a full fermentation process and resolve potential concentration gradients originating from the top feeding of substrate.

2. Materials and Methods

2.1. Generating the Compartment Models

2.1.1. Interpolation

The proposed method uses the results from a CFD simulation to automatically generate a uniformly gridded compartment model of the system with the resolution of the grid set by the user. To interpolate the CFD results on the defined grid, the CFD data are exported into a table containing cell centre data (x, y, and z positions; u, v, and w velocity components; eddy viscosity; and the volume of the element) with a row representing each CFD element. The geometric bounds are determined from the minimum and maximum values of the x, y, and z positions, and a Cartesian grid is defined within these bounds. The resolution of the grid in the three spatial dimensions is set by the user. For each grid cell, the velocity components are determined as the volume-weighted velocity average of the CFD elements present within the grid element. If the grid cell does not contain any CFD elements, the value is set to NaN to identify the specific geometry of the reactor. For the case where a grid cell inside the reactor does not contain any CFD elements (for the case of fine gridding relative to the CFD mesh) the velocity components are determined as the average value of the velocities in adjacent grid cells.

2.1.2. Enforcing Continuity

The first step is to convert the interpolated velocities in the grid into a staggered velocity grid, where the velocity between the grid elements is represented normal to each face (Figure 1). This representation is used to determine the velocities in and out of each grid cell, and will later be used to compute the flowrates between the grid cells. For the case of incompressible fluids, the continuity is ensured by forcing the divergence of the flow to zero at all points (Equation (1)) to avoid sink and source points in the velocity vector field [21].
· V = 0
Here, the Gauss–Seidel method [22] is used to solve the continuity equation in a discretized space (Equation (2)) on the staggered velocity grid.
( u i + 1 , j , k u i , j , k ) d x i + ( v i , j + 1 , k v i , j , k ) d y j + ( w i , j , k + 1 w i , j , k ) d z k = 0
where u i , j , k , v i , j , k , and w i , j , k are the staggered velocities in the x, y, and z directions in grid cell [ i , j , k ] in m s and d x i , d y j , and d z k represent the dimensions of grid cell [ i , j , k ] in the x, y, and z directions in m .
The algorithm (Algorithm 1) loops through all grid cells changing the velocities around the grid cell by a factor of the divergence to solve for the continuity. If the divergence is positive, the velocities are forced in towards the cell, and if the divergence is negative, the velocities are forced outwards. This is repeated until the resulting divergence in the grid is lower than the tolerance level set by the user. In this work, all the results are generated with a tolerance for the root mean square of the divergence in all grid cells of 10 6 . This usually requires a few thousand iterations for the cases presented here. A relaxation factor is used to facilitate the convergence of the algorithm, which was defined as 1.7 (strong over-relaxation). However, this value may be adjusted (between 0 and 2) by the user if the algorithm does not converge. The relaxation factor is the factor added to the change in variable values between iterations. A lower relaxation factor leads to a slower but a more stable convergence.
To identify the geometric bounds of the simulated tank, a variable s is defined in each grid cell, which takes a value of 0 if the velocity in the grid cell is not a number (NaN) and a value of 1 if the velocity is different from NaN. This will give a value of one to all grid cells inside the fluid domain and a value of 0 to all grid cells outside the fluid domain. The NaNs originate from the interpolation step, where if the grid cell does not contain any CFD element and is not filled, the velocity values in that grid cell will be NaN. The staggered velocities at the geometric boundaries of the tank are set to zero, ensuring no flow going in or out of the simulated fluid domain. The s variable is used when solving the continuity equation to account for cells and the boundaries of the tank and make sure the velocity at the tank walls remains zero.
Algorithm 1 Solving the continuity equation in all grid cells
  • n 0
  • while  n > i t r  do
  •     for i = 1 to n x  do
  •         for j = 1 to n y  do
  •            for k = 1 to n z  do
  •                if  s i , j , k = 1  then
  •                     d ( u i 1 , j , k u i , j , k ) / Δ x + ( v i , j 1 , k v i , j , k ) / Δ y + ( w i , j , k 1 w i , j , k ) / Δ z
  •                     s n s i 1 , j , k + s i + 1 , j , k + s i , j 1 , k + s i , j + 1 , k + s i , j , k 1 + s i , j , k + 1
  •                     u i , j , k u i , j , k + r ( d / s n ) s i 1 , j , k
  •                     u i + 1 , j , k u i + 1 , j , k r ( d / s n ) s i + 1 , j , k
  •                     v i , j , k v i , j , k + r ( d / s n ) s i , j 1 , k
  •                     v i , j + 1 , k v i , j + 1 , k r ( d / s n ) s i , j + 1 , k
  •                     w i , j , k w i , j , k + r ( d / s n ) s i , j , k 1
  •                     w i , j , k + 1 w i , j , k + 1 r ( d / s n ) s i , j , k + 1
  •                end if
  •            end for
  •         end for
  •     end for
  •      n n + 1
  • end while

2.1.3. Converting Velocity Field to Volumes and Flows

The final step of the conversion from CFD to compartment model is to translate the continuity-corrected staggered velocities into flowrates by multiplying the velocity values with the area of the corresponding face (Equations (3)–(5)). Knowing that all grid cells are rectangular cuboids per definition, the area of the faces can be calculated as the product of the size of the cell in the two spatial dimensions of the face.
F x i , j , k = u i , j , k d y j d z k
F y i , j , k = v i , j , k d x i d y j
F z i , j , k = w i , j , k d x i d y j
In the same way, the volume of each grid cell can be calculated as the product of the size of the grid cells in the 3 spatial dimensions (Equation (6)).
V i , j , k = d x i d y j d z k
where V i , j , k is the volume of the grid cell [ i , j , k ] . The entire conversion from the CFD table to the flow and volume matrices of the compartment model is implemented in Python as a single processing step requiring the following inputs:
  • Grid resolution ( n x × n y × n z );
  • Relaxation factor for the Gauss–Seidel method (default: 1.7);
  • Tolerance level for the RMS of the divergence (default: 10 6 ).

2.2. Solving the System of Mass Balances

Knowing the volume of the grid cells, as well as the flowrates between adjacent cells, a system of material balances is formulated. For each grid cell, the direction of the flows is identified, in order to build the individual material balance equations. If the flow is leaving the grid cell, it is considered in the outgoing term of the balance equation, where it is accounting for material leaving the cell, whereas flows entering the grid cell are considered in the incoming term, accounting for the material entering the cell from adjacent cells. So, the amount of material leaving each grid cell due to convective transport OUT i , j , k can be expressed as the of sum of outgoing flows multiplied by the material concentration in the cell and the amount of material entering each grid cell due to convective transport IN i , j , k as the sum of the incoming flows multiplied by the material concentration in the corresponding adjacent cell (Equations (7) and (8)).
IN i , j , k = a A F a C a
With A being all adjacent cells with flowrates entering the grid cell [ i , j , k ] , F a being the flowrate entering the grid cell from the adjacent cell a, and C a being the material concentration in the adjacent cell a.
OUT i , j , k = b B F b C i , j , k
With B being all adjacent cells with flowrates leaving the grid cell [ i , j , k ] , F b the flowrate leaving the grid cell to the adjacent cell b and C i , j , k being the material concentration in the grid cell [ i , j , k ] .
Due to the turbulent nature of the investigated system, eddy diffusivity is expected to have a significant impact on the total mass transport. Turbulent mass transport should therefore also be included in the compartment model. Mass diffusion in turbulent flow can generally be expressed as Equation (9) [21]. For the case of highly turbulent flows, the turbulent diffusion becomes significantly larger than the molecular diffusion, making the molecular diffusion negligible (Equation (10)).
J i = ρ D m , i + ρ μ t S c t C i
J i = ρ μ t S c t C i
With J i being the diffusion flux of component i, ρ the density of the liquid, D m , i the kinematic diffusion coefficient of component i in the liquid, μ t the eddy viscosity, C i the spatial concentration gradient of component i and S c t the turbulent Schmidt number, defined as the ratio between eddy viscosity and eddy diffusivity. Experimental and numerical studies have shown that the turbulent Schmidt number can vary between 0.2 and 1.3 depending on the investigated system [23,24]. A value of 0.9 is chosen for this study, in agreement with the default value from the software ANSYS CFX used for the CFD simulations. This is to make the results between the CFD and generated CMs comparable; however, further tuning of the turbulent Schmidt number may be required to fit other systems.
The turbulent diffusion term is implemented in a discretized form (Equation (11) using the eddy viscosity values interpolated from the CFD and a specified turbulent Schmidt number.
J i j = ρ ( μ t , i + μ t , j ) / 2 S c t C j C i Δ x
With J i j being the diffusion flux of the transported component from cell i to cell j, μ t , i and μ t , j the eddy viscosity in cells i and j, C i and C j the concentration of the transported component in cells i and j, and Δ x the distance between the two grid cell centres. The total turbulent diffusion from cell i to cell j can be determined by multiplying the resulting diffusion flux by the area between the two cells. Finally, the turbulent diffusion between all adjacent cells is added to the component mass balance (Equation (12)).
T U R B i , j , k = e E J e i , j , k A e / i , j , k
where T U R B i , j , k is the net amount of transported material into the grid cell [ i , j , k ] due to turbulent diffusion, E represents all adjacent active grid cells, J e i is the diffusion flux of the transported compound from the adjacent grid cell e to the grid cell [ i , j , k ], and A e / i , j , k is the surface area between the adjacent grid cell e and the grid cell [ i , j , k ].
One last term S is included in the compartment model material balance, accounting for the sources of material in the grid cells. This term includes component reactions as well as source or sink points in the simulation. For example, a source point can be defined where material is added to the grid cell with a given rate. The total mass balance for a component c in cell [ i , j , k ] is shown in Equation (13).
d C i , j , k d t = I N i , j , k O U T i , j , k + T U R B i , j , k + S i , j , k
The resulting system of material balance equations is implemented in Python and Julia to compare the performance of the two programming languages and to test their respective ODE solvers. For both programming languages, the script takes the generated compartment model object created in the previous step, and the mass balance equations are automatically constructed (using the above-described method, Section 2.2), and solved. The fastest solvers were chosen from the set of tested solvers; however, further work can focus on the performance of different numerical ODE solvers for this specific type of problem, to further reduce the computational time. The solvers used in this analysis are presented here: In Python, the system of equations is solved using the “solve_ivp()” function from the “Scipy” package with the “LSODA” solver. In Julia, the system of equations is solved using the “DifferentialEquations.jl” and “Sundials.jl” packages with the “CVODE_Adams()” solver. The two implementations in Python and Julia yielded systematically identical results. Therefore, only the results from the Julia simulations are presented in further results, unless stated otherwise.

2.3. Case Study: Stirred Tanks

The proposed method is applied on two reactor geometries (16 L and 190 L stirred tank reactors). The two studied tank geometries are summarized in Table 1. For each reactor geometry, a structured mesh is created using the ANSYS ICEM meshing tool with 521,344 elements for the 16 L reactor and 430,858 elements for the 190 L reactor (half geometry). The purpose of the case study is to compare the CFD simulations with the compartment model simulations. Therefore, no further validations of the CFD models are performed.
The CFD models of the two reactors are implemented in ANSYS CFX using the sliding mesh approach to model the impeller rotation. The fluid is modelled using the Eulerian approach as a continuous fluid with the properties of water and using the k ϵ model for the turbulence modelling. The tank walls as well as the impeller and shaft surfaces are defined as no slip walls, and the top surface as a free slip wall to mimic the free surface of the fluid where the air drag is assumed negligible, and the surface shape assumed constant. Buoyancy is not accounted for in this study. The “High Resolution” advection scheme is applied together with a second-order backward Euler transient scheme. The regions surrounding the impellers are defined as rotating domains with a rotational velocity of 300 RPM. Transient simulations are performed for 40 s simulation time with a timestep of 0.001 s to ensure a fully developed flow and RMS Courant numbers below 10. To make sure the simulation had reached steady flow profiles, the impeller torque as well as the velocity values at multiple points in the tank are monitored during the simulation, and steady profiles were reached after 20 s for the 16 L reactor and after 5 s for the 190 L reactor. It should be noted that the 190 L tank show signs of steady oscillation due to the large scale turbulent nature of the studied system. Here, only the time-average velocity fields were used for further mixing studies; however, turbulent oscillations are known to contribute to a faster mixing, and should therefore be compensated for when choosing the turbulent Schmidt number. After the 40 s simulation time, the time-average velocity field of the last 15 s is used for the generation of the compartment model and to run a frozen flow field CFD simulation of mixing tracer injected as a pulse between 0 and 1 s at a source point in the top of the tank (Figure 2). The tracer is simulated as an additional variable governed by a species transport equation neglecting kinematic diffusion.
A similar simulation is performed with the generated compartment model with the same tracer injection pulse and rate and position in the top of the tank. The performance of the generated compartment models in reproducing material mixing can be assessed by comparing the resulting tracer concentration profiles from the CM and the CFD. The tracer concentrations are shown in dimensionless form, given by Equation (14) [25].
C i ( t ) = C i ( t ) C 0 C C 0
where C ( t ) is the dimensionless tracer concentration, C ( t ) is the tracer concentration, C 0 is the initial tracer concentration, and C is the final/equilibrium tracer concentration. The degree of homogeneity in the tank can also be described as the variance σ 2 between the measured and final/equilibrium concentration for all monitor points N as described in Equation (15) [25].
σ 2 ( t ) = i N ( C i ( t ) 1 ) 2 N
When simulating geometries with rotational periodicity or symmetries, the systems can be modelled as sections assuming theses symmetries. To showcase the ability of the presented method to generate a full compartment model from only a section of a CFD simulation, the 190 L tank is modelled as a half geometry, assuming rotational periodicity along the rotational axis. The CFD results are then mirrored along the symmetry axis to recreate the full geometry and generate a compartment model of the entire reactor. In this case, a secondary source point is added to the compartment model simulation to account for the symmetry of the tracer injection in the CFD simulation.

2.4. Coupling with a Biokinetic Model

To showcase the ability of the model to simulate the mixing in a reactor coupled with reactions, a simple Monod-type biokinetic model is implemented in the source term of the ODE system to simulate microbial growth in the tank, as well as substrate consumption and product formation. Such “blackbox” biokinetic models are often used to describe the microbial growth kinetics with only a handful of parameters and variables [26,27,28,29]. The ODE system is expanded to 3 components: biomass X, substrate S, and product P. The rate of formation of each component is described in Equations (16)–(19).
μ = μ m a x S K S + S
r X = μ D X 1 S + 1 X
r S = μ Y S X X
r P = α K P , 1 2 S 3 + K P , 1 S K p , 2 + S X
where r X , r S , and r P are the production rates of the biomass, the substrate, and the product, respectively; μ is the specific growth rate of the simulated microorganism; μ m a x is the maximum specific growth rate; K S is the substrate limitation constant (or half-velocity constant); D X is the death rate of the microorganism; Y s x is the biomass to substrate yield; α is the product to biomass yield; K p , 1 is the substrate inhibition on product formation constant; and K p , 2 is the substrate limitation on product formation constant. The values of the biokinetic parameters are presented in Table 2. The biokinetic model is first solved on its own as a benchmark to compare with the results from the compartment model implementation. The biokinetic model alone is referred to as the 0D model. The same biokinetic parameters and initial values are implemented in the compartment model and solved for 4 h of bioreactor operating time. The impact of reactor scale on gradient formation is investigated by applying the compartment model to the 190 L tank and a scaled up version of the same reactor geometry of 10 m 3 . The impeller rotational speed in the large tank is reduced to 100 RPM to maintain comparable impeller tip speeds in both reactors. For this case study, the reactors are operated as batch during the first hour of fermentation. After the first hour, substrate is added from the top. It is assumed that the substrate is added as a highly concentrated solution, and the working volume of the tank is constant. During the fed-batch operation, 0.05 g · m 3 · s 1 substrate is added to the tank from the top.

3. Results

3.1. Case Study Mixing Time

The CFD simulations are performed in parallel on an Intel XeonGold6226R, 64 GB, 32 core computer, and the resulting time-averaged flow fields are used to generate the compartment models. All compartment model simulations are performed on a laptop computer (Intel i9, 32 GB) on a single core. This illustrated the simplicity of the generated compartment models relative to the CFD models, requiring much less computer power. The dimensionless simulation time of each simulation is reported in Table 3. Dimensionless simulation time is defined as the ratio between the wall clock time and the simulated time. A value above one will indicate the simulation is slower than real-time, and a value below one will indicate that the simulation is faster than real-time and can be used for forecasting. For each geometry, two compartment models are generated with grid resolutions of (35 × 60 × 35) and (65 × 100 × 65). A higher discretization on the y-axis is chosen to fit the overall geometry, and have similar spatial resolution in the three dimensions. Velocity magnitude profiles of the CFD results and the generated compartment models are shown in Figure 3. The tracer-mixing experiments were performed both with the CFD models, and the generated compartment models for the two reactor geometries and the concentration profiles at the different monitor points are reported in Figure 4. For the 16 L tank, no overshoot in the tracer concentration is observed at the four monitor points. The compartment model is able to reproduce similar concentration profiles, except for monitor point 1 (located in the top of the tank), which is overestimated by the compartment model.
This could be explained by the numerical error related to using a larger element size for the simulation. Also, the CFD results for monitor point 3 show a strong oscillation, which is not present in the results from the compartment model. As both the CFD and CM simulations were performed with frozen flow fields, the oscillations are not an artefact of the turbulent fluctuations in the flow. The oscillations could rather be explained by a finer resolution of small vertices in the CFD. Overall, both the CFD and the CM predict a mixing time around 18 s. For the 190 L tank, a clear overshoot of the tracer concentration is observed in the top of the tank. This is expected in a larger stirred tank with multiple impellers, where the axial mixing can be quite poor. Here, the CM is in good agreement with the CFD model and is able to reproduce similar tracer concentration profiles. The overall mixing time is predicted around 25 s. The tracer concentration profiles on the xy-plane at different time points are shown in Figure 5 and Figure 6. Similar tracer concentration profiles are observed between the results from the CFD and CM simulations. It can thus be concluded that the compartment model is able to predict mixing times accurately as well as the dynamic concentration profiles during mixing. Further discretization study can help to determine the optimal grid resolution giving the fastest simulation with satisfactory results. A set of compartment models with various resolutions are generated for each tank geometry, and for each compartment model, the tracer mixing simulation is performed. The resulting mixing profiles are shown in Figure 7 as the degree of homogeneity log ( σ 2 ) . The CFD simulations systematically yielded lower mixing times and the coarser the grid, the slower the mixing. Interestingly, this goes against the idea that coarse discretization leads to higher numerical diffusion and therefore faster mixing. Overall, the compartment models were all able to predict similar mixing times ( ± 4 s). It can also be noted that the homogeneity profiles in the first 5 s of simulation are quite different for the different grid resolutions, for the case of the 190 L tank. Here, low resolution grids are not able to accurately resolve the first few seconds of the mixing while providing satisfactory homogeneity profiles only after the first 5 s. In the presented results, the velocity field is considered frozen both for the CFD and CM simulations. The time-average flow field was selected for further study, neglecting the turbulent time dependent fluctuations in the flow. Transient fluctuations in the flow are known to have an impact on the mixing of dilute species, typically reducing the mixing time. Further work should focus on including the time dependent fluctuations of the flow field into the generated compartment models to better reproduce the transient mixing behaviour of the system.
The generated compartment models were able to reproduce numerical mixing simulations in good agreement with the results from the pure CFD simulations. The fine resolution of CFD meshes are important to resolve flow phenomena such as velocity gradients and turbulence. However, reducing the resolution of the discretization does not seem to have a significant impact on the overall mixing profiles, thus making these coarser models applicable for mixing simulations that do not require to solve the fluid dynamics.
Moreover, the compartment models greatly reduced the computational complexity of the simulation, allowing for faster model evaluations, in some cases faster than real-time (CM Julia ( 35 × 60 × 35 ), Table 3). This makes the models applicable in solving computationally expensive problems, such as optimisations and sensitivity analysis, and integration into multi-scale models for plant-wide and production line modelling. The fast model evaluations could also allow the model to be used in real-time applications such as digital twins. The fast model evaluations, as well as the ability to use customable stiff numerical solvers makes it possible to solve for multiple species and implement other models such as chemical or biochemical reaction models. This is investigated further in the following section.

3.2. Simulation of a Biological Process

A (30 × 40 × 30) grid compartment model is generated for the 190 L and 10 m 3 tanks based on the CFD results. As described in Section 2.4, the system of ODEs is expanded to three components, and the biokinetic model (Equations (16)–(19)) is implemented in the respective source terms of the material balances, in all grid elements. The coupled system is used to simulate a 4 h fermentation, and the resulting concentration profiles are presented in Figure 8. Here, 4 h of simulation time was enough to see the overall dynamic of the process and assess the performance of the compartment models; however, real fermentations typically take a longer time.
During the batch operation, where substrate is not supplied, the system is expected to remain homogeneous and follow the 0D fully homogeneous model. When switching to fed-batch mode, where substrate is supplied from the top of the tank, the compartment models begin to exhibit substrate gradients and the average concentration profiles start deviating from the 0D model. The 10 m 3 shows a larger deviation from the 0D model compared to the 190 L tank, which is expected due to the larger mixing time in the large tank. A wider distribution of substrate concentrations can also be observed for the 10 m 3 tank. This is observed from the width of the blue region around the substrate concentration curves (Figure 8) representing the range of concentrations observed in the tank. The greater substrate gradients observed in the large tank explain the slower growth and slower product formation, due to the kinetic behaviour of the microorganism (inhibition and limitation terms in Equations (16) and (19)). The 10 m 3 reactor shows a 12% drop in product formation after four hours relative to the 0D model. This value is specific to the implemented biokinetic model, and it should be noted that the magnitude of the impact of gradients highly depends on the investigated microorganism and its sensitivity to changing surroundings [1].

4. Discussion

The results presented in this article showcased the ability of the developed compartment models to perform dynamic mixing simulations based on CFD results and replicate the mixing behaviour. Only solving the mass balance equations, the compartment models are less computationally demanding compared to the CFD models and can be solved much faster (2200 times faster than CFD with the ( 35 × 60 × 35 ) grid compartment model solved in Julia). This allows for coupling with more complex reacting systems, with more components and stiff reaction kinetics. In Section 3.2, a three-component biological system coupled to the mixing model was used to simulate 4 h of fermentation in 2.08 h wall clock time. Having the ability to simulate entire fermentation processes, the models can be used to predict gradients and how the mixing will affect the entire process. This is useful for exploring and optimizing tank design and operation to minimize gradients and extreme exposures near inlets. For instance, one can investigate the pH surrounding a base inlet or substrate gradients based on the feeding and monitoring strategies. As observed in the results Section 3.2, larger tanks are prone to slower mixing times, and will exhibit larger gradients. It is therefore important to consider the impact of mixing on the process when designing large scale equipment. Moreover, the compartment models can be used to identify zones in the reactors operating under different conditions, and use the results to design scale-down experiments of the large tank and replicate the large scale gradients in a lab-scale setup. The developed compartment models can also be used to predict the behaviour of a fermentation based on measurements of the system and the real-time solutions provided by the models. For example, the models can be used to early diagnose failed batches, or for model-based monitoring and control of the process.
It should be noted that the generated compartment models are based on a single time-averaged CFD solution. The compartment models will therefore have a fixed volume and fixed flowrates between compartments. On that note, the hereby presented method using a frozen flow field would be more accurate for systems with low fluctuations in the flow field, and the error between the presented method and the physical is expected to increase for systems with larger fluctuations in the flow. Large flow oscillations typically occur in the transition flow regime between laminar and fully turbulent flows. Further implementation of transient fluctuations in the flow fields will therefore provide more realistic results, especially in large-scale reactors where oscillating flow patterns may occur. With regards to the constant volume, the compartment models can only be used to simulate batch, quasi-batch, and continuous operations. Quasi-batch refers to a fed system with assumed constant volume, for example a batch fermentation with base addition for pH control, or aeration. Simulating a fed batch with changing volume may be achieved by discretizing the volume change and provide multiple CFD results with different filling levels. A similar approach was performed in 2D in a previous work [30].
Due to the fixed flow in the compartment models, changes in the flow conditions (e.g., agitation, viscosity) will require new CFD input. A workaround is to produce a range of CFD results at different conditions and create reduced-order models to describe the flow in the compartments as a function of the flow input parameters [31]. Further work may also focus on including the energy balance in each compartment to solve for the temperature.
Further expanding the automatic compartment model generation to account for multiphase systems will allow for simulating mass transfer in aerated fermentations and couple interfacial mass transfer limitations to the mixing and biokinetic models. Coupling with more advanced biological models may also be considered, for instance genome-scale models, to investigate the impact of the gradients on the metabolic regime of the microorganisms.

5. Conclusions

In this article, an automatic method for generating CFD-based compartment models is proposed and tested. Compartment models are generated for two tank geometries and used to perform dynamic mixing simulations. For both geometries, the compartment models yielded mixing times and profiles similar to the CFD simulations in a fraction of the time needed for a CFD simulation. The input parameters for the automatic method are discussed, and it is concluded that the grid resolution can have a significant impact on the results and should be selected with care. A 4 h fermentation was successfully simulated by coupling the generated compartment models with a simple biokinetic model, and the model was able to resolve concentration gradients and their impact on the overall process. This approach may also be used outside the scope of simulating bioprocesses to all stiff systems, where coupling of transport phenomena and reactions is required (e.g., chemical reactors, separation units).
The method was designed to be as generic as possible, and it can handle CFD results from any software with any type of geometry and mesh. The generated models can resolve heterogeneities and predict dynamic responses to changes in the process operating conditions in real time, making the generated models useful for a wide range of applications, such as design optimization, monitoring, and control as well as applications in digital twins.

Author Contributions

Conceptualization, J.L.N.D.C. and U.K.; methodology, J.L.N.D.C.; software, J.L.N.D.C.; validation, J.L.N.D.C., U.K. and T.P.; formal analysis, J.L.N.D.C.; investigation, J.L.N.D.C.; resources, T.P. and U.K.; data curation, J.L.N.D.C. and U.K.; writing—original draft preparation, J.L.N.D.C.; writing—review and editing, J.L.N.D.C., T.P. and U.K.; visualization, J.L.N.D.C.; supervision, T.P. and U.K; project administration, U.K.; funding acquisition, T.P. and U.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Technical University of Denmark and UNIBIO A/S.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
CFDComputational Fluid Dynamics
CMCompartment Model
NaNNot a Number
RMSRoot Mean Square
ODEOrdinary Differential Equation
RPMRotations Per Minute
0DZero Dimensional
2DTwo Dimensional
3DThree Dimensional

References

  1. Nadal-Rey, G.; McClure, D.D.; Kavanagh, J.M.; Cornelissen, S.; Fletcher, D.F.; Gernaey, K.V. Understanding gradients in industrial bioreactors. Biotechnol. Adv. 2021, 46, 107660. [Google Scholar] [CrossRef] [PubMed]
  2. Dai, X.; Zhu, M.; Warren, M.; Balakrishnan, R.; Patsalo, V.; Okano, H.; Williamson, J.R.; Fredrick, K.; Wang, Y.P.; Hwa, T. Reduction of translating ribosomes enables Escherichia coli to maintain elongation rates during slow growth. Nat. Microbiol. 2016, 2, 16231. [Google Scholar] [CrossRef] [PubMed]
  3. Balakrishnan, R.; Mori, M.; Segota, I.; Zhang, Z.; Aebersold, R.; Ludwig, C.; Hwa, T. Principles of gene regulation quantitatively connect DNA to RNA and proteins in bacteria. Science 2022, 378, eabk2066. [Google Scholar] [CrossRef] [PubMed]
  4. Spann, R.; Glibstrup, J.; Pellicer-Alborch, K.; Junne, S.; Neubauer, P.; Roca, C.; Kold, D.; Lantz, A.E.; Sin, G.; Gernaey, K.V.; et al. CFD predicted pH gradients in lactic acid bacteria cultivations. Biotechnol. Bioeng. 2019, 116, 769–780. [Google Scholar] [CrossRef] [PubMed]
  5. Haringa, C.; Tang, W.; Wang, G.; Deshmukh, A.T.; van Winden, W.A.; Chu, J.; van Gulik, W.M.; Heijnen, J.J.; Mudde, R.F.; Noorman, H.J. Computational fluid dynamics simulation of an industrial P. chrysogenum fermentation with a coupled 9-pool metabolic model: Towards rational scale-down and design optimization. Chem. Eng. Sci. 2018, 175, 12–24. [Google Scholar] [CrossRef]
  6. Nauha, E.K.; Kálal, Z.; Ali, J.M.; Alopaeus, V. Compartmental modeling of large stirred tank bioreactors with high gas volume fractions. Chem. Eng. J. 2018, 334, 2319–2334. [Google Scholar] [CrossRef]
  7. Bashiri, H.; Heniche, M.; Bertrand, F.; Chaouki, J. Compartmental modelling of turbulent fluid flow for the scale-up of stirred tanks. Can. J. Chem. Eng. 2014, 92, 1070–1081. [Google Scholar] [CrossRef]
  8. Bashiri, H.; Bertrand, F.; Chaouki, J. Development of a multiscale model for the design and scale-up of gas/liquid stirred tank reactors. Chem. Eng. J. 2016, 297, 277–294. [Google Scholar] [CrossRef]
  9. Moullec, Y.L.; Gentric, C.; Potier, O.; Leclerc, J.P. Comparison of systemic, compartmental and CFD modelling approaches: Application to the simulation of a biological reactor of wastewater treatment. Chem. Eng. Sci. 2010, 65, 343–350. [Google Scholar] [CrossRef]
  10. Wells, G.J.; Ray, W.H. Methodology for modeling detailed imperfect mixing effects in complex reactors. AIChE J. 2005, 51, 1508–1520. [Google Scholar] [CrossRef]
  11. Bisgaard, J.; Zahn, J.A.; Tajsoleiman, T.; Rasmussen, T.; Huusom, J.K.; Gernaey, K.V. General rights Data-based dynamic compartment model: Modeling of E. coli fed-batch fermentation in a 600 m3 bubble column. J. Ind. Microbiol. Biotechnol. 2023, 49, kuac021. [Google Scholar] [CrossRef]
  12. Bezzo, F.; Macchietto, S. A general methodology for hybrid multizonal/CFD models: Part II. Automatic zoning. Comput. Chem. Eng. 2004, 28, 513–525. [Google Scholar] [CrossRef]
  13. Spann, R.; Gernaey, K.V.; Sin, G. A compartment model for risk-based monitoring of lactic acid bacteria cultivations. Biochem. Eng. J. 2019, 151, 107293. [Google Scholar] [CrossRef]
  14. Liu, G.; Wilhite, B.A. A generalized zoning framework for development of CFD-based reduced-order compartment models. AIChE J. 2023, 69, e18063. [Google Scholar] [CrossRef]
  15. Rigopoulos, S.; Jones, A. A hybrid CFD-reaction engineering framework for multiphase reactor modelling: Basic concept and application to bubble column reactors. Chem. Eng. Sci. 2003, 58, 3077–3089. [Google Scholar] [CrossRef]
  16. Krychowska, A.; Kordas, M.; Konopacki, M.; Grygorcewicz, B.; Musik, D.; Wójcik, K.; Jędrzejczak-Silicka, M.; Rakoczy, R. Mathematical Modeling of Hydrodynamics in Bioreactor by Means of CFD-Based Compartment Model. Processes 2020, 8, 1301. [Google Scholar] [CrossRef]
  17. Delafosse, A.; Collignon, M.L.; Calvo, S.; Delvigne, F.; Crine, M.; Thonart, P.; Toye, D. CFD-based compartment model for description of mixing in bioreactors. Chem. Eng. Sci. 2014, 106, 76–85. [Google Scholar] [CrossRef]
  18. Tajsoleiman, T.; Spann, R.; Bach, C.; Gernaey, K.V.; Huusom, J.K.; Krühne, U. A CFD based automatic method for compartment model development. Comput. Chem. Eng. 2019, 123, 236–245. [Google Scholar] [CrossRef]
  19. Tarcsay, B.L.; Németh, S.; Chován, T.; Bárkányi, Á. Development of CFD based Compartment Models for Analysing High Risk Processes. Chem. Eng. Trans. 2022, 91, 487–492. [Google Scholar] [CrossRef]
  20. Massmann, T.; Kocks, C.; Parakenings, L.; Weber, B.; Jupke, A. Two-Dimensional CFD based compartment modeling for dynamic simulation of semi-batch crystallization processes in stirred tank reactors. Comput. Chem. Eng. 2020, 140, 106933. [Google Scholar] [CrossRef]
  21. Bird, R.B.; Stewart, W.E.; Lightfoot, E.N. Transport Phenomena, 2nd ed.; Elsevier: Amsterdam, The Netherlands, 2006. [Google Scholar]
  22. Seidel, L. Ueber die Berechnung der wahrscheinlichsten Werthe solcher Unbekannten, zwischen welchen Bedingungs-Gleichungen bestehen. Astron. Nachrichten 1874, 84, 193–210. [Google Scholar] [CrossRef]
  23. Tominaga, Y.; Stathopoulos, T. Turbulent Schmidt numbers for CFD analysis with various types of flowfield. Atmos. Environ. 2007, 41, 8091–8099. [Google Scholar] [CrossRef]
  24. Gualtieri, C.; Angeloudis, A.; Bombardelli, F.; Jha, S.; Stoesser, T. On the values for the turbulent schmidt number in environmental flows. Fluids 2017, 2, 17. [Google Scholar] [CrossRef]
  25. Paul, E.L.; Atiemo-Obeng, V.A.; Kresta, S.M. Handbook of Industrial Mixing; Wiley-Blackwell: Hoboken, NJ, USA, 2003. [Google Scholar] [CrossRef]
  26. Monod, J. The growth of bacterial cultures. Annu. Rev. Microbiol. 1949, 3, 371–394. [Google Scholar] [CrossRef]
  27. Kovárová-Kovar, K.; Egli, T. Growth Kinetics of Suspended Microbial Cells: From Single-Substrate-Controlled Growth to Mixed-Substrate Kinetics. Microbiol. Mol. Biol. Rev. 1998, 62, 646–666. [Google Scholar] [CrossRef] [PubMed]
  28. Titchener-Hooker, N. Bioprocess Engineering Principles (by Pauline M. Doran). Trends Biotechnol. 1995, 13. [Google Scholar]
  29. Stanbury, P.F.; Whitaker, A.; Hall, S.J. Principles of Fermentation Technology, 3rd ed.; Elsevier: Amsterdam, The Netherlands, 2016. [Google Scholar]
  30. Nadal-Rey, G.; McClure, D.D.; Kavanagh, J.M.; Cassells, B.; Cornelissen, S.; Fletcher, D.F.; Gernaey, K.V. Development of dynamic compartment models for industrial aerobic fed-batch fermentation processes. Chem. Eng. J. 2021, 420, 130402. [Google Scholar] [CrossRef]
  31. Perotto, S.; Rozza, G. Special Issue on Reduced Order Models in CFD. Int. J. Comput. Fluid Dyn. 2020, 34, 91–92. [Google Scholar] [CrossRef]
Figure 1. Schematics of two-dimensional collocated (a) and staggered (b) grids.
Figure 1. Schematics of two-dimensional collocated (a) and staggered (b) grids.
Bioengineering 11 00169 g001
Figure 2. Geometry of the 16 L (top row) and 190 L (bottom row) reactors. The CFD meshes (a,e), iso views (b,f), view normal to the xy-plane (c,g) and view normal to the xz-plane (d,h) are shown. The baffles are shown in blue and the shaft/impeller(s) are shown in red. The red point indicates the position of the source point for the tracer injection and the yellow marks indicate the position of monitor points. Not to scale.
Figure 2. Geometry of the 16 L (top row) and 190 L (bottom row) reactors. The CFD meshes (a,e), iso views (b,f), view normal to the xy-plane (c,g) and view normal to the xz-plane (d,h) are shown. The baffles are shown in blue and the shaft/impeller(s) are shown in red. The red point indicates the position of the source point for the tracer injection and the yellow marks indicate the position of monitor points. Not to scale.
Bioengineering 11 00169 g002
Figure 3. Velocity magnitude profiles on the xy-cut-plane through the middle of the tank, and on the xz-cut-plane through the middle of the impeller (middle impeller for the 190 L tank), reported in m/s. The results from the 16 L tank are shown on the top row and the results from the 190 L tank are shown in the bottom row. The CFD results are presented in subfigures (a,c,e,g) and the results from the generated ( 65 × 100 × 65 ) compartment model are presented in subfigures (b,d,f,h).
Figure 3. Velocity magnitude profiles on the xy-cut-plane through the middle of the tank, and on the xz-cut-plane through the middle of the impeller (middle impeller for the 190 L tank), reported in m/s. The results from the 16 L tank are shown on the top row and the results from the 190 L tank are shown in the bottom row. The CFD results are presented in subfigures (a,c,e,g) and the results from the generated ( 65 × 100 × 65 ) compartment model are presented in subfigures (b,d,f,h).
Bioengineering 11 00169 g003
Figure 4. Tracer concentration profiles as function of time at different monitor points (shown in Figure 2) for the (a) 16 L reactor and (b) 190 L reactor. Solid lines show the results from the CFD simulations using frozen velocity field, and the dotted lines show the results from the generated compartment models of resolution ( 65 × 100 × 65 ). Dashed black lines show the 95% homogeneity.
Figure 4. Tracer concentration profiles as function of time at different monitor points (shown in Figure 2) for the (a) 16 L reactor and (b) 190 L reactor. Solid lines show the results from the CFD simulations using frozen velocity field, and the dotted lines show the results from the generated compartment models of resolution ( 65 × 100 × 65 ). Dashed black lines show the 95% homogeneity.
Bioengineering 11 00169 g004
Figure 5. Dimensionless tracer concentration profiles in the xy-plane of the 16 L reactor. The top row shows the results from the CFD simulation and the bottom row show the results from the generated ( 65 × 100 × 65 ) compartment model. The results are shown after 1 s (a,g), 5 s (b,h), 10 s (c,i), 15 s (d,j), 20 s (e,k) and 25 s (f,l). Impeller and baffles in the CFD simulation are shown in black.
Figure 5. Dimensionless tracer concentration profiles in the xy-plane of the 16 L reactor. The top row shows the results from the CFD simulation and the bottom row show the results from the generated ( 65 × 100 × 65 ) compartment model. The results are shown after 1 s (a,g), 5 s (b,h), 10 s (c,i), 15 s (d,j), 20 s (e,k) and 25 s (f,l). Impeller and baffles in the CFD simulation are shown in black.
Bioengineering 11 00169 g005
Figure 6. Dimensionless tracer concentration profiles in the xy-plane of the 190 L reactor. The top row shows the results from the CFD simulation and the bottom row show the results from the generated ( 65 × 100 × 65 ) compartment model. The results are shown after 1 s (a,g), 5 s (b,h), 10 s (c,i), 15 s (d,j), 20 s (e,k) and 25 s (f,l). Impellers and baffles in the CFD simulation are shown in black.
Figure 6. Dimensionless tracer concentration profiles in the xy-plane of the 190 L reactor. The top row shows the results from the CFD simulation and the bottom row show the results from the generated ( 65 × 100 × 65 ) compartment model. The results are shown after 1 s (a,g), 5 s (b,h), 10 s (c,i), 15 s (d,j), 20 s (e,k) and 25 s (f,l). Impellers and baffles in the CFD simulation are shown in black.
Bioengineering 11 00169 g006
Figure 7. Degree of homogeneity log ( σ 2 ) as function of time for the generated compartment models with various resolutions (see labels) for the 16 L tank (a) and the 190 L tank (b). Results from CFD are shown in black. The dashed line shows the 95% homogeneity.
Figure 7. Degree of homogeneity log ( σ 2 ) as function of time for the generated compartment models with various resolutions (see labels) for the 16 L tank (a) and the 190 L tank (b). Results from CFD are shown in black. The dashed line shows the 95% homogeneity.
Bioengineering 11 00169 g007
Figure 8. Concentration profiles of biomass, substrate, and product in the bioreactor for the 190 L tank (a) and 10 m 3 tank (b). Results from the 0D simulation are shown as dotted lines, the mean concentration profile from the compartment model simulation in solid lines, 95% of the concentrations are within the coloured area.
Figure 8. Concentration profiles of biomass, substrate, and product in the bioreactor for the 190 L tank (a) and 10 m 3 tank (b). Results from the 0D simulation are shown as dotted lines, the mean concentration profile from the compartment model simulation in solid lines, 95% of the concentrations are within the coloured area.
Bioengineering 11 00169 g008
Table 1. Geometric properties of the 16 L and 190 L reactors.
Table 1. Geometric properties of the 16 L and 190 L reactors.
ParameterReactor #1Reactor #2
Total Volume16.355 L189.947 L
Inside height35 cm105.5 cm
Bottom typeroundedrounded
Inside diameter25 cm48.8 cm
Impeller diameter8.5 cm20 cm
Number of impellers13
Impeller typePaddleRushton
Number of blades on impeller46
Distance from top to impeller centre22.5 cm15.375, 51.875, 88.375 cm
Number of baffles44
Baffle width2 cm4 cm
Baffle height15 cm95.5 cm
Agitator shaft diameter5 mm3.5 cm
Table 2. Biokinetic parameters and initial conditions.
Table 2. Biokinetic parameters and initial conditions.
ParameterValueUnit
μ m a x 2 h 1
K S 10 g · L 1
D X 5 × 10 5 g · m 3
Y s x 0.03 gX · gS 1
α 2.8 × 10 4 gP · gX 1
K P , 1 100 g · m 3
K P , 2 1 g · m 3
Initial conditionValueUnit
X 0 0.5 g · L 1
S 0 70 g · L 1
P 0 0 g · L 1
Table 3. Dimensionless simulation time (defined as wall clock time/simulated time) of the CFD and CM tracer mixing simulations.
Table 3. Dimensionless simulation time (defined as wall clock time/simulated time) of the CFD and CM tracer mixing simulations.
ReactorANSYS-CFX 2021R1
CFD Mesh
CM Python
( 35 × 60 × 35 )
CM Julia
( 65 × 100 × 65 )
CM Julia
( 35 × 60 × 35 )
16 L145522.5910.050.641
190 L6824.92710.220.722
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Le Nepvou De Carfort, J.; Pinto, T.; Krühne, U. An Automatic Method for Generation of CFD-Based 3D Compartment Models: Towards Real-Time Mixing Simulations. Bioengineering 2024, 11, 169. https://doi.org/10.3390/bioengineering11020169

AMA Style

Le Nepvou De Carfort J, Pinto T, Krühne U. An Automatic Method for Generation of CFD-Based 3D Compartment Models: Towards Real-Time Mixing Simulations. Bioengineering. 2024; 11(2):169. https://doi.org/10.3390/bioengineering11020169

Chicago/Turabian Style

Le Nepvou De Carfort, Johan, Tiago Pinto, and Ulrich Krühne. 2024. "An Automatic Method for Generation of CFD-Based 3D Compartment Models: Towards Real-Time Mixing Simulations" Bioengineering 11, no. 2: 169. https://doi.org/10.3390/bioengineering11020169

APA Style

Le Nepvou De Carfort, J., Pinto, T., & Krühne, U. (2024). An Automatic Method for Generation of CFD-Based 3D Compartment Models: Towards Real-Time Mixing Simulations. Bioengineering, 11(2), 169. https://doi.org/10.3390/bioengineering11020169

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop