1 Introduction

Microfluidics takes advantage of fluid behavior inside a microsystem which is dominated by viscosity rather than inertial effects. This can be explained by considering Reynolds number, which is often lower than 1 for microfluidic systems. Control over the microsystem, small response time, reduction of sample volume, higher efficiency and lower energy usage are some of the advantages of such systems over conventional macroscale systems [1]. Common applications are in the biological field where, for instance, small amounts of fluid are transported and manipulated on chip for cell separation [2], delivering drugs [3] or even point-of-care diagnosis [4]. In recent years, microfluidics has emerged as a cost-effective tool for drug screening with a quick turnaround time, due to the small amount of required chemicals and fast reaction time for testing and introducing drugs in the pharmaceutical industry [5]. A limitation of the conventional drug development methods is that it relies on monolayer cell cultures, rather than the 3D cell structures found in living organisms. The most common approach for creating 3D cell cultures is by placing the cells within 3D hydrogel materials, which mimic the interactions between cells and their natural extracellular matrix. Moreover, hydrogels permeability allows for diffusion and exchange of molecules such as oxygen and nutrients, thereby promoting cell growth and function [6]. By combining fluid flow techniques, hydrogels, and cell encapsulation in microfluidic devices, high-throughput drug screening can be performed using drug gradients [7].

There have been several approaches to put cells inside hydrogel scaffolds, the simplest of which is to inject a mixture of hydrogel and cells inside a microchannel to form a hierarchical layered microstructure of cells and biopolymer [8]. Another technique is to use photopolymerization [9]. Albrecht et al. introduced two different methods for creating living cell arrays inside a hydrogel [10]. In the first method, they used photopatterning to crosslink hydrogel structures in the order of 100 μm with cells inside them. For the second method, they used dielectrophoretic force to put cells in specific locations inside a crosslinked hydrogel to form a cell array. There have been two challenges regarding this method: (1) UV radiation may affect the cell viability. (2) Irreversibility of the process. Recent progress in photopolymerized hydrogels have led them to have milder formation conditions and biocompatibility [11]. With the emergence of droplet microfluidics, photopolymerization of hydrogel droplets enabled the high throughput fabrication of hydrogel particles containing cells [12]. Since then, droplet microfluidics has been extensively used to encapsulate cells inside hydrogel droplets. Different crosslinking techniques has been used to produce the hydrogel droplets. Utech et al. were able to encapsulate single cells and culture them via producing alginate microgels with structural homogeneity [13]. In this paper, they used a flow-focusing micro-device to generate microdroplets of alginate and then added Calcium solution to the continuous oil phase to crosslink the alginate. In order to accurately replicate the cellular environment within the body, it is important to not only culture cells within a 3D hydrogel matrix, but also consider other factors that may influence cellular behavior, such as tissue barriers and blood flow [14]. Therefore, new approaches must be devised to form hydrogels in microfluidic devices, providing more dynamic culture conditions.

Recently, formation of hydrogels structures in microfluidic for tissue engineering and drug development applications has gained attention [15]. A common method is to bioprint the hydrogel and its crosslinking agent at the same time to fabricate the structure [16]. Combined with precise 3D print techniques, complex scaffolds with complicated geometries can be produced [17]. Another technique is to use stimuli responsive materials, such as pH sensitive and temperature sensitive hydrogels. Magnetic thermosensitive hydrogels have been used to create drug carrier droplets which can release the drug by both magnetic field and heat [18]. Moreover, thermosensitive hydrogels were developed for delivering stem cells into tissues of heart and skeletal muscle [19]. Thermosensitive hydrogels have been studied in the field of microfluidics due to their ability to undergo a reversible transition from a solid to a liquid state in response to changes in temperature. This property allows for precise control of the fluid flow and manipulation of particles within microfluidic devices [20]. This can be used to create complex fluidic networks in lab-on-a-chip devices for applications such as drug screening, cell sorting, and biomolecular analysis [21]. As a thermosensitive hydrogel, Pluronic F127 solution is known to form micelles and turn into solid phase (gel) as temperature increases [22], which is known to be a reversible transition. One unique aspect of this thermosensitive hydrogel is that the addition of ions can significantly alter the temperature at which the hydrogel undergoes the transition from a solid to a liquid state, known as micellization. [23]. Additionally, hydrogels have high permeability, allowing ions to diffuse into them easily. Consequently, the micellization of the solution can be controlled by regulating the diffusion of ions into the hydrogel. By utilizing the co-flow of Pluronic F127 and a salt solution, the continuous diffusion of salt ions can be modified by manipulating the fluid flow properties, resulting in controlled formation of a gel wall in the interface between the two flows.

