Modelling of two phase flow in packed bed using conservation equations

In summary: Do you have an idea of a starting design for this system, such as overall diameter, packing type, void fraction, length, bed orientation (vertical or horizontal), flow direction, etc?This is a really good question. I think the first step is to come up with a rough design for the system, and then try to use the models we are going to develop to calculate some of the key properties.Let's brainstorm some preliminary models to get us started.1. Two phase flow of vapor and liquid in a bed is going to be pretty complicated, particularly if the pressure is changing and the residence time is large. Let's model what the isothermal behavior of the fluid
  • #141
casualguitar said:
Yep I have effectively nothing to add to this summary, other than we will need to calculate ##\frac{d\rho}{dh}## before \frac{d_{m1}}{dt}, which we can do with your liquid/vapour/liquid-vapour enthalpy density/temperature equationsI guess I'll still need equations 2 and 3 here? Or are you describing a simpler model?

So the idea would be to not calculate mass flow/enthalpy at each point, but assume it is constant throughout the vessel (as we did previously). Then we can use the mass equations to calculate the hold-up mass and the mass flow out at any time?
yes. All you are doing is adding output to what you already have from the lumped model. Nothing about the model itself changes. We are just looking at one additional output parameter from the model.
 
Engineering news on Phys.org
  • #142
Chestermiller said:
Once you know h at all the grid cells, you also know ##\rho## and T. And, once you know those, you also know ##d\rho/dt##
Just a passing thought for now, but if we know h and T (and P), then I think this would be enough to calculate x (quality) in future models, for pure fluids. Assuming we have real correlations for the vapour and liquid enthalpies, we could use the quality equation #h = xh_l + (1-x)h_v
Chestermiller said:
yes. All you are doing is adding output to what you already have from the lumped model. Nothing about the model itself changes. We are just looking at one additional output parameter from the model.
Ahh I see. I was about to overcomplicate. So essentially we know the inlet mass flow is constant, and I'm just tracking the holdup mass over time. Then ##m_{out} = m_{in} - m_{holdup}##. Should be easy to add in
 
  • #143
casualguitar said:
Just a passing thought for now, but if we know h and T (and P), then I think this would be enough to calculate x (quality) in future models, for pure fluids. Assuming we have real correlations for the vapour and liquid enthalpies, we could use the quality equation #h = xh_l + (1-x)h_v
We are going to do all this off-line. We've going to look at the functionality of T and rho as functions of h, and develop algebraic fits to this.
casualguitar said:
Ahh I see. I was about to overcomplicate. So essentially we know the inlet mass flow is constant, and I'm just tracking the holdup mass over time. Then ##m_{out} = m_{in} - m_{holdup}##. Should be easy to add in
No. We want to know ##\dot{m}## out of the tank, not the total mass in and out. We want to get practice calculating this directly from Eqns. 4, since that is what we will need for each tank in the multi-tank model. In the single tank model, it is strictly an output, not required to make the actual calculation.
 
  • #144
Chestermiller said:
In the single tank model, it is strictly an output, not required to make the actual calculation.
My apologies for the questions on this, but what does this line mean?

You're saying for this mass flow out calculation I do much calculations, such as set up a function for ##\frac{d\rho}{dh}##?

Or are you saying I should set this function up, use the ##\frac{d\h}{dt}## results from the previous single tank model, calculate results to eq. 4b using the newly calculated ##\frac{d\rho}{dh}## array and the old model ##\frac{d\h}{dt}## array results, and then use 4b output as 4a input, then graph 4a as a function of time?
 
  • #145
casualguitar said:
Just a passing thought for now, but if we know h and T (and P), then I think this would be enough to calculate x (quality) in future models, for pure fluids. Assuming we have real correlations for the vapour and liquid enthalpies, we could use the quality equation #h = xh_l + (1-x)h_v

Ahh I see. I was about to overcomplicate. So essentially we know the inlet mass flow is constant, and I'm just tracking the holdup mass over time. Then ##m_{out} = m_{in} - m_{holdup}##. Should be easy to add in
casualguitar said:
My apologies for the questions on this, but what does this line mean?

You're saying for this mass flow out calculation I do much calculations, such as set up a function for ##\frac{d\rho}{dh}##?

