Modelling of two phase flow in packed bed using conservation equations

AI Thread Summary
The discussion focuses on deriving mass, momentum, and energy conservation equations for modeling two-phase fluid flow with phase changes in a porous medium. The goal is to track temperature changes and phase fronts over time, particularly in a cryogenic energy storage system. Preliminary modeling strategies suggest starting with simplified models to understand the system dynamics before adding complexity. Key considerations include pressure variations, residence time for phase changes, and the impact of axial dispersion on temperature uniformity within the bed. The participants aim to collaboratively brainstorm and refine these models to effectively address the complexities of the system.
  • #251
casualguitar said:
Got it. Its the way I'm regenerating the derivatives. Solved now!:
View attachment 293956
Excellent. Now how about plotting the temperature vs time for all three tanks, and also showing on the same plot the result from the single tank model for the overall bed.

casualguitar said:
So this leaves us at the point of having a working spatial variation model. We had discussed your ##M_i## model, however I haven't implemented this. Was this #M_i## model made purely to create a stepping stone between the single and multi tank model, or is there other reason to implement it?
No. It is mathematically equivalent to the multi-tank model, and I was offering it as a simpler alternative to program. Now that the existing multi-tank model is working, it would only be redundant and unnecessary.

How about next doing the liquid-only calculation with many more tanks and doing the 3 tank version with the full temperature range with inlet at 300 K?
 
Engineering news on Phys.org
  • #252
Chestermiller said:
Now how about plotting the temperature vs time for all three tanks, and also showing on the same plot the result from the single tank model for the overall bed.
On this now
Chestermiller said:
How about next doing the liquid-only calculation with many more tanks and doing the 3 tank version with the full temperature range with inlet at 300 K?
Got it so the first model just involves increasing n (to 32 for example)?

The second model just involves changing the inlet temperature to 300. Actually I will make another small change - right now I'm inefficiently manually calculating the inlet enthalpy so I'll just create a function for that

I'll try find a good way to blend plots from separate files into the same plot, because this sounds like something I'll need again (rather than going the other route of copying/pasting into the same file and changing variable names)
 
  • Like
Likes Chestermiller
  • #253
Chestermiller said:
How about next doing the liquid-only calculation with many more tanks
Got caught up with some report writing this evening. Back in action now

Heres the liquid-only plot with more tanks (n=32). Plotting the temperature profile for the first and last tank here:
Screenshot 2021-12-11 at 23.48.06.png

I checked this against the single tank plot for a 32x flowrate and they do match

Chestermiller said:
and doing the 3 tank version with the full temperature range with inlet at 300 K
I was about to post and noticed this plot was incorrect. I took out some gas functionality to simplify the code so I could spot the error. Its a quick job to put this back in so I'll do this first thing tomorrow
Chestermiller said:
Now how about plotting the temperature vs time for all three tanks, and also showing on the same plot the result from the single tank model for the overall bed.
Looking into a good way to do this overlay plot still. For now here it is as two separate plots:

Temperature vs time for all three tanks (liquid phase only):
Screenshot 2021-12-12 at 00.11.44.png

Screenshot 2021-12-12 at 00.12.11.png


So now we seem to have a working model for a single and multi-tank setup. I can think roughly about what the future models would hopefully look like, however to get there, what do you think are the next best steps?

So some simplifications we've made:
- The enthalpy/mass holdup relations. In previous posts you mentioned we would stick to correlations like these. If its an option then we can also use H(T,P) methods already made in other Python libraries i.e. just use a property calculation library to calculate enthalpy
- The heat of vaporisation. Right now we're leaving this as a constant. I have methods again from thermo libraries that treat this as a function of temperatures so we have the option to use this
- The saturation conditions. Right now we've got Tsat defined at the top as a constant. I have Tsat(P) functionality so I could use this no bother to get the saturation temperature
- The quality. Right now we get around the quality with the saturation zone relations
- The fluid. So assuming a pure fluid let's us have one saturation temperature. Air is a mixture so we'll have a bubble/dew point. This definitely sounds difficult to implement. That said I have a lot of useful functionality from the thermo property libraries like dew/bubble point temperature calculations for mixtures, Pressure-Enthalpy flash functionality, really anything we would need. So the important bit here is the actual algorithm, the functionality is available
- Lastly obviously we have constant heat capacity, etc. This can easily be switched out for temperature/pressure dependent values later on but yes its probably best to leave them as constant for now to avoid cluttering etc
- The U value. I've put a value of 1 (out of thin air). We could improve on that

From the above it seems that it might be best to stick with a pure fluid until we get to a late stage model, and then switch to a mixture. Developing the pure fluid model to late-stage would also give us the ability to test pure fluids in the packed bed

So yes, in terms of the next step or two, what do you think is best?
 

Attachments

  • Screenshot 2021-12-12 at 00.02.39.png
    Screenshot 2021-12-12 at 00.02.39.png
    16.5 KB · Views: 99
  • Screenshot 2021-12-12 at 00.07.51.png
    Screenshot 2021-12-12 at 00.07.51.png
    15.5 KB · Views: 106
  • Screenshot 2021-12-12 at 00.24.13.png
    Screenshot 2021-12-12 at 00.24.13.png
    15.7 KB · Views: 96
  • #254
casualguitar said:
Got caught up with some report writing this evening. Back in action now

Heres the liquid-only plot with more tanks (n=32). Plotting the temperature profile for the first and last tank here:
View attachment 293994
I checked this against the single tank plot for a 32x flowrate and they do match
What happened to tank 32? This seems to be only tanks 1 and 31.
casualguitar said:
I was about to post and noticed this plot was incorrect. I took out some gas functionality to simplify the code so I could spot the error. Its a quick job to put this back in so I'll do this first thing tomorrow

Looking into a good way to do this overlay plot still. For now here it is as two separate plots:

Temperature vs time for all three tanks (liquid phase only):
View attachment 293997
What happened to the 3rd tank? This looks like only tanks 1 and 2. Also, I was hoping you would show on this same plot for comparison the results from the single tank model for 1X the throughput rate.
casualguitar said:
View attachment 293998

So now we seem to have a working model for a single and multi-tank setup. I can think roughly about what the future models would hopefully look like, however to get there, what do you think are the next best steps?

So some simplifications we've made:
- The enthalpy/mass holdup relations. In previous posts you mentioned we would stick to correlations like these. If its an option then we can also use H(T,P) methods already made in other Python libraries i.e. just use a property calculation library to calculate enthalpy
- The heat of vaporisation. Right now we're leaving this as a constant. I have methods again from thermo libraries that treat this as a function of temperatures so we have the option to use this
Are you saying that you want to be more precise on the representation of density and temperature as a function of enthalpy at a given pressure? Or, are you saying that you want to allow the pressure to vary?
casualguitar said:
- The saturation conditions. Right now we've got Tsat defined at the top as a constant. I have Tsat(P) functionality so I could use this no bother to get the saturation temperature
- The quality. Right now we get around the quality with the saturation zone relations
- The fluid. So assuming a pure fluid let's us have one saturation temperature. Air is a mixture so we'll have a bubble/dew point. This definitely sounds difficult to implement. That said I have a lot of useful functionality from the thermo property libraries like dew/bubble point temperature calculations for mixtures, Pressure-Enthalpy flash functionality, really anything we would need. So the important bit here is the actual algorithm, the functionality is available

This is very easy to change so that, given a specified pressure, we can express density and temperature of the mixture as a function of enthalpy.
casualguitar said:
- Lastly obviously we have constant heat capacity, etc. This can easily be switched out for temperature/pressure dependent values later on but yes its probably best to leave them as constant for now to avoid cluttering etc
- The U value. I've put a value of 1 (out of thin air). We could improve on that
From the results so far, my guess is that UA is much higher than we are using.
casualguitar said:
From the above it seems that it might be best to stick with a pure fluid until we get to a late stage model, and then switch to a mixture. Developing the pure fluid model to late-stage would also give us the ability to test pure fluids in the packed bed

So yes, in terms of the next step or two, what do you think is best?
I agree. I would like to see you put the pure fluid model through its paces. Things I suggest are,

1. in addition to temperature vs time at the various spatial positions, also prepare plots of temperature vs position at a selection of times. The latter will illustrate how the wave is traveling through the bed.

2. corresponding plots for the solid bed

3. Varying the parameters for the model like mass flow rate to the bed and UA (higher UA would be particularly interesting)

Here is a calculation that I would like to see you do to get your feet wet on the mixture model: I have 1 mole of air (80% nitrogen, 20% oxygen) at 2 bars. What is the dew point and what is the bubble point? At a temperature half-way between the dew point and bubble point, what is the molar split of liquid and vapor, the mole fractions in the liquid phase, the mole fractions in the vapor phase, the density of the liquid phase, and the density of the vapor phase?
 
  • #255