In this paper, we present a method for hydrogel formation termed “moving gel wall”, which can be used in cell trapping and drug screening on a simple microfluidic device which is based on the stimuli-responsive characteristic of a hydrogel. We have numerically studied the gel wall growth and the factors contributing to this phenomenon, in a Y- shaped microchannel device in which laminar flows of a Pluronic F127 solution and a sodium phosphate (Na3PO4) solution are brought into a smooth contact. The unique characteristic of this phenomenon is that it can be used for repeated cell trapping, releasing and drug screening by changing the system’s temperature or flow rates of the inlets. Limited experimental results from this phenomenon are available in the literature [24]. All the mentioned substances and conditions in this study are known to be biocompatible. To this end, two phase level set method and finite element method were implemented to capture the formation of crosslinked hydrogel in the channel. We believe that the numerical study of gel wall formation can be a valuable reference for further experimental designs which could incorporate cultured cells.

In the next section we provide in-depth details on the materials utilized for the study, with particular focus on Pluronic F127. The third section outlines the geometry and boundary conditions, while the fourth section defines the governing equations. Moving onto Sect. 5, the results are presented, beginning with grid independence and numerical method validation, followed by an evaluation of the impact of various parameters on the formation of the gel wall. A discussion on the findings is presented in Sect. 6, and the conclusion of the results is detailed in Sect. 7.

2 Materials

Pluronic copolymers, also known as Pluronic, Synperonic, and Kolliphor, were first introduced in the 1960s [25] and since then their applications have shown great promise in different fields, from pharmaceutical and cosmetic to cell culture and lab-on-a-chip application [26, 27]. These copolymers consist of three blocks. The Polypropylene glycol (also known as polypropylene oxide) (PPO) with a chemical formula of C3H6O which is the hydrophobic part located in the center and is surrounded by two hydrophilic blocks of polyethylene glycol (also known as polyethylene oxide) (PEO) with a chemical formula of C2H4O. Due to the amphiphilic nature of Pluronic, when dissolved in water, micelles with hydrophobic cores and hydrophilic surroundings are formed [28]. At low concentrations and/or temperatures, Pluronic exists in the solution as unimers. At higher concentrations, the copolymer is able to self-assemble into micelles by organizing the hydrophobic PPO blocks in the center, creating a core that is free of water. This process is known to be endothermic. By increasing the temperature, the hydrogen bond between PPO blocks and water molecules start to diminish and PEO blocks become less soluble in water [29]. The reduced solubility results in separation of PPO blocks out of the solution and into micelle cores. Accordingly, at a constant concentration, increasing the temperature will result in micellization. Aqueous solutions of Pluronic F127 shows thermo-thickening property in sufficiently concentrated samples (higher than 15 wt% [30]). The temperature in which the fluid becomes gel is known as the sol–gel transition temperature (Tsol→gel). The transition temperature is highly dependent on Pluronic concentration and ranges from 15 to 35 °C. Above the transition temperature, Pluronic molecules start to form micelles due to the dehydration of hydrophobic blocks. In the next step, if the concentration is high enough, the micelles aggregate and form the gel in an FCC (concentration below 50%) or BCC structure (concentrations above 50%) [31]. A unique characteristic of this hydrogel is its reversible nature, as it can transition back to a fluid phase upon lowering the temperature.