Or are you saying I should set this function up, use the ##\frac{d\h}{dt}## results from the previous single tank model, calculate results to eq. 4b using the newly calculated ##\frac{d\rho}{dh}## array and the old model ##\frac{d\h}{dt}## array results, and then use 4b output as 4a input, then graph 4a as a function of time?
Yes. That is exactly what I mean. Just calculate it from the old model results.
 
  • #146
Chestermiller said:
Yes. That is exactly what I mean. Just calculate it from the old model results.
Ah I see, understood. Will get on this tomorrow morning 👍
 
  • #147
Chestermiller said:
Yes. That is exactly what I mean. Just calculate it from the old model results.
Working on this. Having an issue extracting the dh/dt values into an array. The rest of the calculation is done though so this should be the only roadblock
 
  • #148
casualguitar said:
Working on this. Having an issue extracting the dh/dt values into an array. The rest of the calculation is done though so this should be the only roadblock
What’s the problem? You are already calculating dh/dt at each time step.
 
  • #149
Chestermiller said:
What’s the problem? You are already calculating dh/dt at each time step.
Exactly I have. I'm extracting the dh/dt value at each time interval which is giving an array of length 196, rather than the expected length of 4000. The mass holdup, dp/dh, and temperature arrays are all length 4000. I'm working on debugging currently
 
  • #150
casualguitar said:
Exactly I have. I'm extracting the dh/dt value at each time interval which is giving an array of length 196, rather than the expected length of 4000. The mass holdup, dp/dh, and temperature arrays are all length 4000. I'm working on debugging currently
Are you saying you store the results in an output array and write the array to an output file after you are done? If so, why aren't you just writing the results to an output file at each time step?
 
  • #151
Chestermiller said:
Are you saying you store the results in an output array and write the array to an output file after you are done? If so, why aren't you just writing the results to an output file at each time step?
Yes you're right I should do this. It seems I can specify the time range and number of solution points (for h and t), however I can't specify the number of Dh/dt points that are calculated (seems bizarre but there are a number of forums on stack exchange explaining the same).

So yes I should do what you said.

Here is the code for reference:
Screenshot 2021-11-24 at 16.14.24.png

Screenshot 2021-11-24 at 16.14.54.png

Screenshot 2021-11-24 at 16.15.27.png


Need a quick break now and will return to the code this evening
 
  • #152
casualguitar said:
Yes you're right I should do this. It seems I can specify the time range and number of solution points (for h and t), however I can't specify the number of Dh/dt points that are calculated (seems bizarre but there are a number of forums on stack exchange explaining the same).

So yes I should do what you said.

Here is the code for reference:
View attachment 292991
View attachment 292992
View attachment 292993
Within your present approach, name a new subscripted variable and set that equal to dh/dt each time step.
 
  • #153
Chestermiller said:
Within your present approach, name a new subscripted variable and set that equal to dh/dt each time step.
Similar to what I've done between lines 99 and 112?

For some reason I went straight for extracting dh/dt directly from the my_system function. Maybe this wasn't a good approach
 
  • #154
casualguitar said:
Similar to what I've done between lines 99 and 112?

For some reason I went straight for extracting dh/dt directly from the my_system function. Maybe this wasn't a good approach
I guess I'll stay out of this, and leave the coding to you.
 
  • #155
Chestermiller said:
I guess I'll stay out of this, and leave the coding to you.
I think your suggestion will work. Interesting how I was so focused on the first way I tried that I didn't attempt another.

Anyway I'll do this and post later this evening
 
  • #156
Chestermiller said:
I guess I'll stay out of this, and leave the coding to you.
Issue resolved. Just two questions:
1) How would you expect the mass flow out to vary over time?
2) I have a mass flow out array. I guess to convert to semi log I should do:
$$\dot{m}_{out, semilog}= \dot{m}_{j-1}-\dot{m}_{actual flow out}$$
Similar to the semi-log temperature plots?

Anyway this is the actual mass flow out versus time:
1637792466340.png

I have yet to proofread my calculations (doing this now). This plot seems to say that the mass flow out is constant up until the point of phase change, when it rapidly increases. Once the phase change is complete then the mass flow out stabilises back at the initial value.

The semi-log plot would just be the mirror of this plot through the x-axis I think
 
  • #157
1637794111756.png