Chestermiller said:
What happened to tank 32? This seems to be only tanks 1 and 31.
Chestermiller said:
What happened to the 3rd tank? This looks like only tanks 1 and 2.
Yes because its zero indexed its ##tank number = position number +1## so that is tank 32 and tank 3 respectively
Chestermiller said:
Also, I was hoping you would show on this same plot for comparison the results from the single tank model for 1X the throughput rate.
Working on a function to merge two plots now. Ok so we're saying the 3 tank plot for 0.05kg/s and the single tank plot for 0.05kg/s on the same plot? So we're expecting the last tank of the three tank plot should match the single tank plot
Chestermiller said:
Are you saying that you want to be more precise on the representation of density and temperature as a function of enthalpy at a given pressure? Or, are you saying that you want to allow the pressure to vary?
Yes to the pressure variation. Maybe not the most important next step but it would be nice to implement. Yes the functionality is there to have T(H,P) or something similar, and for representing density, there is also rho(T,P) or something like rho(H(T,P)). I'm not sure on which to use but we can use whichever is most convenient because I have property calculators for this
Chestermiller said:
This is very easy to change so that, given a specified pressure, we can express density and temperature of the mixture as a function of enthalpy.
Interesting so I can see how specifying pressure will get us Tsat and quality. I guess you're saying this for a pure fluid though? Actually though that's right I think knowing P and H at a point (and pure fluid properties) is enough to use a PH Flash calculation so we could get the composition of the liquid/gas, assuming P and H are known. This PH flash calculation functionality is also available and I have actually used it. However seeing your suggestion below to implement a simpler version of this I think is a good idea because I only have a vague idea of how that works
Chestermiller said:
1. in addition to temperature vs time at the various spatial positions, also prepare plots of temperature vs position at a selection of times. The latter will illustrate how the wave is traveling through the bed.
Can do
Chestermiller said:
2. corresponding plots for the solid bed
Can do
Chestermiller said:
3. Varying the parameters for the model like mass flow rate to the bed and UA (higher UA would be particularly interesting)
I'll plot a range of UA values on the same plot
Chestermiller said:
Here is a calculation that I would like to see you do to get your feet wet on the mixture model: I have 1 mole of air (80% nitrogen, 20% oxygen) at 2 bars. What is the dew point and what is the bubble point? At a temperature half-way between the dew point and bubble point, what is the molar split of liquid and vapor, the mole fractions in the liquid phase, the mole fractions in the vapor phase, the density of the liquid phase, and the density of the vapor phase?
I can do this very quickly in code as I have the functionality to set up an 80/20 N2/O2 mixture. I also have dew and bubble point methods set up. I can try to do this manually though because I don't know how it works. Is there any resource in particular that would give pointers for calculating dew/bubble point temperatures for mixtures? For the second bit I can use Raoults law
 
  • #256
casualguitar said:
Yes because its zero indexed its ##tank number = position number +1## so that is tank 32 and tank 3 respectively
On your plot, position 0 looks like nothing happened.
casualguitar said:
Working on a function to merge two plots now. Ok so we're saying the 3 tank plot for 0.05kg/s and the single tank plot for 0.05kg/s on the same plot?
Yes.
casualguitar said:
So we're expecting the last tank of the three tank plot should match the single tank plot
Not exactly. There should be some similarities, although the 1 tank is inherently more disperse than the 3rd tank of the three tank.
casualguitar said:
Yes to the pressure variation. Maybe not the most important next step but it would be nice to implement. Yes the functionality is there to have T(H,P) or something similar, and for representing density, there is also rho(T,P) or something like rho(H(T,P)). I'm not sure on which to use but we can use whichever is most convenient because I have property calculators for this

Interesting so I can see how specifying pressure will get us Tsat and quality. I guess you're saying this for a pure fluid though? Actually though that's right I think knowing P and H at a point (and pure fluid properties) is enough to use a PH Flash calculation so we could get the composition of the liquid/gas, assuming P and H are known. This PH flash calculation functionality is also available and I have actually used it. However seeing your suggestion below to implement a simpler version of this I think is a good idea because I only have a vague idea of how that works

Can do

Can do

I'll plot a range of UA values on the same plot

I can do this very quickly in code as I have the functionality to set up an 80/20 N2/O2 mixture. I also have dew and bubble point methods set up. I can try to do this manually though because I don't know how it works. Is there any resource in particular that would give pointers for calculating dew/bubble point temperatures for mixtures? For the second bit I can use Raoults law
I would start out by using Raoult's Law on all cases, unless you know more details about the non-iddalalities of the liquid or if you have actual VLE data on air.
 
  • #257
Chestermiller said:
On your plot, position 0 looks like nothing happened.

Yes.

Not exactly. There should be some similarities, although the 1 tank is inherently more disperse than the 3rd tank of the three tank.

I would start out by using Raoult's Law on all cases, unless you know more details about the non-iddalalities of the liquid or if you have actual VLE data on air.
Plot merging function is finished now (was a bit involved but it will be very useful), so I'll put together the plots mentioned in the posts above first thing tomorrow. All plots for both liquid/gas phase. These are the plots, unless I've forgotten any:
Screenshot 2021-12-12 at 23.09.31.png

I'll actually do that last calculation in code rather than as a hand calculation first
 
  • #258
Three tank plot for 0.05kg/s and single tank plot for 0.05kg/s:
Screenshot 2021-12-13 at 13.32.38.png

Fluid temperature versus position for a range of times (0,200,400,600,800,1000):
Screenshot 2021-12-13 at 15.23.00.png

Solid temperature versus position for a range of times (0,200,400,600,800,1000):
Screenshot 2021-12-13 at 15.24.02.png

The above are for n=3. Might be more visually interesting to see more spatial plots, so the same plots for n=32:
Fluid:
Screenshot 2021-12-13 at 15.29.40.png

Solid:
Screenshot 2021-12-13 at 15.33.42.png

Note: The time for the n=32 simulations to run to completion is about 2 minutes
 

Attachments

  • Screenshot 2021-12-13 at 15.39.03.png
    Screenshot 2021-12-13 at 15.39.03.png
    12.2 KB · Views: 122
  • Screenshot 2021-12-13 at 15.37.52.png
    Screenshot 2021-12-13 at 15.37.52.png
    11.7 KB · Views: 91
  • Screenshot 2021-12-13 at 15.37.16.png
    Screenshot 2021-12-13 at 15.37.16.png
    11.5 KB · Views: 95
  • Screenshot 2021-12-13 at 14.43.22.png
    Screenshot 2021-12-13 at 14.43.22.png
    18.1 KB · Views: 89
  • Screenshot 2021-12-13 at 14.21.06.png
    Screenshot 2021-12-13 at 14.21.06.png
    18.1 KB · Views: 104
  • #259
Hmm there is some code editing required to run a range of UA values. What I'll do for now is plot U = 1, 1.5 and 2 for the single tank:
View attachment 294079
Screenshot 2021-12-13 at 15.43.46.png

Screenshot 2021-12-13 at 15.40.32.png

Screenshot 2021-12-13 at 15.42.12.png

Setting up the code for the bubble/dew point/mole fraction calculation now
Edit: These UA plots don't make much sense to me yet. I thought increasing U would decrease the time required to reach 300K. So I need to think about this a bit
 

Attachments

  • Screenshot 2021-12-13 at 15.41.57.png
    Screenshot 2021-12-13 at 15.41.57.png
    11.6 KB · Views: 105
  • Screenshot 2021-12-13 at 15.41.21.png
    Screenshot 2021-12-13 at 15.41.21.png
    11.6 KB · Views: 88
  • #260
casualguitar said:
Three tank plot for 0.05kg/s and single tank plot for 0.05kg/s:
View attachment 294069
Fluid temperature versus position for a range of times (0,200,400,600,800,1000):
View attachment 294073
Solid temperature versus position for a range of times (0,200,400,600,800,1000):
View attachment 294074
The above are for n=3. Might be more visually interesting to see more spatial plots, so the same plots for n=32:
Fluid:
View attachment 294075
Solid:
View attachment 294076
Note: The time for the n=32 simulations to run to completion is about 2 minutes
I still have a problem with tank 1 in these which seems to show an instantaneous response of the temperature to the inlet temperature. It seems to me that this is just the inlet temperature to the bed. This part of the results just doesn't seem right to me. Maybe you can show the comparison for the liquid-only model for these same cases?
 
  • #261
Chestermiller said:
I still have a problem with tank 1 in these which seems to show an instantaneous response of the temperature to the inlet temperature
I agree here maybe by inlet conditions for the gas setup (300K) are incorrect
Chestermiller said:
Maybe you can show the comparison for the liquid-only model for these same cases?
Yes sounds good I'll compare to the liquid plots
 
  • #262
Chestermiller said:
I still have a problem with tank 1 in these which seems to show an instantaneous response of the temperature to the inlet temperature. It seems to me that this is just the inlet temperature to the bed. This part of the results just doesn't seem right to me. Maybe you can show the comparison for the liquid-only model for these same cases?
Liquid plot for n=3. I thought the initial conditions might have been set up correctly but no, at position 1 (index 0) the initial temperature is 80 and it rapidly rises to 90K (similar behaviour in the gas plot)
Screenshot 2021-12-13 at 22.01.21.png