On the other hand, introducing a salt into the solution will also reduce the solubility of the PEO-PPO-PEO blocks and results in micellization in lower temperatures and/or concentrations. Several studies have demonstrated that the addition of ionic salts can affect the micellization temperature of Pluronic solutions. Specifically, the presence of ionic salts can decrease the micellization temperature of Pluronic [32]. The intensity of the effect of salts on the Pluronic phase change follows the well-known Hofmeister series (Na3PO4, Na2SO4, Na2HPO4, NaH2PO4, NaCH3CO2, NaCl, KI), which means that Na3PO4 has the most dramatic effect on the micellization temperature. Anderson et al. asserted that Na3PO4 has the most dramatic effect on the sol–gel transition temperature and can lower the gel melting temperature more dramatically than the gel formation temperature [23]. As a result, there will be a certain critical concentration, after which there will be no gel at all.

In this study, we utilized a 0.5 M (mol/L) Na3PO4 solution as the “saline inlet” and an aqueous solution of 15 wt% Pluronic F127 as the “Pluronic inlet”. We use data from the literature to define the material properties: a 15 wt% Pluronic F127 solution has Tsol→gel = 26.3 °C with no Na3PO4, and Tsol→gel = 20.46 °C with 0.253 M Na3PO4, with a linear relationship between Tsol→gel and Na3PO4 concentration. The critical salt concentration beyond which gel formation does not occur is 0.253 M. (Ccritical = 0.253 M) [24]. It should be kept in mind that the mentioned flows are parallel and immiscible, thus the convection is minimum. Hence, the primary cause of gel formation is through diffusion of salt ions into the Pluronic flow. The diffusion coefficient for sodium phosphate is around 6 × 1010 m2/s [33]. Due to the much higher molecular weight of the Pluronic molecules, diffusion of Pluronic molecules into saline flow is neglected.

3 Geometry and boundary conditions

The geometry is a Y-shaped microchannel, consisting of the main microchannel and two branches to which it is connected. A schematic of the geometry is presented in Fig. 1. The branches are perpendicular to each other, each having a height of 500 μm. The height and length of the main microchannel are 500 μm and 1000 μm, respectively, and the total length of microchannel is 1810 μm. A gel wall forms between the saline and Pluronic streams. In this study, an outlet atmospheric pressure is imposed at the outlet and the no-slip condition is applied to the walls of the microchannel. The flow in the inlets is assumed to be displacement driven, which can be achieved through the use of conventional syringe pumps.

Fig. 1
figure 1

Schematic of the Y-shaped microchannel used in this study

4 Mathematical formulation and governing equations

In the past decades, several techniques have been developed for numerical study of the interface between two fluids; for instance, phase field, the volume of fluid (VOF) and the level set method (LSM), all of which have particular merits and demerits. Among these methods, level set and phase field, which are both based on interface capturing, are becoming more popular due to their ability to accurately solve flow problems with sophisticated moving interfaces and complex topologies [34, 35]. The level set method was first introduced by Stanley Osher and James A. Sethian in 1988 [36]. Since then, level set method has been widely used for tracking the evolution of interfaces [37] in different physics, including solidification of alloys [38], electroporation of cell membranes [39] and micro-droplet generation [40]. There have been numerous studies on the ability of level-set method for simulation of two-phase flows inside microchannels [41]. Mass conservation is a huge drawback in classical level set method, meaning that mass loss may happen in the system. In 2005, Olsson and Kreiss came up with a mass-conserving level set method for multiphase flows [42].

In our study, we have implemented a modified level set method with sufficient mass conservation and high order accuracy. A level set function (x, t) is defined for the space occupied by an interface, in which x is the coordinates of a point at time t. The initial condition at time t0 is set and then by utilizing a numerical scheme, the (x, t) is determined over small time-steps. To describe the level set function, we define (x, t) equal to one in the saline solution and zero in the Pluronic solution. The level set function varies smoothly from zero to one across the interface, meaning that the interface is defined as a place where (x, t) is 0.5. The governing equations consist of incompressible Navier–Stokes, continuity, convection–diffusion, and level-set:

$$\rho \frac{\partial u}{{\partial t}} + \rho \left( {u \cdot \nabla } \right)u = \nabla\cdot\left[{-pI + \mu \left( {\nabla u + \left( {\nabla u} \right)^{T} } \right)} \right] + \sigma \kappa \delta n$$
(1)
$$\rho \nabla \cdot \left( u \right) = 0$$
(2)
$$\frac{\partial c}{{\partial t}} + \nabla \cdot \left( { - D\nabla c} \right) + u \cdot \nabla c = R$$
(3)
$$\frac{\partial \phi }{{\partial t}} + u \cdot \nabla \phi = \gamma \nabla \cdot \left[ {{\upvarepsilon }\nabla \phi - \phi \left( {1 - \phi } \right)\frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}} \right]{ }$$
(4)

where u is velocity, \(\rho\) is density,\(p\) is pressure, \(\mu\) is dynamic viscosity, \(\sigma\) is surface tension coefficient, \(\delta\) is the function concentrated at the interface, n is the unit normal vector to the interface pointing into saline solution, \(c\) is the salt concentration, \(D\) is diffusion coefficient, \(R\) is the source or sink of the quantity of concentration (which is zero in our case), \(\gamma\) is re-initialization parameter, and \(\varepsilon\) is the parameter controlling the interface thickness. The term \({\upvarepsilon }\nabla \phi\) acts as an artificial diffusivity to keep the interface of the two fluids continuous. The second term on the right-hand side of Eq. (4) is known as the compressive flux [42]. The term \(\sigma \kappa \delta n\) is the surface tension force which is imposed on the interface between the two phases. \(\delta\) results in a zero value everywhere, except for the interface, where the effect of surface tension should be considered. Surface tension coefficient is 0.00003 N/m. The surface tension force between the two flows is very small because they are both aqueous solutions. However, there needs to be some surface (interfacial) force to result in immiscible flows. The final value for surface tension is chosen by multiple iterations and is purely for numerical purposes. It is as small as possible to diminish the interfacial tension force between the two aqueous flows and big enough to help the flows stay immiscible. \(k\) is the curvature of the interface [40], and is defined as:

$$\kappa = - \nabla \cdot n$$
(5)

where ̏n̋ is described in terms of level set function:

$$n = \frac{\nabla \phi }{{\left| {\nabla \phi } \right|}}$$
(6)

The velocity field u is obtained by solving the first two equations. Once this is done, the velocity field is then used in Eqs. (3) and (4) to determine the salt concentration at each point in the microchannel and the advection of the level set function, respectively. Dynamic viscosity \(\mu\) and density \(\rho\) are calculated based on the dynamic viscosity and density of saline and Pluronic as:

$$\rho = \rho_{sw} + \left( {\rho_{p} - \rho_{sw} } \right)\phi$$
(7)
$$\mu = \mu_{sw} + \left( {\mu_{p} - \mu_{sw} } \right)\phi$$
(8)

where the subscripts \(sw\) and \(p\) refer to saline and Pluronic, respectively. Implementing level set function smooths the fluid properties in the interface, which ultimately minimizes the numerical oscillations in the solution of the equations. It should be noted that the dynamic viscosity of the Pluronic is not constant and changes with salt concentration. In this study, we used the information from the paper of Bazargan and Stoeber [24] to determine the viscosity of Pluronic at different concentrations and temperatures. The model was simulated in COMSOL Multiphysics 5.3a, in which viscosity values were entered for defining Pluronic’s properties. Concentration derived from Eq. (3) is used to update Pluronic’s viscosity. Afterward, dynamic viscosity is calculated from Eq. (8) and then substituted in Eq. (1) for deriving velocity. Afterward, velocity is used in Eq. (3) to obtain concentration, and this cycle repeats. Finally, the region with high viscosity is considered as gel phase.

5 Numerical results

5.1 Grid independence study

The mesh used for the simulation contains 21,514 triangle elements. Other properties of mesh are mentioned in Table 1. The skewness quality is measured in COMSOL Multiphysics based on the equiangular skew, for which elements with large or small angles compared to the angles in an ideal element, get a bad score. The condition number quality is calculated based on properties of the matrix that transforms the actual element to an ideal element. Both quality measures are scaled such that a value of 1 represents optimal elements in the mesh, with a threshold of poor-quality set at 0.1 or below. Low mesh quality can lead to high condition numbers, causing convergence issues. Condition number is specifically important in our problem since our data is obtained from experimental studies, and with a high condition number, a minute error in data can cause a great solution error. The results in Table 1 indicate that the minimum value for both quality measures exceeded 0.6, indicating mesh elements have high quality.