Its a messy plot, but:
1) the blue line shows a constant mass holdup, a gradual decrease across the saturation zone (as liquid converts to vapour), and then a level out. I think this behaviour is expected
2) The purple line shows dp/dh = 0 in the liquid phase. As we move through the saturation zone dp/dh is negative, which I think is expected as density will decrease as enthalpy increases. Then it levels out after saturation as the change in density returns back to close to zero (not actually zero it reaches a minimum value of about -0.012 in this time range)

What I don't really understand is why the dp/dh value makes such a significant jump down at the beginning of saturation. I'm not sure if this is expected or not. Looking into this now
 
Last edited:
  • #158
casualguitar said:
Issue resolved. Just two questions:
1) How would you expect the mass flow out to vary over time?
2) I have a mass flow out array. I guess to convert to semi log I should do:
$$\dot{m}_{out, semilog}= \dot{m}_{j-1}-\dot{m}_{actual flow out}$$
Similar to the semi-log temperature plots?
No. You just have your graphics software change the vertical axis to logarithmic.
casualguitar said:
Anyway this is the actual mass flow out versus time:
View attachment 293026
I have yet to proofread my calculations (doing this now). This plot seems to say that the mass flow out is constant up until the point of phase change, when it rapidly increases. Once the phase change is complete then the mass flow out stabilises back at the initial value.

The semi-log plot would just be the mirror of this plot through the x-axis I think
Please have the software plot the horizontal axis from 15 seconds to 30 seconds only (i.e., expand the scale).

This is the way I expected the results to look.
 
  • #159
casualguitar said:
View attachment 293028
Its a messy plot, but:
1) the blue line shows a constant mass holdup, a gradual decrease across the saturation zone (as liquid converts to vapour), and then a level out. I think this behaviour is expected
2) The purple line shows dp/dh = 0 in the liquid phase. As we move through the saturation zone dp/dh is negative, which I think is expected as density will decrease as enthalpy increases. Then it levels out after saturation as the change in density returns back to close to zero (not actually zero it reaches a minimum value of about -0.012 in this time range)

What I don't really understand is why the dp/dh value makes such a significant jump down at the beginning of saturation. I'm not sure if this is expected or not. Looking into this now
You are replacing high density liquid with a mixture of low density vapor and high density liquid. So the vapor is taking a large part of the volume, and room is being made for this.

I'm going to be unavailable for a few days because of the Thanksgiving holiday. Daughter's family from out-of-town is staying with us.
 
  • #160