The notation on the graph above is poor. 'Position 1' is at index 0. Position 1 is where the boundary conditions are applied. The way the code is set up, the bed/fluid temperatures for the entire bed are both set to 80K, and then the first position only is overwritten, and this is the boundary condition:
Screenshot 2021-12-13 at 22.26.10.png

So using that approach it is expected that the index 0 position would go straight to the inlet fluid temperature. It does this in the model that matches the analytical solution also

Because it matches the analytical solution for the single tank, I think this seems ok
 

Attachments

  • Screenshot 2021-12-13 at 22.04.58.png
    Screenshot 2021-12-13 at 22.04.58.png
    14.7 KB · Views: 103
  • #263
casualguitar said:
I'll actually do that last calculation in code rather than as a hand calculation first
Also this dew point/bubble point/composition calculation I will do this evening (have some report writing to finish out today)
 
  • #264
Chestermiller said:
Here is a calculation that I would like to see you do to get your feet wet on the mixture model: I have 1 mole of air (80% nitrogen, 20% oxygen) at 2 bars. What is the dew point and what is the bubble point? At a temperature half-way between the dew point and bubble point, what is the molar split of liquid and vapor, the mole fractions in the liquid phase, the mole fractions in the vapor phase, the density of the liquid phase, and the density of the vapor phase?
Screenshot 2021-12-14 at 11.12.09.png

Here is a rough solution to the calculation you mentioned above. The code should be fairly readable. You can see the Mixture setup about half way down, where the components and the mole fractions are defined. From there once we have the mixture defined there are bubble and dew point methods, and a flash method to get the liquid/vapour fractions and compositions.

One note here is that this is an ideal flash calculation. I do have the functionality for non-ideal flash. Its in another Github repository so I need to do some file moving to get it. This also has density methods for the liquid and vapour phases (or anything else we would need). For now here are some preliminary results from he above simulation:
Screenshot 2021-12-14 at 11.18.31.png

Screenshot 2021-12-14 at 11.19.05.png
 
  • #265
casualguitar said:
Liquid plot for n=3. I thought the initial conditions might have been set up correctly but no, at position 1 (index 0) the initial temperature is 80 and it rapidly rises to 90K (similar behaviour in the gas plot)
View attachment 294099
The notation on the graph above is poor. 'Position 1' is at index 0. Position 1 is where the boundary conditions are applied. The way the code is set up, the bed/fluid temperatures for the entire bed are both set to 80K, and then the first position only is overwritten, and this is the boundary condition:
View attachment 294101
So using that approach it is expected that the index 0 position would go straight to the inlet fluid temperature. It does this in the model that matches the analytical solution also

Because it matches the analytical solution for the single tank, I think this seems ok
I'm totally confused about this. Are you saying that the overwrite the results for the first tank with the inlet condition, so it is not really the temperature vs time of the material in the first tank? If so, we never get to see the temperature vs time for the first tank? What about the subsequent tanks, are they somehow overwritten too? Why do you overwrite the first tank? That is of much more interest than the inlet condition. If this is what you do, please undo it.
 
  • #266
casualguitar said:
View attachment 294124
Here is a rough solution to the calculation you mentioned above. The code should be fairly readable. You can see the Mixture setup about half way down, where the components and the mole fractions are defined. From there once we have the mixture defined there are bubble and dew point methods, and a flash method to get the liquid/vapour fractions and compositions.

One note here is that this is an ideal flash calculation. I do have the functionality for non-ideal flash. Its in another Github repository so I need to do some file moving to get it. This also has density methods for the liquid and vapour phases (or anything else we would need). For now here are some preliminary results from he above simulation:
View attachment 294125
View attachment 294126
Does the flash calculation assume constant enthalpy? if so, the temperature changes, right? What is the final temperature. I was hoping for a hand calculation on your part. Do you know how to set up the equations for such a hand calculation, assuming ideal mixing and ideal gas behavior?
 
  • #267
Chestermiller said:
I'm totally confused about this. Are you saying that the overwrite the results for the first tank with the inlet condition, so it is not really the temperature vs time of the material in the first tank? If so, we never get to see the temperature vs time for the first tank? What about the subsequent tanks, are they somehow overwritten too? Why do you overwrite the first tank? That is of much more interest than the inlet condition. If this is what you do, please undo it.
Pasted File at December 14, 2021 12_51 PM.png

There we go. You were right the results for tank 1 were being overwritten by the initial conditions. Obvious mistake looking back. The highest graph now shows the actual behaviour in tank 1, rather than the initial conditions.

Chestermiller said:
Does the flash calculation assume constant enthalpy? if so, the temperature changes, right? What is the final temperature. I was hoping for a hand calculation on your part. Do you know how to set up the equations for such a hand calculation, assuming ideal mixing and ideal gas behavior?
I don't know actually. I took a look at the calculation (in code form) and its not clear to me. Yes I agree a hand calculation for the ideal flash would be useful to get a grip on how it works. I don't know how to set up the equations for this, I can figure this out though

After that hand calculation I'll redo the code with the real flash (and real mixture) methods. I guess this would be too involved to do by hand, however knowing how ideal flash works will give some insight into real flash calculations

I have a report due that I will finish this evening so I'll be back on the ideal flash hand calculation first thing tomorrow morning
 
  • #268
Chestermiller said:
Here is a calculation that I would like to see you do to get your feet wet on the mixture model: I have 1 mole of air (80% nitrogen, 20% oxygen) at 2 bars. What is the dew point and what is the bubble point? At a temperature half-way between the dew point and bubble point, what is the molar split of liquid and vapor, the mole fractions in the liquid phase, the mole fractions in the vapor phase, the density of the liquid phase, and the density of the vapor phase?
The bubble/dew point:

So we can use the Antoine equation and Raoult's law iteratively (bisection method) here to solve for both the de and bubble point temperatures

Algorithm for this could be as follows:
1) Set a temperature range that will capture the dew/bubble points (the boiling points of N2 and O2 at 2 bar for example)
2) Calculate the vapour pressure of N2 and O2 with the Antoine equation (using temperature)
3) Calculate the vapour composition of both components using Raoult's law
4) Sum both vapour compositions (O2+N2)

For the bubble point: Depending on if the sum of the vapour compositions is greater than or less than 1, update the temperature bounds accordingly and repeat

For the dew point: Depending on if the sum of the vapour compositions is greater than or less than 1, update the temperature bounds accordingly and repeat

Now that I follow the algorithm, this is the algorithms in code (I don't think there's value in writing this out):
Screenshot 2021-12-15 at 12.27.29.png

Air dew and bubble point temperatures at 2 bar:
screenshot-2021-12-14-at-11-18-31-png.png


The density of the liquid and vapour phases should be fine. I could use two correlations (one for vapour and and one for liquid density) and get a weighted average based on the composition of each phase

Getting the phase molar split and phase compositions seems more involved. Reading up on this now
 
  • #269
casualguitar said:
The bubble/dew point:

So we can use the Antoine equation and Raoult's law iteratively (bisection method) here to solve for both the de and bubble point temperatures

Algorithm for this could be as follows:
1) Set a temperature range that will capture the dew/bubble points (the boiling points of N2 and O2 at 2 bar for example)
2) Calculate the vapour pressure of N2 and O2 with the Antoine equation (using temperature)
3) Calculate the vapour composition of both components using Raoult's law
4) Sum both vapour compositions (O2+N2)

For the bubble point: Depending on if the sum of the vapour compositions is greater than or less than 1, update the temperature bounds accordingly and repeat

For the dew point: Depending on if the sum of the vapour compositions is greater than or less than 1, update the temperature bounds accordingly and repeat

Now that I follow the algorithm, this is the algorithms in code (I don't think there's value in writing this out):
View attachment 294188
Air dew and bubble point temperatures at 2 bar:
View attachment 294189

The density of the liquid and vapour phases should be fine. I could use two correlations (one for vapour and and one for liquid density) and get a weighted average based on the composition of each phase

Getting the phase molar split and phase compositions seems more involved. Reading up on this now
Given that there is only a 3 degree range between the bubble point and dew point, it won't make a significant difference (considering all the other uncertainties in the model), if you just use the existing model with Tsat equal to 86.7 K, and the change in enthalpy of vaporization equal to the molar weighted average of the molar heats of vaporization. What do you think?
 
  • #270
Chestermiller said:
Given that there is only a 3 degree range between the bubble point and dew point, it won't make a significant difference (considering all the other uncertainties in the model), if you just use the existing model with Tsat equal to 86.7 K, and the change in enthalpy of vaporization equal to the molar weighted average of the molar heats of vaporization. What do you think?
This could be very useful yes I like this idea also. It would also simplify the next stage of modelling fairly significantly so let's do it. I will change my Tsat constant (in the existing model) to a dew/bubble temperature point calculation, as the pressure may vary from 2 bar. This fits in well. For the enthalpy of vaporisation I have temperature dependent correlations so these could fit well here instead of a weighted average also. This would mean it would no longer be constant but would update based on fluid temperature.