Table 1 Mesh Statics

An investigation was conducted to determine the independence of the solution results from the mesh size. To do so, six different triangular meshing sizes were considered by changing the element’s maximum size. The maximum element size ranged from 0.028 to 0.008 mm, resulting in a total number of elements ranging from 2978 to 48,251, respectively. The velocity values were obtained for a point located in the output of the flow for each mesh size. The comparison of the velocity in each mesh case showed that the results obtained from the mesh with 21,514 elements were consistent with those obtained from the mesh with 48,251 elements, with a percentage error of less than 1%. As a result, the simulations were performed with 21,514 triangle elements. Figure 2 shows the model’s mesh construction.

Fig. 2
figure 2

Model’s mesh construction which includes 21,514 triangle elements

Backward differentiation formula (BDF) solver was used for marching in time. According to solver settings in COMSOL Multiphysics, BDF solver has a maximum and minimum order of accuracy of two and one, respectively. Lower order is automatically used when maintaining stability is important. Relative tolerance was used as the criteria for determining convergence and the solution is converged when relative tolerance is lower than \(10^{ - 6}\).

5.2 Numerical method validation

For initial models, both saline and Pluronic solutions had identical volume flow rates of \(10^{ - 11} {\text{m}}^{3} /{\text{s}}\) and the room temperature was set to 24 ℃. At this temperature, the viscosity of Pluronic and saline are 0.04 Pa.s and 0.001 Pa.s, respectively. Subsequent models evaluated the effect of volume flow rate and temperature. Note that in all of the following results, the thickness of the gel wall has been made dimensionless by normalizing it with the height of the channel.

When Na3PO4 diffuses into the Pluronic flow, its concentration inside Pluronic increases and the sol–gel transition temperature decreases, leading to gel formation along the channel, between the two flow streams. The particles within the gel located at the central region of the channel exhibit minimal movement, in contrast to the rapid movement observed for particles within the Pluronic flow. The thickness of the gel wall can be adjusted within a range of tens to hundreds of micrometers by manipulating the salt concentration, inlet flow rates, and temperature. To gain a deeper understanding, the velocity profile in the central region of the main channel is presented in Fig. 3. The figure illustrates that the velocity of Pluronic is significantly lower than that of saline, owing to its higher viscosity.

Fig. 3
figure 3

Velocity profile through channel’s height after 1 min. Volume flow rate of both streams are 10–11 m3/s

In order to validate the numerical method, the velocity profile across the channel height is compared to the experimental particle image velocimetry (PIV) results from Bazargan et al. [24]. The study employed a Pluronic and saline solution at flow rates of 3 and 30 μL/h (equal to \(8.3 \times 10^{ - 13}\) and \(8.3 \times 10^{ - 12} {\text{ m}}^{3} /{\text{s}}\)), respectively. As shown in Fig. 4, the velocity at the Pluronic and saline solution section is presented as a normalized value relative to the maximum velocity observed at that section. The velocity profiles at both sections exhibit strong correlations, and the gel thickness was found to be consistent across both methods. However, some small fluctuations were observed in the velocity profile at the Pluronic section in the experimental results, which are likely attributed to errors in the PIV measurements caused by variations in the viscosity of the Pluronic.

Fig. 4
figure 4

Numerical method results comparison with the Experimental Results by Bazargan et al. [24]. The velocity in each section is normalized to the maximum velocity in that section

The viscosity and saline concentration through channel’s height at the same location is also presented in Fig. 5. As the salt ions diffuses into the Pluronic solution, the concentration of sodium phosphate increases on the Pluronic side, resulting in the transformation of Pluronic into gel. The viscosity of the gel increases as the saline concentration increases until a critical point is reached (approximately 0.25 mol/L, consistent with literature [24]) at which no gel is formed. Beyond this point, the viscosity of the gel drops dramatically, and it reverts back to a liquid state. As a result, gel is constantly dissolving on the saline side and is constantly created on the Pluronic side. This means that the gel wall should have a low but fixed velocity toward the saline side. Consequently, the region with low and constant velocity in Fig. 3 is considered as gel wall, which has a high viscosity as shown by Fig. 5.