Chestermiller said:
This is the way I expected the results to look.
0 to 30s (bit awkward to plot 15 to 30, I'll fix that today):
Screenshot 2021-11-25 at 12.35.52.png

Chestermiller said:
You are replacing high density liquid with a mixture of low density vapor and high density liquid. So the vapor is taking a large part of the volume, and room is being made for this.
Understood
Chestermiller said:
I'm going to be unavailable for a few days because of the Thanksgiving holiday. Daughter's family from out-of-town is staying with us.
Sounds great!👍

If there's anything I can work on until next week I'd like to do that. I guess the model you described earlier is ready to go. If so, I can spend some time getting that right/cleaning the previous models

Thanks Chet and enjoy the holidays!
 
Last edited:
  • #161
casualguitar said:
0 to 30s (bit awkward to plot 15 to 30, I'll fix that today):
View attachment 293061

Understood

Sounds great!👍

If there's anything I can work on until next week I'd like to do that. I guess the model you described earlier is ready to go. If so, I can spend some time getting that right/cleaning the previous models

Thanks Chet and enjoy the holidays!
I'm back. What is the current status of the time- and spatial dependent model in your judgment?
 
  • #162
Chestermiller said:
I'm back. What is the current status of the time- and spatial dependent model in your judgment?
I was just about to comment.

I've spent yesterday evening and this evening summarising everything we've talked about into a powerpoint. Its about 90% done. I'll link it here via Google Drive or something tomorrow so anyone that might find this discussion useful in future can see it. It will now be easy to add in additional discussion to this as we go

I was actually going to ask you if the model you described in #127 ready to model or is there anything we haven't discussed in relation to this?

To answer my question - I've already got the mass flow out as a function of time part done (for the lumped parameter model as we previously talked about), so looking at your post #127 it seems good to go?
 
  • #163
casualguitar said:
I was just about to comment.

I've spent yesterday evening and this evening summarising everything we've talked about into a powerpoint. Its about 90% done. I'll link it here via Google Drive or something tomorrow so anyone that might find this discussion useful in future can see it. It will now be easy to add in additional discussion to this as we go

I was actually going to ask you if the model you described in #127 ready to model or is there anything we haven't discussed in relation to this?

To answer my question - I've already got the mass flow out as a function of time part done (for the lumped parameter model as we previously talked about), so looking at your post #127 it seems good to go?
I think you are ready to start coding on the full model. Allow the dimension of the dependent variables, solution vector, etc to be variable so that you can readily change the number of tanks. Your early calculations should be done using only three tanks, which has all the features of a many tank model while allowing for easier diagnostics and debugging.
 
  • #164
Chestermiller said:
Your early calculations should be done using only three tanks, which has all the features of a many tank model while allowing for easier diagnostics and debugging.
Got it, and I agree, three tanks sounds like a good approach. I'll start on this first thing tomorrow. Great
 
  • #165
Chestermiller said:
The computational flow goes like this:
1. Focus first on the 1st tank
2. We know m˙0 because this the mass flow rate into the bed.
3. Use Eqn. 2 to get dh1/dt
4. Use Eqn. 4b to get dm1/dt
5. Use Eqn. 4a to get m˙1 (the mass flow rate from tank 1 into tank 2)
6. Use Eqn. 3 to get dTS,1/dt
Repeat steps 3-6 for each subsequent tank until we have the time derivatives of h in all the tanks. Eqns. 4 tell us the mass flow rate into each subsequent tank (for use in Eqn. 2).
Just one question on the above.

Taking tank #1, using the above computational flow:
We know ##m_0##, the flow into the bed. This is flow ##m_{j-1}## in equation 2
We also know ##h_0##, the enthalpy of the flow entering the bed, which is ##h_{j-1}##
Unknowns here are ##m_j## and ##h_j##.

Your point 2 above says use eq.2 to find ##\frac{dh_1}{dt}##

We can make the following replacement: ##m_j=\rho_j(V/n)##

So here is where my confusion is:
We need to somehow solve for ##\rho_j##, so that we can then get ##\frac{dh_1}{dt}##. We do have relations for ##\rho_j##. Which relation for ##\rho_j## be use is based on the enthalpy, which we do not have at point j.

So my question is - are we actually using the enthalpy at point ##j-1## to choose the density correlation at point ##j##?
 
  • #166
casualguitar said:
Just one question on the above.

Taking tank #1, using the above computational flow:
We know ##m_0##, the flow into the bed. This is flow ##m_{j-1}## in equation 2
We also know ##h_0##, the enthalpy of the flow entering the bed, which is ##h_{j-1}##
Unknowns here are ##m_j## and ##h_j##.

Your point 2 above says use eq.2 to find ##\frac{dh_1}{dt}##

We can make the following replacement: ##m_j=\rho_j(V/n)##

So here is where my confusion is:
We need to somehow solve for ##\rho_j##, so that we can then get ##\frac{dh_1}{dt}##. We do have relations for ##\rho_j##. Which relation for ##\rho_j## be use is based on the enthalpy, which we do not have at point j.

So my question is - are we actually using the enthalpy at point ##j-1## to choose the density correlation at point ##j##?
We know these in all the tanks to begin with, because it is the initial condition. After that, they are known in all the tanks from the integration of the heat balance equation.
 
  • #167
Chestermiller said:
We know these in all the tanks to begin with, because it is the initial condition. After that, they are known in all the tanks from the integration of the heat balance equation.
Ah got it (really should have spotted that)

Actually a side question to this - I assume you've read a sizeable amount of books to get to the level of being able to answer such a wide range of questions on here, Stack Exchange, etc. I'd be curious to know what books stood out to you over the years? Not just thermo/ht related but anything at all under the umbrella of science/engineering

Working on the three tank model currently
 
  • #168
casualguitar said:
Ah got it (really should have spotted that)

Actually a side question to this - I assume you've read a sizeable amount of books to get to the level of being able to answer such a wide range of questions on here, Stack Exchange, etc. I'd be curious to know what books stood out to you over the years? Not just thermo/ht related but anything at all under the umbrella of science/engineering

Working on the three tank model currently
I'll try to answer this in a little while. Meanwhile, I wanted to call something important to your attention.

Now that we have decided to use the trick of employing numerical dispersion to simulate the actual dispersion in the bed, it opens up many possibilities. In particular, the unwinding scheme that this approach entails does not even involve the parameters for the tank on the right. That means that only parameters for the present tank and the one to the left come into play. That means that , we can do the implicit time integration for each tank in the sequence, in turn from left to right (one-at-a time) without having to include implicitly all the tanks at once. So we are solving for two unknowns at a time, rather the 2n unknowns at a time. So first you find the new values at the end of the time step for the first tank, then for the 2nd tank, then for the third tank, etc. Much simpler to implement.
 
  • #169
Chestermiller said:
That means that , we can do the implicit time integration for each tank in the sequence, in turn from left to right (one-at-a time) without having to include implicitly all the tanks at once.
Understood
Chestermiller said:
So we are solving for two unknowns at a time, rather the 2n unknowns at a time.
Understood also. So we can solve for all values in a tank, at all times, as long as we have the values in the tank to the left
 
  • #170
casualguitar said:
Understood

Understood also. So we can solve for all values in a tank, at all times, as long as we have the values in the tank to the left
Presumably. But the preferred approach would be for each time step to involve a sweep through the bed from left to right, one tank at a time. Note that the existing one tank model can be used right now to simulate the first tank in the sequence for all times, and this can be used as a partial check on the full model.
 
  • #171
Chestermiller said:
Presumably. But the preferred approach would be for each time step to involve a sweep through the bed from left to right, one tank at a time. Note that the existing one tank model can be used right now to simulate the first tank in the sequence for all times, and this can be used as a partial check on the full model.
Back on the model now (I try take the evening off for exercise/being outdoors to keep the head clear). I think the 3 tank model is clear to me now. Theres just a bit of code adjusting yet to do
 
  • Like
Likes Chestermiller
  • #172
Chestermiller said:
Presumably. But the preferred approach would be for each time step to involve a sweep through the bed from left to right, one tank at a time. Note that the existing one tank model can be used right now to simulate the first tank in the sequence for all times, and this can be used as a partial check on the full model.
Hi Chet, still working on sorting this out in my head.

Just one question. I am not exactly sure what I am assuming are the boundary/initial conditions, and what boundary/initial conditions are derived from these. It seems there are options for what parameters are assumed, and which are derived from the assumptions. So I'm wondering which parameters should I assume are known

For example:

Boundary conditions:
1)mass flow into the bed
2)temperature of the flow