Because of the above change I want to mention another model goal that I had not mentioned previously now. My initial thought was that this model would come after the air liquefaction model, however given your message above to remove the dew/bubble point and use a single Tsat, I want to mention it now instead, in case it does have a short term affect on the direction this model takes.

So this cryogenic packed bed currently takes liquid air and vaporises it, leaving a cold packed bed. Or vice versa. The bed will at some point be required to take a CO2 enriched air stream (CO2/N2/O2), and separate the CO2 via CO2 solidification (or liquefaction). If we are taking the air dew/bubble points as a single temperature (say the average of the two), then this might be a good time to add CO2 to the model, because we could also assume this has its own liquefaction temperature i.e. we would have two condensation temperatures, one for CO2 and one for 'Air'. I wanted to mention this now in case it has any effect on the direction of our discussion

So the idea here is to take a CO2/N2/O2 stream as input, and to freeze (or potentially just liquefy) out the CO2 in the stream, to separate the CO2 from the air. It is essentially giving the packed bed both the capability to store energy and to capture CO2.

As for modelling capability, I have any functionality we would need to set up flue gas mixtures of varying compositions, methods to calculate densities of each phase, heat capacity correlations etc

So looking at the above, maybe first incorporating the enthalpy of vaporisation to the air only model might be a good next step. I can do either the weighted average approach like you mentioned, or I can use the temperature dependent correlations for latent heat.

What are your thoughts on that as a next step? Apologies I know dropping CO2 into the discussion is potentially a big deviation. If we can continue on developing the pure air model, forget about CO2 for now, and add CO2 once we've put the pure model through its paces that suits perfectly also. As I say I just wanted to mention it to put it in the background of the discussion
 
  • #271
casualguitar said:
So some simplifications we've made:
1) The enthalpy/mass holdup relations. In previous posts you mentioned we would stick to correlations like these. If its an option then we can also use H(T,P) methods already made in other Python libraries i.e. just use a property calculation library to calculate enthalpy
2) The heat of vaporisation. Right now we're leaving this as a constant. I have methods again from thermo libraries that treat this as a function of temperatures so we have the option to use this
3) The saturation conditions. Right now we've got Tsat defined at the top as a constant. I have Tsat(P) functionality so I could use this no bother to get the saturation temperature
4) The quality. Right now we get around the quality with the saturation zone relations
5) The fluid. So assuming a pure fluid let's us have one saturation temperature. Air is a mixture so we'll have a bubble/dew point. This definitely sounds difficult to implement. That said I have a lot of useful functionality from the thermo property libraries like dew/bubble point temperature calculations for mixtures, Pressure-Enthalpy flash functionality, really anything we would need. So the important bit here is the actual algorithm, the functionality is available
6) We have constant heat capacity, etc. This can easily be switched out for temperature/pressure dependent values later on but yes its probably best to leave them as constant for now to avoid cluttering etc
7) The U value. I've put a value of 1 (out of thin air). We could improve on that
Going back to this list above, I wanted to comment on each item to get a sense for what the next best steps might be (also I'm mostly forgetting about the above CO2 comment for now unless you think we should do otherwise):

Commenting on each point in the list above:
1) Forget about this for now

2) Use a single value for both the heat of vaporisation of O2 and N2 i.e. do not have a temperature dependent heat of vaporisation, and use the weighted value as you mentioned i.e. ##\Delta H_{AIR} = x\Delta H_{N2} + (1-x)\Delta H_{O2}## where ##x## is the mole fraction of ##N2## in the feed

3) As mentioned by you we can simplify the dew/bubble point model. I will add a dew/bubble point calculation to the model dewT(P), bubbleT(P), then take the average of the two values and use this as Tsat. This would be nice as we would have a constant temperature zone that would allow us to see the change in vapour/liquid fraction across this zone.

4) Similar to above, given the new assumption of a single saturation temperature we should be able to model the quality in the constant temperature zone

5) As mentioned above, simplifying to one Tsat rather than dew/bubble points. Those flash libraries will still be useful here (possibly for the quality calculations)

6) I can sub in temperature/pressure dependent heat capacity, heat of vaporisation, density at any point with the thermo property libraries. Maybe this is best left until nearer the end of this model to avoid cluttering and to simplify any debugging

7) I could use some correlations here to get a better estimate however it seems like this value will be a tuning parameter anyway

So right now I could:
1) Add the weighted heat of vaporisation
2) Add the Tsat calculation (average of dew and bubble T at a given pressure)

This is straightforward so I'll do this right now
 
  • #272
casualguitar said:
Going back to this list above, I wanted to comment on each item to get a sense for what the next best steps might be (also I'm mostly forgetting about the above CO2 comment for now unless you think we should do otherwise):

Commenting on each point in the list above:
1) Forget about this for now

2) Use a single value for both the heat of vaporisation of O2 and N2 i.e. do not have a temperature dependent heat of vaporisation, and use the weighted value as you mentioned i.e. ##\Delta H_{AIR} = x\Delta H_{N2} + (1-x)\Delta H_{O2}## where ##x## is the mole fraction of ##N2## in the feed
For the model, you would, of course, dividing by the MW to get the heat of vaporization per unit mass.
casualguitar said:
3) As mentioned by you we can simplify the dew/bubble point model. I will add a dew/bubble point calculation to the model dewT(P), bubbleT(P), then take the average of the two values and use this as Tsat. This would be nice as we would have a constant temperature zone that would allow us to see the change in vapour/liquid fraction across this zone.

4) Similar to above, given the new assumption of a single saturation temperature we should be able to model the quality in the constant temperature zone

5) As mentioned above, simplifying to one Tsat rather than dew/bubble points. Those flash libraries will still be useful here (possibly for the quality calculations)

6) I can sub in temperature/pressure dependent heat capacity, heat of vaporisation, density at any point with the thermo property libraries. Maybe this is best left until nearer the end of this model to avoid cluttering and to simplify any debugging

7) I could use some correlations here to get a better estimate however it seems like this value will be a tuning parameter anyway

So right now I could:
1) Add the weighted heat of vaporisation
2) Add the Tsat calculation (average of dew and bubble T at a given pressure)

This is straightforward so I'll do this right now
If you wanted, you could also replace constant Tsat zone with a range between the dew point and bubble point. In this range, you would parameterize T and ##\rho## as functions of h. So the model would still have 3 zones, but T would not be constant in the middle zone. I still contend that this minor change would not be worth the effort.

I would still like to see a comparison between the position model and the single tank model using the full temperature range, and comparing the 32-tank results from the position model with for the first tank with those using the single tank model with 32x the mass flow rate.

Regarding systems involving air and CO2, you can start figuring out how to do stand-alone phase change calculations involving lowering the temperature at constant pressure until a liquid or solid starts forming. Check out the thermodynamic diagrams for CO2 to get an idea what happens first for anticipated the concentrations in your mixtures.
 
  • #273
Chestermiller said:
If you wanted, you could also replace constant Tsat zone with a range between the dew point and bubble point. In this range, you would parameterize T and ρ as functions of h. So the model would still have 3 zones, but T would not be constant in the middle zone. I still contend that this minor change would not be worth the effort.
Ah I follow, like in one of our previous models with T1>T<T2. Yes I will note this as a minor change that I can make at a later point but yes I agree the constant Tsat does sound like a nice simplification to work with for now
Chestermiller said:
I would still like to see a comparison between the position model and the single tank model using the full temperature range, and comparing the 32-tank results from the position model with for the first tank with those using the single tank model with 32x the mass flow rate.
Got it, yes I haven't remade these after the initial condition fix. I'll regenerate these using the correct initial conditions now
Chestermiller said:
Regarding systems involving air and CO2, you can start figuring out how to do stand-alone phase change calculations involving lowering the temperature at constant pressure until a liquid or solid starts forming. Check out the thermodynamic diagrams for CO2 to get an idea what happens first for anticipated the concentrations in your mixtures.
Will do. It sounds like you're saying leave this until the air model is more developed, so yes I'll just take a look at the thermodynamic diagrams for CO2 and a few papers that model this kind of thing for now

Anyway that Tsat calculation is finished (yet to do the Hvap one but this is even simpler). I'll get the single tank/position model plots done now
 
  • #274
Chestermiller said:
I would still like to see a comparison between the position model and the single tank model using the full temperature range, and comparing the 32-tank results from the position model with for the first tank with those using the single tank model with 32x the mass flow rate.
Position versus temperature for a range of times.
Screenshot 2021-12-16 at 15.22.04.png

Time versus temperature for the n=32 model, for a number of tanks in the spatial variation model, and the single tank model. The first tank matches up with the single tank model almost exactly:
Screenshot 2021-12-16 at 16.28.43.png

The single tank is hard to see but its there behind position 1. One thing that stands out to me here is the shape of the temperature distribution for each point. Its close to right angled. So the temperature at each point stays at about 80K, until the 'wave' reaches the tank, then the temperature jumps quickly, and after the wave passes the temperature just gradually increases again. This would suggest very low axial dispersion I think? How does the above look to you?

Will add those small Tsat/Hvap changes this evening
 