Fig. 5
figure 5

Changes in sodium phosphate concentration and dynamic viscosity in logarithmic scale through the channel’s height after 1 min

In the experimental study of Bazargan and Stoeber [24], the PIV measurement has shown that the wall’s velocity toward saline side (\(u_{y}\)) is in the order of 1 μm/s while the velocity of the saline stream is in the order of 100 μm/s. The peak modeled velocity of saline solution shown in Fig. 2 is ~ 400 μm/s, which is in the same order of magnitude as the experiment.

Surface tension exists between Pluronic and saline to prevent them from mixing, leading to diffusion through interface and forming a gel wall. Interface is where the level set function is equal to 0.5. According to Fig. 6, interface in the channel is located at the height of -0.083 mm, stating that gel wall is formed on both sides of interface.

Fig. 6
figure 6

Level set function through channel’s height after 1 min. Volume flow rate of both streams are 10–11 m3/s

5.3 Effect of both flow rates

The volume flow rates of both the Pluronic and saline solutions were increased in equal increments, resulting in a reduction of the gel wall thickness (as shown in Fig. 7). The gel wall thickness can be determined from velocity profiles, as previously discussed. The region with a low and constant velocity in the velocity profile is considered to be the gel wall and its thickness can be calculated by determining its start and end points.

Fig. 7
figure 7

Changes in gel wall thickness as a function of both volume flow rates of Pluronic and saline solution

Reduction of gel wall thickness is related to the Peclet number which indicates the relative importance of convection to diffusion and is defined as [43]:

$$Pe = \frac{{hu_{w} }}{D}$$
(9)

where \(h\), \(u_{w}\), and \(D\) represent channel’s height, gel wall velocity, and diffusion coefficient, respectively. Peclet number varies with volume flow rate (Table 2). In low Peclet numbers, diffusion is the dominant mechanism. By increasing the volume flow rates, the velocity increases, which increases Peclet number and reduces the diffusion’s effect. Since diffusion is the cause of gel formation, the wall thickness reduces. The velocity profiles for different volume flow rates are also shown in Fig. 8. Maximum Reynolds number in the domain is also calculated through Eq. (10) to compare against the condition stated in the introduction about Reynolds number in microfluidic systems.

$$Re = \frac{\rho uh}{\mu }$$
(10)
Table 2 Peclet number and maximum reynolds number in different flow rates
Fig. 8
figure 8

Velocity profiles of different volume flow rates through the channel’s height after 1 min

Velocity contour and velocity vectors through a section of microchannel are also shown in Fig. 9. This section includes gel wall and a part of saline and Pluronic side. The gel wall thickness is shown in the velocity contour. As shown, on Pluronic and saline sides there is no velocity in the height’s direction (vertical direction). But in the gel wall region, velocity also exists in the height’s direction, implying the slight gel wall movement toward the saline side. This is also shown by the experiments [24].

Fig. 9
figure 9

Velocity vector through a part of microchannel. Volume flow rate of both streams are \(8 \times\) 10–11 m3/s. The upper and lower part of the channel shows straight flow directions, while the middle part (gel wall) has a very low velocity with a skewed direction

Gel wall velocity increases with volume flow rate Fig. 10a. We defined a relationship between gel wall velocity, volume flow rate, diffusion coefficient, and channel’s height (Fig. 10b):

$$u_{w} = 0.0003\frac{{Q^{2} }}{{Dh^{3} }} + 0.0783\frac{Q}{{h^{2} }} + 2.836\frac{D}{h}$$
(11)

where \(u_{w}\) and \(Q\) represent gel wall velocity and volume flow rate, respectively. Volume flow rate is of second degree due to its prominent effect on gel wall velocity and matching dimensions of effective parameters. Using this equation, we can calculate the gel wall velocity. Calculating gel wall velocity is important since it affects the shear stress imposed on cells, and their viability might be lost under high shear stress. Hence, velocity should be calculated before experiments.