Should I get the enthalpy from the temperature here?

And the initial conditions:
1) mass holdup
2) enthalpy of bed
3) temperature of bed
4) Temperature of fluid in bed
4) Density of bed

I guess the initial temperature of both the fluid and solid in the bed should be assumed here. Then the density, mass holdup, enthalpy can all be derived from this?
 
  • #173
casualguitar said:
Hi Chet, still working on sorting this out in my head.

Just one question. I am not exactly sure what I am assuming are the boundary/initial conditions, and what boundary/initial conditions are derived from these. It seems there are options for what parameters are assumed, and which are derived from the assumptions. So I'm wondering which parameters should I assume are known

For example:

Boundary conditions:
1)mass flow into the bed
2)temperature of the flow

Should I get the enthalpy from the temperature here?
Sure
casualguitar said:
And the initial conditions:
1) mass holdup
2) enthalpy of bed
3) temperature of bed
4) Temperature of fluid in bed
4) Density of bed

I guess the initial temperature of both the fluid and solid in the bed should be assumed here. Then the density, mass holdup, enthalpy can all be derived from this?
Do exactly the same thing you did for the 1 tank model.
 
  • #174
Chestermiller said:
Sure

Do exactly the same thing you did for the 1 tank model.
For that model I assumed H0 and Ts0 in the tank, so I found m, t and rho from H0.

Will do
 
  • #175
casualguitar said:
For that model I assumed H0 and Ts0 in the tank, so I found m, t and rho from H0.

Will do
You are assuming that the bed temperature and the temperature of the fluid in the bed are initially the same, right?
 

Similar threads

  • Materials and Chemical Engineering
13
Replies
427
Views
14K
Replies
18
Views
994
Replies
1
Views
713
Replies
2
Views
789
  • Classical Physics
2
Replies
48
Views
2K
Replies
20
Views
2K
  • Classical Physics
2
Replies
35
Views
2K
  • Special and General Relativity
2
Replies
67
Views
4K
  • Materials and Chemical Engineering
Replies
8
Views
8K
Replies
1
Views
1K
Back
Top