Attachments

  • Screenshot 2021-12-16 at 16.20.58.png
    Screenshot 2021-12-16 at 16.20.58.png
    17.4 KB · Views: 96
  • #275
casualguitar said:
Position versus temperature for a range of times.
View attachment 294269
Time versus temperature for the n=32 model, for a number of tanks in the spatial variation model, and the single tank model. The first tank matches up with the single tank model almost exactly:
View attachment 294276
The single tank is hard to see but its there behind position 1. One thing that stands out to me here is the shape of the temperature distribution for each point. Its close to right angled. So the temperature at each point stays at about 80K, until the 'wave' reaches the tank, then the temperature jumps quickly, and after the wave passes the temperature just gradually increases again. This would suggest very low axial dispersion I think? How does the above look to you?
I'm wondering why there is no temporary leveling off at Tsat, and why there are sharp changes in slope with time at various positions. Also, what are the solid bed temperature variations with time at the various positions? (I did expect the wave to travel through the bed gradually at the lowest temperature as the graph shows)
 
  • #276
Chestermiller said:
I'm wondering why there is no temporary leveling off at Tsat, and why there are sharp changes in slope with time at various positions.
The sharp change I think is because that's the 3 tank model. This is the same plot for n=32, so these changes are smoothed out:
Screenshot 2021-12-16 at 23.45.11.png

The model takes 2-3 minutes to run now each time so I'll look into speeding this up

The temporary levelling off at Tsat does happen, however since the system is increasing in temperature quite quickly this zone is short:
Screenshot 2021-12-17 at 00.10.47.png

Zooming in on it (a lot) you can see at 105K (Tsat) there is a levelling off of the curve to a constant saturation temperature of 105K. Its just a few seconds of saturation and then single phase again. Note this graph is n=32 (incorrect title however I left it as it takes a while to regenerate)
Chestermiller said:
Also, what are the solid bed temperature variations with time at the various positions?

Solid bed temperature variations at various positions here:
Screenshot 2021-12-17 at 00.00.15.png

If the above looks ok to you I'll add the new Tsat (based on pressure) and the new heat of vaporisation weighted average (and check that the output remains about the same)
 

Attachments

  • Screenshot 2021-12-16 at 23.49.00.png
    Screenshot 2021-12-16 at 23.49.00.png
    16.1 KB · Views: 93
  • Like
Likes Chestermiller and PhDeezNutz
  • #277
casualguitar said:
If the above looks ok to you I'll add the new Tsat (based on pressure) and the new heat of vaporisation weighted average (and check that the output remains about the same)
Added both the Tsat and Hvap changes. So now Tsat is the average of the dew and bubble points at a given pressure, and the heat of vaporisation is the weighted average of the O2 and N2 heats of vaporisation, and I've taken them both as constants for now. I can add temperature dependent Hvap later easily:

Position versus temperature for a range of times:
Screenshot 2021-12-18 at 22.01.18.png


Time versus temperature for a range of positions, for n=32:
Screenshot 2021-12-18 at 22.03.12.png
Zooming into show the levelling off at Tsat, 87K or so as expected
Screenshot 2021-12-18 at 22.02.08.png


Going back to these points:
casualguitar said:
Commenting on each point in the list above:
1) Forget about this for now

2) Use a single value for both the heat of vaporisation of O2 and N2 i.e. do not have a temperature dependent heat of vaporisation, and use the weighted value as you mentioned i.e. ΔHAIR=xΔHN2+(1−x)ΔHO2 where x is the mole fraction of N2 in the feed

3) As mentioned by you we can simplify the dew/bubble point model. I will add a dew/bubble point calculation to the model dewT(P), bubbleT(P), then take the average of the two values and use this as Tsat. This would be nice as we would have a constant temperature zone that would allow us to see the change in vapour/liquid fraction across this zone.

4) Similar to above, given the new assumption of a single saturation temperature we should be able to model the quality in the constant temperature zone

5) As mentioned above, simplifying to one Tsat rather than dew/bubble points. Those flash libraries will still be useful here (possibly for the quality calculations)

6) I can sub in temperature/pressure dependent heat capacity, heat of vaporisation, density at any point with the thermo property libraries. Maybe this is best left until nearer the end of this model to avoid cluttering and to simplify any debugging

7) I could use some correlations here to get a better estimate however it seems like this value will be a tuning parameter anyway

So right now I could:
1) Add the weighted heat of vaporisation
2) Add the Tsat calculation (average of dew and bubble T at a given pressure)
Points 2,3,5 are now implemented. Forgetting point 1 for now, we've got 4,6,7 left

4) Modelling the quality.
6) Using temperature dependent heat capacity, heat of vaporisation, density
7) A correlation for U

Leaving 6 until the end, and leaving 7 until the end also (or leaving it out completely) seems like a good approach. So this leaves us with 4) modelling the quality

My thoughts here are that we've got Tsat, and we know fluid enthalpy across the whole phase change zone. So if we got a correlation for saturated liquid enthalpy, and saturated vapour enthalpy, we can get X (liquid quality) at any time with: $$h = xh_{SAT,L} + (1-x)h_{SAT,V}$$ So we really don't need any core model adjustments to model quality, we just need those two saturated liquid/vapour enthalpy correlations. We can get a correlation or I can use the thermo property library to get these. Does this sound correct, and does this sound like a reasonable next step to you?
 
Last edited:
  • #278
casualguitar said:
Added both the Tsat and Hvap changes. So now Tsat is the average of the dew and bubble points at a given pressure, and the heat of vaporisation is the weighted average of the O2 and N2 heats of vaporisation, and I've taken them both as constants for now. I can add temperature dependent Hvap later easily:

Position versus temperature for a range of times:
View attachment 294403

Time versus temperature for a range of positions, for n=32:
View attachment 294405Zooming into show the levelling off at Tsat, 87K or so as expected
View attachment 294404

Going back to these points:

Points 2,3,5 are now implemented. Forgetting point 1 for now, we've got 4,6,7 left

4) Modelling the quality.
6) Using temperature dependent heat capacity, heat of vaporisation, density
7) A correlation for U

Leaving 6 until the end, and leaving 7 until the end also (or leaving it out completely) seems like a good approach. So this leaves us with 4) modelling the quality

My thoughts here are that we've got Tsat, and we know fluid enthalpy across the whole phase change zone. So if we got a correlation for saturated liquid enthalpy, and saturated vapour enthalpy, we can get X (liquid quality) at any time with: $$h = xh_{SAT,L} + (1-x)h_{SAT,V}$$ So we really don't need any core model adjustments to model quality, we just need those two saturated liquid/vapour enthalpy correlations. We can get a correlation or I can use the thermo property library to get these. Does this sound correct, and does this sound like a reasonable next step to you?
This can be evaluated directly from the model, since we are taking the enthalpy of the saturated liquid as zero in the model and the enthalpy of the saturated vapor as the heat of vaporization (our region 2 equations). So the vapor quality from the model is just ##h/\Delta h_{vap}##.
 
  • #279
Chestermiller said:
since we are taking the enthalpy of the saturated liquid as zero in the model and the enthalpy of the saturated vapor as the heat of vaporization (our region 2 equations)
Ah understood. I guess we'll also need a conditional statement for the quality array saying 'if H/Hvap is < 0 then vapour quality is 0, or H>hVap then quality is 1'.

Here is time vs H and T for tank 1 (3 tank system). The liquid and saturated zones do seem to allow for rapid increase of temperature (the graph is almost vertical in these zones). This slows down a lot for the vapour phase, and it looks a lot more natural.
Screenshot 2021-12-19 at 15.25.14.png


Zooming in on the saturation zone:
Screenshot 2021-12-19 at 15.33.16.png


So as enthalpy reaches 200, the temperature also does the large jump from approx 87K to 210K, meaning that our saturation zone correlations predict very fast increases in temperature across this zone

Anyway here's the plot of vapour quality for each of the 3 tanks:
Screenshot 2021-12-19 at 16.48.04.png

So the saturation zone lasts 1 to 2 seconds approx in each tank

And here's the code I used to create the vapour quality array:
Screenshot 2021-12-19 at 16.49.38.png


Hmm, looking at the remaining model additions, maybe the temperature/pressure dependent properties (heat capacity, density, heat of vaporisation, dp/dh) might be a reasonable next addition? This would mean replacing the temperature/mass functions also, with correlations available in the thermo library

Do you think there are other changes we should make before this?

Also just as a note - here's the bubble/dew point code just to get an idea of how it looks to set up:
Screenshot 2021-12-19 at 16.58.04.png
 
Last edited:
  • #280
casualguitar said:
Hmm, looking at the remaining model additions, maybe the temperature/pressure dependent properties (heat capacity, density, heat of vaporisation, dp/dh) might be a reasonable next addition? This would mean replacing the temperature/mass functions also, with correlations available in the thermo library
Just as a side note I've imported the required functionality for temperature dependent heat capacity and heat of vaporisation (not implemented, just ready to implement).