Fig. 10
figure 10

a) Changes in gel wall velocity as a function of volume flow rate of Pluronic and saline solution. b) The relation between gel wall velocity, volume flow rate, channel’s height, and diffusion coefficient

Shear stress on both sides of the gel wall is also measured. Generally, shear stress increases with volume flow rate, and it is higher on the Pluronic side (Table 3). The shear stress required for breaking the gel wall is as large as hundreds of Pascals [22]. Thus, we are confident that the gel wall is not destroyed under the circumstances of our simulations.

Table 3 Shear stress on both sides of the gel wall

5.4 Effect of pluronic solution volume flow rate

In this section, saline flow rate was set to \(10^{ - 11} {\text{ m}}^{3} /{\text{s}}\) and remained unchanged during simulations, while the Pluronic volume flow rate was increased.

By increasing Pluronic volume flow rate, the ratio of saline to Pluronic content decreases in the microchannel. Hence, more salt ions are needed for gel construction. While saline flow rate is kept constant, the ratio becomes smaller as the Pluronic flow rate increases, and consequently, the availability of salt ions for forming a gel wall decreases. As shown in Fig. 11, increasing the Pluronic volume flow rate will lead to a decrease in the gel wall thickness. This result is also compatible with the study of Bazargan and Stoeber [24] where they illustrated that gel wall thickness is inversely proportional to Pluronic’s volume flow rate or velocity.

Fig. 11
figure 11

Changes in gel wall thickness as a function of Pluronic volume flow rate

5.5 Effect of saline solution volume flow rate

In this step, Pluronic flow rate was kept constant at \(10^{ - 11}\) m3/s, and saline’s flow rate was increased. As illustrated in Fig. 12, the gel wall thickness increases with saline flow rate until a critical point. In each step of increasing saline flow rate, the salt’s molecular flux enhances. Hence, the salt’s concentration increases in the interface of the two flows, which enhances the wall thickness in each steBut as stated before, there is a critical salt concentration above which gel cannot form. By increasing the flow rate of the saline solution, regions close to the interface may experience a concentration above the critical value, resulting in the absence of gel transformation in those areas. The regions where gel transformation does not occur increase as the flow rate of the saline solution increases. Consequently, gel wall thickness decreases after a specific value of saline’s volume flow rate (Fig. 12).

Fig. 12
figure 12

Changes in gel wall thickness as a function of saline volume flow rate

5.6 Effect of temperature

The impact of temperature was explored by conducting simulations at various temperatures ranging, from 14 ℃ to 26 ℃, while other parameters were kept unchanged, including volume flow rates that were set to \(10^{ - 11} {\text{m}}^{3} /{\text{s}}\). If the temperature is equal to or less than 20 ℃, maximum viscosity is small, indicating that there is no gel wall formation (Table 4). Viscosity increases with rising temperature until it reaches 22 ℃, where a significant change occurs, and the formation of the gel wall begins. Further temperature increases result in a dramatic shift in viscosity over a wider portion of the channel. Hence, the gel wall becomes thicker (Fig. 13). This is in accordance with the experimental study of Bazargan and Stoeber [24] where they showed that the minimum temperature for gel formation is 20.54 ℃, and in a constant concentration, viscosity increases with temperature. Furthermore, they indicated that the range of concentration that leads to gel formation increases with temperature, leading to a thicker gel wall in domains with varying concentration.

Table 4 Effect of temperature on viscosity and gel wall thickness
Fig. 13
figure 13

Changes in gel wall thickness as a function of temperature

6 Discussion