The heat capacity functionality calculates ##Cp## at a given temperature. The heat of vaporisation function returns the heat of vaporisation for 'all elements in the mixture at the given temperature' so in our case it will return ##hVap## for ##N2## and ##O2##. I can use the weighted average function I made so we can use one value for ##hVap## of air

For density, I've also got this functionality imported and ready to implement if you think this is a good next step. It calculates the weighted average of the O2 and N2 densities at a given temperature. If the phases of ##O2## and ##N2## are different (this occurs for a very small range of temperatures) then it will still calculate a weighted average.

However, actually looking at the code for the model, ##Cp## and ##hVap## only occur in the temperature(H), mass(H) and dpdh(H) functions, so it may be better so sub out these entire functions rather than just ##Cp## and ##hVap##

A possible substitution for the first two functions might be:
temperature(H):
- We know ##H## and ##P##, and also the composition of the mixture, so I think we have enough to do a flash calculation here to calculate the temperature at these conditions of ##H## and ##P##

mass(H):
- if vessel volume is known (it is), then we could use the density functionality from the thermo library to get density, which allows us to calculate mass holdup

dpdh(H):
- haven't found a solution to this one yet. I guess this functionality exists also. but I haven't found it yet
 
  • #281
You seem intent on doing this. For an ideal liquid mixture and vapor mixture, the VLE equations are going to be $$\frac{xP_{N2}^*(T)}{P}+\frac{(1-x)P_{O2}^*(T)}{P}=1$$$$y=\frac{xP_{N2}^*(T)}{P}$$$$L+V=1$$and $$Lx+Vy=z$$or$$L(z-x)=V(y-z)$$where P is the total pressure, x is the mole fraction N2 in the liquid, y is the mole fraction N2 in the vapor, z is the mole fraction N2 in the combination of vapor and liquid (i.e., 0.8), L is the molar fraction liquid, V is the molar fraction vapor, and starred quantities are the equilibrium vapor pressures of the pure components. OK so far?
 
  • #282
Chestermiller said:
You seem intent on doing this. For an ideal liquid mixture and vapor mixture, the VLE equations are going to be $$\frac{xP_{N2}^*(T)}{P}+\frac{(1-x)P_{O2}^*(T)}{P}=1$$$$y=\frac{xP_{N2}^*(T)}{P}$$$$L+V=1$$and $$Lx+Vy=z$$or$$L(z-x)=V(y-z)$$where P is the total pressure, x is the mole fraction N2 in the liquid, y is the mole fraction N2 in the vapor, z is the mole fraction N2 in the combination of vapor and liquid (i.e., 0.8), L is the molar fraction liquid, V is the molar fraction vapor, and starred quantities are the equilibrium vapor pressures of the pure components. OK so far?
Good so far!
 
  • #283
casualguitar said:
Good so far!
Once the overall mole fraction of N2 is specified (0.8), and the temperature and pressure are known, the mole fractions of N2 and O2 in the liquid and vapor are known, and so is the liquid vapor molar split L and V. This would then allow us to determine the molar enthalpy and density of the liquid vapor mixture. So for our mixture of z = 0.8, we can determine molar H(T,P) and molar ##\rho(T,P)##. This would also enable us to determine T(H,P) and ##\rho(H,P)## in the 2 phase region. So, for the 2 phase region, we could parameterize temperature and density as functions of molar enthalpy and pressure, say, using a quadratic fit. This would give us all we need for the 2 phase region.
 
  • #284
Chestermiller said:
Once the overall mole fraction of N2 is specified (0.8), and the temperature and pressure are known, the mole fractions of N2 and O2 in the liquid and vapor are known, and so is the liquid vapor molar split L and V.
I fully follow up to this point
Chestermiller said:
This would then allow us to determine the molar enthalpy and density of the liquid vapor mixture. So for our mixture of z = 0.8, we can determine molar H(T,P) and molar ρ(T,P).
I agree that knowing the temperature, pressure, the composition of the liquid/vapour phases, and the liquid vapour molar split is enough information to find the molar enthalpy/density of the mixture. So yes I also agree that we can get ##H(T,P)## and ##\rho(T,P)##.

I have a point of confusion in that its not clear to me what use ##H(T,P)## is, if we already have the fluid energy/mass balances though. I think if we continue on with the algorithm discussion this will become clear though
Chestermiller said:
So, for the 2 phase region, we could parameterize temperature and density as functions of molar enthalpy and pressure, say, using a quadratic fit. This would give us all we need for the 2 phase region.
I follow this if you are saying we can get existing ##T(H,P)## and ##\rho(T,P)## fits from literature data?

Also a note: The above is for an ideal liquid/vapour mixture. I think it will be useful to code this manually once I understand it, and then later use existing functionality to implement this for real mixtures. What do you think?
 
Last edited:
  • #285
casualguitar said:
I fully follow up to this point

I agree that knowing the temperature, pressure, the composition of the liquid/vapour phases, and the liquid vapour molar split is enough information to find the molar enthalpy/density of the mixture. So yes I also agree that we can get ##H(T,P)## and ##\rho(T,P)##.

I have a point of confusion in that its not clear to me what use ##H(T,P)## is, if we already have the fluid energy/mass balances though. I think if we continue on with the algorithm discussion this will become clear though
These functionalities are independent of the energy and mass balances. They are the physical properties of N2-O2 mixtures from the thermodynamics of ideal solutions.
casualguitar said:
I follow this if you are saying we can get existing ##T(H,P)## and ##\rho(T,P)## fits from literature data?
No. We are assuming we are dealing with ideal solutions. Otherwise, we could not apply Raoult's law. The only literature data we need to do this are the physical properties of pure N2 and O2 as functions of T and P. Are familiar with the thermodynamics of mixtures/solutions, the concept of partial molar properties, and the behavior of these properties for ideal solutions? If not, see Chapter 10 of Smith and Van Ness, Introduction to Chemical Engineering Thermodynamics.
casualguitar said:
Also a note: The above is for an ideal liquid/vapour mixture. I think it will be useful to code this manually once I understand it, and then later use existing functionality to implement this for real mixtures. What do you think?
To do this for real mixtures, you need to know the activity coefficients (and their variation with concentration) of N2 and O2 in the liquid. Do you have data on this?

I still think you are focusing too much on a portion of the model with much less uncertainty (inaccuracy) than other parts of the model. I don't think it's work your time.
 
  • #286
Chestermiller said:
The only literature data we need to do this are the physical properties of pure N2 and O2 as functions of T and P.
This answers the confusion. Its clear to me now. I would like to avoid coding this data myself if possible, as its already been coded up by others
Chestermiller said:
Are familiar with the thermodynamics of mixtures/solutions, the concept of partial molar properties, and the behavior of these properties for ideal solutions? If not, see Chapter 10 of Smith and Van Ness, Introduction to Chemical Engineering Thermodynamics.
I am familiar with these concepts yes. I took at look at chapter 10 to confirm this
Chestermiller said:
To do this for real mixtures, you need to know the activity coefficients (and their variation with concentration) of N2 and O2 in the liquid. Do you have data on this?
I do have data on this. This link is to the table of contents of the 'Thermo' library I am using. The table of contents gives a good idea of the functionality available: https://thermo.readthedocs.io

It has basically anything we would need, even including things like heat of fusion correlations for CO2 etc
Chestermiller said:
I still think you are focusing too much on a portion of the model with much less uncertainty (inaccuracy) than other parts of the model. I don't think it's work your time.
Which part(s) of the model have more variation than this one? By this one, I mean using constant heat capacity/hVap, and using out temperature/density correlations, rather than using real data

I am happy to work on any part of the model. I don't want to direct the modelling that much at all for now because I don't want to take away from your intuition. I would like to take any guidance you can give (I'll challenge it where I can but really your intuition for model progression is what should drive the changes I think).

But yes I am 100% open to suggestions on how best to approach improving the model from here, so if leaving these correlations/constants as they are is fine then I'm happy to do that. At some point I'll make those changes so I can sleep easy!
 
  • #287
casualguitar said:
This answers the confusion. Its clear to me now. I would like to avoid coding this data myself if possible, as its already been coded up by others

I am familiar with these concepts yes. I took at look at chapter 10 to confirm this

I do have data on this. This link is to the table of contents of the 'Thermo' library I am using. The table of contents gives a good idea of the functionality available: https://thermo.readthedocs.io

It has basically anything we would need, even including things like heat of fusion correlations for CO2 etc

Which part(s) of the model have more variation than this one? By this one, I mean using constant heat capacity/hVap, and using out temperature/density correlations, rather than using real data

I am happy to work on any part of the model. I don't want to direct the modelling that much at all for now because I don't want to take away from your intuition. I would like to take any guidance you can give (I'll challenge it where I can but really your intuition for model progression is what should drive the changes I think).

But yes I am 100% open to suggestions on how best to approach improving the model from here, so if leaving these correlations/constants as they are is fine then I'm happy to do that. At some point I'll make those changes so I can sleep easy!
If it were me, I would be looking at how to quantify the heat transfer coefficient for the 3 regions and I would be looking at the pressure variation in the bed. For the latter, the first thing I would consider is how the mass flow rate of liquid would look if the bed were full of liquid at the initial condition and there was atmospheric pressure (or other constant pressure) at the inlet and outlet of the bed. In other words, free flow of liquid through the bed under gravity. How would this compare with the imposed mass flow rate (0.05 kg/sec). This would provide an idea, at least initially, on whether the pressure varies significantly in the bed. I would also look at the number of tanks in the bed, according to present calculations, in which there are two phases present in the tanks (to determine whether this middle region needs to be seriously addressed in terms of fluid flow).
 
  • #288
Ok I'm going to head out for a walk and think about this for a bit
Chestermiller said:
If it were me, I would be looking at how to quantify the heat transfer coefficient for the 3 regions and I would be looking at the pressure variation in the bed.
First two things that come to mind here are the Gnielinski and Ergun correlations
Chestermiller said:
For the latter, the first thing I would consider is how the mass flow rate of liquid would look if the bed were full of liquid at the initial condition and there was atmospheric pressure (or other constant pressure) at the inlet and outlet of the bed. In other words, free flow of liquid through the bed under gravity. How would this compare with the imposed mass flow rate (0.05 kg/sec). This would provide an idea, at least initially, on whether the pressure varies significantly in the bed.
I can do this. Although, would it not be as easy to implement the Ergun equation directly? Actually yes I'll do both. Similar to previous models we can use one to validate the other
Chestermiller said:
I would also look at the number of tanks in the bed, according to present calculations, in which there are two phases present in the tanks (to determine whether this middle region needs to be seriously addressed in terms of fluid flow).
It isn't clear to me if our 'tank' length equates to a real distance in metres. I guess the answer to this will be in your original spatial variation model derivation, so I'll take a look
Chestermiller said:
I would also look at the number of tanks in the bed, according to present calculations, in which there are two phases present in the tanks (to determine whether this middle region needs to be seriously addressed in terms of fluid flow).
Got it

And yes since the inaccuracies caused by using constant Cp/Hvap etc are small, I won't put time into modelling this manually. I'll just make the change using the thermo library. The change is as tiny as changing the code from cp = 1, to cp = air.cp(T), for example. Similar for hVap. I still maintain though just for my own model clarity i.e. following the model in my own head, I'd like to replace the temperature(H) and mass(H) functions we have currently with the library correlations at some point, to get it out of my head and into the model, even if it isn't a source of large inaccuracy.

So yes I'll think about this and propose a flow to the above tasks this evening, if this is suitable for you
 
  • #289
How does this flow sound to you?

Pressure Gradient:
1)
Independently implement the Ergun equation to get a sense of the expected pressure drop for liquid only and gas only flow across the packed bed i.e. don't include it in the spatial variation model initially.

2) Make a function that allows calculation of the pressure at any point along the bed. I guess this will just be the Ergun equation again except instead of taking the total bed length as input, this function would take a distance from the inlet as input. This would give the ##\Delta P## between the inlet and that point. Then we just take that ##\Delta P## from the inlet pressure to get the pressure at that point.

3) This function could then go into the spatial variation model. It just affects the density and ##\frac{d\rho}{dh}## functions currently so its easy to slot in

4) Later, this function can be used to get the input pressure for real mixture heat capacity, density, etc. Not priority as you say because it won't affect the accuracy that much, but just to clear my heat and for model completion, I'll add it in

The author of the thermo library I mentioned also has some other nice libraries. The 'fluids' library has packed bed pressure drop functionality, here: https://fluids.readthedocs.io/fluids.packed_bed.html?highlight=ergun
This will give an immediate sense of the pressure drop

The real system:
I've chosen non-exact volume, mass, area, solid property values, etc. I know the dimensions of the actual tank being used and any information about the material (diameter, ##C_p##, etc). I'll add in these so that model output resembles the real system:
- tank volume
- solid area
- inlet fluid mass flow
- solid particle diameter
- solid density
- solid ##C_p##
- voidage
- tank length
- tank diameter

Heat transfer coefficient:
I don't know much about this. I know there are a few correlations used to get the Nusselt number, like Gnielinski and Achenbach, and we can use this with the Reynolds number I think to get the heat transfer coefficient.

This library (another from the same author) called 'heat transfer' calculates the Nusselt number for a packed bed given the particle diameter, voidage, superficial velocity, fluid density, fluid viscosity and the Prandtl number: https://ht.readthedocs.io/en/release/ht.conv_packed_bed.html?highlight=packed bed
So again we can get an immediate sense of the heat transfer coefficient using this (I am keen to use these libraries where possible, mostly out of interest in the functionality available)

I think the heat transfer coefficient modelling sounds like something that would slot into the model best after the above two sections are done (they shouldn't take long given the available functionality).

Question: Does '##n##', the number of tanks, correspond to a real length?

So yes in condensed form:
- setup of Ergun
- implementation of Ergun
- addition of ##T## and ##P## dependent parameters where possible
- editing tank/solid values to match exact real system values
- heat transfer coefficient modelling (I guess this will not be short so I won't aim to plan this yet)

Does this above flow look reasonable to you?
 
  • #290
casualguitar said:
How does this flow sound to you?

Pressure Gradient:
1)
Independently implement the Ergun equation to get a sense of the expected pressure drop for liquid only and gas only flow across the packed bed i.e. don't include it in the spatial variation model initially.

2) Make a function that allows calculation of the pressure at any point along the bed. I guess this will just be the Ergun equation again except instead of taking the total bed length as input, this function would take a distance from the inlet as input. This would give the ##\Delta P## between the inlet and that point. Then we just take that ##\Delta P## from the inlet pressure to get the pressure at that point.

3) This function could then go into the spatial variation model. It just affects the density and ##\frac{d\rho}{dh}## functions currently so its easy to slot in

4) Later, this function can be used to get the input pressure for real mixture heat capacity, density, etc. Not priority as you say because it won't affect the accuracy that much, but just to clear my heat and for model completion, I'll add it in

The author of the thermo library I mentioned also has some other nice libraries. The 'fluids' library has packed bed pressure drop functionality, here: https://fluids.readthedocs.io/fluids.packed_bed.html?highlight=ergun
This will give an immediate sense of the pressure drop

The real system:
I've chosen non-exact volume, mass, area, solid property values, etc. I know the dimensions of the actual tank being used and any information about the material (diameter, ##C_p##, etc). I'll add in these so that model output resembles the real system:
- tank volume
- solid area
- inlet fluid mass flow
- solid particle diameter
- solid density
- solid ##C_p##
- voidage
- tank length
- tank diameter

Heat transfer coefficient:
I don't know much about this. I know there are a few correlations used to get the Nusselt number, like Gnielinski and Achenbach, and we can use this with the Reynolds number I think to get the heat transfer coefficient.

This library (another from the same author) called 'heat transfer' calculates the Nusselt number for a packed bed given the particle diameter, voidage, superficial velocity, fluid density, fluid viscosity and the Prandtl number: https://ht.readthedocs.io/en/release/ht.conv_packed_bed.html?highlight=packed bed
So again we can get an immediate sense of the heat transfer coefficient using this (I am keen to use these libraries where possible, mostly out of interest in the functionality available)