Due to the rapid growth of drug resistance and the appearance of new diseases, the need for new drug development has become urgent. However, the high cost and long-time frame of new drug development pose obstacles. Moreover, the use of experimental animals in the drug development industry has raised ethical issues [44]. Therefore, it is essential to find cost-efficient, accessible, and ethical methods for drug screening. Hydrogels which can mimic the 3D extracellular environment are of great capacity in cell-based drug assays [45]. Different techniques are available for formation of hydrogels inside microfluidic structures, including droplet-based hydrogels and bioprinting. The high-throughput encapsulation of cells inside hydrogel droplets remains challenged by concerns over the droplets' morphological and mechanical stability [46]. Moreover, the high shear stress in the process of bioprinting can decrease the cell survival rate [47]. Therefore, innovative techniques for creating hydrogel structures within microfluidic devices are required. There are various methods for crosslinking different hydrogels, including drying, UV irradiation, heating, and addition of chemical agents. Alginate hydrogel formation using Calcium ions is reported to be used as a gentle cell trapping method inside gel bars [48]. To release the cells, an external flow of EDTA is used to reduce the gel thickness. Flow-assembled membranes inside microfluidic devices have recently received significant attention [49].

In this work, we have utilized a hydrogel solution that is both sensitive to temperature and salt ions. Aqueous solution of Pluronic F127 shows a reversible thermo-thickening property which can be controlled by introduction of salt ions. A “gel wall” is formed when the Pluronic F127 and saline solutions are brought into smooth contact inside a Y-shaped microchannel, due to the diffusion of ions into the hydrogel structure. The numerical results from this study were compared with the experimental results [24]. This setup can be used for drug screening, where a solution of Pluronic and cells is brought into contact with a solution of sodium phosphate and a testing drug. When the solutions are in contact, sodium phosphate and the testing drug diffuse into the solution of Pluronic and cells, which forms a gel wall. Gel wall traps the testing drug and cells in itself, providing an environment for interactions between them. The velocity of the gel wall can be regulated, mimicking the velocity of cells in the body. Additionally, cell–cell interactions within the gel wall should not be overlooked as they mimic an important aspect of in vivo conditions. The amount of the testing drug and cells in the gel wall and the ratio between them can reduce or enhance by the gel wall thickness, which can be controlled by volume flow rates of solutions, and temperature. The reversible nature of the gel formation enables the repeated cell trapping and release.

7 Conclusion

In this study, the formation of a hydrogel structure termed “gel wall” inside a microfluidic chip was numerically investigated. The focus of this study is the thermothickening hydrogel Pluronic F127, which undergoes a phase transition from a liquid to a gel state at elevated temperatures when dissolved in water. The addition of a 0.5 M sodium phosphate solution, also known as a saline solution, significantly impacts the temperature at which Pluronic F127 forms a gel. As a result, the controlled diffusion of salt ions into the hydrogel structure can serve as an effective crosslinking technique. A microchannel device with a Y-shaped configuration is utilized to simultaneously flow parallel aqueous Pluronic F127 and saline solutions, thereby forming a gel wall. Since the flows in the microchannel are immiscible, diffusion has the key role in gel wall formation. Therefore, an investigation into the impact of the volume flow rates was conducted.

Based on the results discussed above, it can be inferred that when the volume flow rates are increased simultaneously, the rate of diffusion diminishes, resulting in a decrease in the thickness of the gel wall (Fig. 7). On the other hand, as the flow rate of Pluronic solution is increased, the impact of saline on Pluronic viscosity is reduced. Consequently, a rise in the flow rate of Pluronic solution results in a reduced thickness of the gel wall (Fig. 11). In contrast, augmenting the amount of saline leads to a thicker gel wall, as the concentration of saline at the interface between the flows increases. However, hydrogel structure becomes unstable and converts to liquid at concentrations higher than the critical concentrations (Ccritical = 0.253 M). As a result, past a specific point (volume flow rate of \(5 \times 10^{ - 11} {\text{m}}^{3} /{\text{s}}\)), increasing the volume flow rate of saline leads to a reverse effect, resulting in a decrease in the thickness of the gel wall (Fig. 12). In addition to volume flow rates, temperature plays a decisive role in Pluronic gel wall formation. At low temperatures (< 20 ℃), there is no gel wall formation. By increasing the temperature, viscosity increases dramatically throughout the domain and the gel wall occupies a larger portion of the channel. At 26 ℃, the gel wall thickness covers 29.4% of the channel width (Table 4).