I think the heat transfer coefficient modelling sounds like something that would slot into the model best after the above two sections are done (they shouldn't take long given the available functionality).

Question: Does '##n##', the number of tanks, correspond to a real length?
The number of tanks is related to the total bed length and the grid spacing by $$L=n\Delta x$$
casualguitar said:
So yes in condensed form:
- setup of Ergun
- implementation of Ergun
- addition of ##T## and ##P## dependent parameters where possible
- editing tank/solid values to match exact real system values
- heat transfer coefficient modelling (I guess this will not be short so I won't aim to plan this yet)

Does this above flow look reasonable to you?
Yes
 
  • Like
Likes casualguitar
  • #291
Chestermiller said:
The number of tanks is related to the total bed length and the grid spacing by $$L=n\Delta x$$

Yes
Hi Chet, just letting you know I have other work to do today. I'll aim to start the above changes later this evening and update tomorrow. Thanks
 
  • #292
Chestermiller said:
The number of tanks is related to the total bed length and the grid spacing by $$L=n\Delta x$$

Yes
Hi Chet, back on this (took some time away for Christmas). Hope your enjoying the holidays

I'll comment the above stages I mentioned as I do them.

For the expected pressure drop across the bed, I first collected the actual values of flow/pressure/bed dimensions that will be used in the lab. I've modeled the two extreme cases, all vapour and all liquid. The actual pressure drop will be somewhere in the middle.

For reference:
Inlet pressure = 30bar
Mass flow = 0.05 kg/s
Bed length = 1.365 m
Bed diameter = 0.08 m
Voidage = 0.28
Particle diameter = 5mm

Heres the code for the expected pressure drop across the bed:
Screenshot 2021-12-26 at 22.40.58.png


Output:
Screenshot 2021-12-26 at 22.42.52.png


So for an inlet pressure of 30 bar, the expected pressure drop is at most 0.5bar (or in this ballpark anyway). This small drop indicates that the pressure drop won't have a large effect on the system.

Going off the list above:
casualguitar said:
So yes in condensed form:
- setup of Ergun
- implementation of Ergun
- addition of T and P dependent parameters where possible
- editing tank/solid values to match exact real system values
- heat transfer coefficient modelling (I guess this will not be short so I won't aim to plan this yet)
Ergun has been set up so that's task 1 done. I haven't implemented it in the spatial variation model yet so I'll do this now, even though it should have minimal impact. As part of this I'll need to switch the thermo parameters to T/P dependent. All of this will have a small effect on the model output.

This will just leave the heat transfer coefficient. Will aim to be ready to talk about the heat transfer coefficient model in a day or two
 
  • #293
casualguitar said:
Hi Chet, back on this (took some time away for Christmas). Hope your enjoying the holidays

I'll comment the above stages I mentioned as I do them.

For the expected pressure drop across the bed, I first collected the actual values of flow/pressure/bed dimensions that will be used in the lab. I've modeled the two extreme cases, all vapour and all liquid. The actual pressure drop will be somewhere in the middle.

For reference:
Inlet pressure = 30bar
Mass flow = 0.05 kg/s
Bed length = 1.365 m
Bed diameter = 0.08 m
Voidage = 0.28
Particle diameter = 5mm

Heres the code for the expected pressure drop across the bed:
View attachment 294774

Output:
View attachment 294775

So for an inlet pressure of 30 bar, the expected pressure drop is at most 0.5bar (or in this ballpark anyway). This small drop indicates that the pressure drop won't have a large effect on the system.

Going off the list above:

Ergun has been set up so that's task 1 done. I haven't implemented it in the spatial variation model yet so I'll do this now, even though it should have minimal impact. As part of this I'll need to switch the thermo parameters to T/P dependent. All of this will have a small effect on the model output.

This will just leave the heat transfer coefficient. Will aim to be ready to talk about the heat transfer coefficient model in a day or two
In previous calculations, you showed that, in tanks where the phase change is taking place, ##\dot{m}## exiting the tank is much larger than ##\dot{m}_{in}=0.05\ kg/sec##. How do you think that affects the mass flow rates in and out of the tanks downstream of this? Doesn't it also cause them to have that same high value?

At 30 bars, what is the dew point and bubble point of the air?
 
  • #294
Chestermiller said:
At 30 bars, what is the dew point and bubble point of the air?
Just adding the bubble and dew points at 30bar:
Screenshot 2021-12-29 at 22.24.21.png


Chestermiller said:
In previous calculations, you showed that, in tanks where the phase change is taking place, m˙ exiting the tank is much larger than m˙in=0.05 kg/sec.
Yes I did show this I have the plots of the behaviour. I don't understand yet why this happens (or have the answer to the subsequent questions). Looking into this now
 
  • #295
casualguitar said:
Just adding the bubble and dew points at 30bar:
View attachment 294875Yes I did show this I have the plots of the behaviour. I don't understand yet why this happens (or have the answer to the subsequent questions). Looking into this now
It happens because the fluid is expanding from a liquid to a vapor. This causes all the liquid downstream to move with the same increased vapor velocity and mass flow rate. So the downstream liquid has a much greater mass flow rate than 0.05 kg/sec.
 
  • #296
Chestermiller said:
It happens because the fluid is expanding from a liquid to a vapor. This causes all the liquid downstream to move with the same increased vapor velocity and mass flow rate. So the downstream liquid has a much greater mass flow rate than 0.05 kg/sec.
Ok so in tanks where there is evaporation taking place, we will have a mixture of liquid and vapour. The liquid will therefore travel at the faster velocity (the vapour velocity). As the liquid density is greater than the vapour density, this will result in an increase in the mass flow rate.

Question on that - why would the liquid take the same value as the velocity of the gas in the saturated zone, and not at an 'averaged' speed i.e. ##v_{mix} = (1-X)v_l + Xv_g##
Chestermiller said:
How do you think that affects the mass flow rates in and out of the tanks downstream of this? Doesn't it also cause them to have that same high value?
Hmm well yes if the mass flow out of the saturated zone is increased then you would expect this value to propagate downstream.

However I don't see why it would be increased in our case. I would have thought the mass flow would take on this higher value initially, and then actually decrease back down to a lower mass flow rate, because we've got a low density gas downstream of the saturated zone, and a high density liquid upstream. If the volumetric flow is constant across the bed, then surely the mass flow downstream of the saturated zone will be lower than the upstream flow rates, due to the lower density?

So what I thought was - in the saturated zone we would see a mass flow rate higher than the inlet liquid mass flow, and as evaporation takes place this mass flow rate would gradually decrease back down to the inlet flow, and possibly even lower due to the lower vapour density. Incorrect?
 
  • #297
casualguitar said:
Ok so in tanks where there is evaporation taking place, we will have a mixture of liquid and vapour. The liquid will therefore travel at the faster velocity (the vapour velocity). As the liquid density is greater than the vapour density, this will result in an increase in the mass flow rate.

Question on that - why would the liquid take the same value as the velocity of the gas in the saturated zone, and not at an 'averaged' speed i.e. ##v_{mix} = (1-X)v_l + Xv_g##

Hmm well yes if the mass flow out of the saturated zone is increased then you would expect this value to propagate downstream.

However I don't see why it would be increased in our case. I would have thought the mass flow would take on this higher value initially, and then actually decrease back down to a lower mass flow rate, because we've got a low density gas downstream of the saturated zone, and a high density liquid upstream. If the volumetric flow is constant across the bed, then surely the mass flow downstream of the saturated zone will be lower than the upstream flow rates, due to the lower density?

So what I thought was - in the saturated zone we would see a mass flow rate higher than the inlet liquid mass flow, and as evaporation takes place this mass flow rate would gradually decrease back down to the inlet flow, and possibly even lower due to the lower vapour density. Incorrect?
I think you have downstream and upstream switched. What does your model predict about ##\dot{m}## leaving the various tanks as a function of the tank number (i.e., spatially) at times when there is still pure liquid remaining in some of the (downstream) tanks?
 
  • #298
Chestermiller said:
I think you have downstream and upstream switched. What does your model predict about ##\dot{m}## leaving the various tanks as a function of the tank number (i.e., spatially) at times when there is still pure liquid remaining in some of the (downstream) tanks?
Apologies for the delay I found some script errors that I needed to fix.

And yes you were right I did have them switched. Ok yes now get the idea I think. The high speed gas upstream should 'push' the liquid downstream of it. The gas and liquid will have to travel at the same velocity, and therefore increase the mass flow rate of liquid to a value above 0.05kg/s, due to its higher density.

Here is what the spatial model predicts about ##\dot{m}##.

Flow exiting each tank as a function of time. I've used 5 tanks:
Screenshot 2021-12-31 at 00.14.30.png
and dm/dt:
Screenshot 2021-12-30 at 23.58.50.png


So I understand in theory how we would see an increased flow downstream of the saturation zone, but I don't understand how (or if) we have incorporated that properly in our model. I'll think about this.

I can clearly see though there is a spike in mass flow in each tank, and that spike gets progressively smaller as we move through the tanks. Hmm I guess this has to do with there being less liquid downstream in the later tanks, but again how we have incorporated that in the model I'm not sure. I will think about this before the morning
 
  • #299
casualguitar said:
Apologies for the delay I found some script errors that I needed to fix.

And yes you were right I did have them switched. Ok yes now get the idea I think. The high speed gas upstream should 'push' the liquid downstream of it. The gas and liquid will have to travel at the same velocity, and therefore increase the mass flow rate of liquid to a value above 0.05kg/s, due to its higher density.

Here is what the spatial model predicts about ##\dot{m}##.

Flow exiting each tank as a function of time. I've used 5 tanks:
View attachment 294928and dm/dt:
View attachment 294927

So I understand in theory how we would see an increased flow downstream of the saturation zone, but I don't understand how (or if) we have incorporated that properly in our model. I'll think about this.

I can clearly see though there is a spike in mass flow in each tank, and that spike gets progressively smaller as we move through the tanks. Hmm I guess this has to do with there being less liquid downstream in the later tanks, but again how we have incorporated that in the model I'm not sure. I will think about this before the morning
What does ##\dot{m}## vs tank number at various fixed times look like?
 
  • #300
Chestermiller said:
What does ##\dot{m}## vs tank number at various fixed times look like?
Given the spikes in mass flow are narrow, its hard to pick suitable time intervals that show this. However, this is a plot of the first 11 seconds in intervals of 1 second:
Screenshot 2022-01-01 at 21.24.18.png


Its a poor quality plot (as I say difficult to plot when the saturation last <1 second at each position), so I'm working on presenting this clearly.

But yes for now this shows that after 1 second the mass flow in the tank is at a maximum of 2kg/s (much larger than the inlet flow), and this value matches the previous plot of time vs flowrate.

Also at approx 3 seconds we can see from the previous plot the flow is almost 0.25kg/s around the middle to the end of the tank (still much larger than the inlet flow), and this matches the position vs flow plot also

So yes while this plot isn't great it does line top with the last one
 
Back
Top