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.
  • #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
 
Engineering news on Phys.org
  • #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?
 
  • #176
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?
If I understand correctly I'm doing the first option. I'm taking the enthalpy solution array and passing it through the temperature, mass holdup, etc functions to regenerate those values from the enthalpy value

Not efficient I know, however it works and I haven't figured out how to just write the values to an output variable as they are created.

I'm reading the ODE solver documentation currently so I'll aim to change it to the better approach
 
  • #177
Chestermiller said:
You are assuming that the bed temperature and the temperature of the fluid in the bed are initially the same, right?
Right. I think I see what you're saying. I only need one initial condition for the bed - the temperature? I could then just get the enthalpy from the temperature
 
  • #178
casualguitar said:
Right. I think I see what you're saying. I only need one initial condition for the bed - the temperature? I could then just get the enthalpy from the temperature
Sure. Isn't that what you did in the 1 tank model?
 
  • #179
Chestermiller said:
Sure. Isn't that what you did in the 1 tank model?
It is, I'm quite stuck on this one though. The functions I made for the previous model used the tank inlet values always (when we had one tank). They were built into the functions. Whereas now we've got to update the ##j## and ##j-1## values. I'm not so fluent with the ODE solver I'm using. I don't know how to do this just yet
 
  • #180
Chestermiller said:
Sure. Isn't that what you did in the 1 tank model?
I think what's confusing me is that I'm trying to include dm/dt in the ODE solver when I don't need to.

Is this statement correct - we are solving for enthalpy at every point at every time step, and every other parameter is known once enthalpy is known ##(m,T,\rho,Ts,m_j, \dot{m}_{j-1})##

So really the only point of focus is the enthalpy. Once we know the enthalpy everything else is known through the relations you previously developed

Is the above correct?
 
  • #181
casualguitar said:
I think what's confusing me is that I'm trying to include dm/dt in the ODE solver when I don't need to.

Is this statement correct - we are solving for enthalpy at every point at every time step, and every other parameter is known once enthalpy is known ##(m,T,\rho,Ts,m_j, \dot{m}_{j-1})##

So really the only point of focus is the enthalpy. Once we know the enthalpy everything else is known through the relations you previously developed

Is the above correct?
Yes. Not only that. Maybe now, with the present sweeping tank-at-a-time setup, it might be easier to do the integration ourselves, without using the package ODE integrator. With an implicit integration like backward Euler or Crank-Nicholson, it would only involve solving two linear equations in two unknowns for each sequential tank for each time step. What do you think?
 
Last edited:
  • #182
Chestermiller said:
Yes. Not only that. Maybe now, with the present sweeping tank-at-a-time setup, it might be easier to do the integration ourselves, without using the package ODE integrator. With an implicit integration like backward Euler or Crank-Nicholson, it would only involve solving two linear equations in two unknowns for each sequential tank for each time step. What do you think?
Hi Chet, just letting you know I am still focusing on the code for this model. I've made some progress and it seems I can do it with the ODE package I previously used. I will continue on with this method for now, as its possible it will be useful in future models
 
  • Like
Likes Chestermiller
  • #183
Chestermiller said:
Yes. Not only that. Maybe now, with the present sweeping tank-at-a-time setup, it might be easier to do the integration ourselves, without using the package ODE integrator. With an implicit integration like backward Euler or Crank-Nicholson, it would only involve solving two linear equations in two unknowns for each sequential tank for each time step. What do you think?
Looks like there's good news on the model. Finishing up my attempt now. Will get some plots in the next hour or so
 
  • Like
Likes Chestermiller
  • #184
Chestermiller said:
Yes. Not only that. Maybe now, with the present sweeping tank-at-a-time setup, it might be easier to do the integration ourselves, without using the package ODE integrator. With an implicit integration like backward Euler or Crank-Nicholson, it would only involve solving two linear equations in two unknowns for each sequential tank for each time step. What do you think?
Hi Chet, the code for the model is done I think. I'm setting up various plots now. Temperature distribution for a number of times here:
Screenshot 2021-12-03 at 21.51.50.png

The trend seems to look normal to me i.e. the positions closer to the left increase in temperature first, followed gradually by positions closer to the right
 
  • #185
Chestermiller said:
Screenshot 2021-12-03 at 23.03.42.png
Yes. Not only that. Maybe now, with the present sweeping tank-at-a-time setup, it might be easier to do the integration ourselves, without using the package ODE integrator. With an implicit integration like backward Euler or Crank-Nicholson, it would only involve solving two linear equations in two unknowns for each sequential tank for each time step. What do you think?
And similarly for the fluid enthalpy and mass holdup:
Screenshot 2021-12-03 at 22.58.29.png

Screenshot 2021-12-03 at 23.00.07.png

The mass holdup plot isn't exactly visually nice to look at. But yes these are the three plots. How does this look to you?

And the code:
Screenshot 2021-12-03 at 23.02.23.png

Screenshot 2021-12-03 at 23.03.09.png
 
  • #186
casualguitar said:
And similarly for the fluid enthalpy and mass holdup:
View attachment 293537
View attachment 293538
The mass holdup plot isn't exactly visually nice to look at. But yes these are the three plots. How does this look to you?

And the code:
View attachment 293539
View attachment 293540
This is for 30 tanks, each 1/30 the size of the tank in the single tank model, correct?

In comparison to the single tank model, the time response of this model seems way too fast. The results also seem to show that all the liquid is purged from the bed by 20 sec. This doesn't seem likely. Have you compared the time-dependent results for the first tank in this model with the results of the single tank model for the case of a tank 1/30 the size of the overall bed? The results from this comparison should match.

Also, what does the bed temperature profile look like?
 
Last edited:
  • #187
Chestermiller said:
In comparison to the single tank model, the time response of this model seems way too fast.
Yes I actually forgot to divide the heat transfer area, and the solid mass by the number of tanks when I was making that graph (see Area and mS parameters are not divided by n). I was looking at the effect of having multiple tanks and forgot to switch back. Heres the fluid temperature plot for n = 32. Note that for the first and last timestep Tf == 0. This is because the numerical derivative dH/dt eliminates two data points. So I've manually added in the IC for the fluid (t=0) again for visual purposes:
Screenshot 2021-12-04 at 20.51.26.png


The solid temperature profile:
Screenshot 2021-12-04 at 20.53.37.png


Comparing this model with the last one now. I don't think they match though, unless I've compared them incorrectly. Checking now

Also, to confirm - if I divide the volume, area and solid mass by n (number of tanks) at the top of the script when declaring variables, then n will not appear at all further down in the computations?
 

Attachments

  • Screenshot 2021-12-04 at 20.52.39.png
    Screenshot 2021-12-04 at 20.52.39.png
    10.9 KB · Views: 80
Last edited:
  • #188
Chestermiller said:
Have you compared the time-dependent results for the first tank in this model with the results of the single tank model for the case of a tank 1/30 the size of the overall bed?
Heres the plot of the fluid temperature for the no spatial dependence model.

1638655996650.png


Thinking about this some more, this graph should roughly match the spatial dependence graph at the first position, which it does

To clarify, I divided the volume, area and solid mass by n = 32 in spatial dependence model (I think I actually should have divided by 30 not 32 but anyway). This means that the first tank in the spatial dependence model, and this non-spatial-dependence model are now identical
 
  • #189
casualguitar said:
Yes I actually forgot to divide the heat transfer area, and the solid mass by the number of tanks when I was making that graph (see Area and mS parameters are not divided by n). I was looking at the effect of having multiple tanks and forgot to switch back. Heres the fluid temperature plot for n = 32. Note that for the first and last timestep Tf == 0. This is because the numerical derivative dH/dt eliminates two data points. So I've manually added in the IC for the fluid (t=0) again for visual purposes:
View attachment 293588

The solid temperature profile:
View attachment 293591

Comparing this model with the last one now. I don't think they match though, unless I've compared them incorrectly. Checking now

Also, to confirm - if I divide the volume, area and solid mass by n (number of tanks) at the top of the script when declaring variables, then n will not appear at all further down in the computations?
These times seem very short compared to what was obtained before by the one tank model of the overall bed. Please prepare a comparison plot of the temperature vs time for the 32nd tank vs the corresponding results from the one tank mode of the overall bed. Please comment on any differences. Thanks.
 
  • #190
Chestermiller said:
These times seem very short compared to what was obtained before by the one tank model of the overall bed. Please prepare a comparison plot of the temperature vs time for the 32nd tank vs the corresponding results from the one tank mode of the overall bed. Please comment on any differences. Thanks.
Working on the above now

Would it not be the first tank in the 32 tank model that is comparable to the one tank model, as the ICs and BCs would be the same? As the last tank has a variable inlet mass flow which isn't the case in the single tank model
 
  • #191
casualguitar said:
Working on the above now

Would it not be the first tank in the 32 tank model that is comparable to the one tank model, as the ICs and BCs would be the same? As the last tank has a variable inlet mass flow which isn't the case in the single tank model
No. I want to compare what each of the two models predicts for the temperature as a function of time of the gas coming out of the overall bed.
 
  • #192
Chestermiller said:
These times seem very short compared to what was obtained before by the one tank model of the overall bed.
The volume/area/solid mass are smaller (32x smaller) compared to the first iteration of the single tank model. The inlet flowrate is the same as before though, so I think it would be expected to have shorter time scales?
Chestermiller said:
Please prepare a comparison plot of the temperature vs time for the 32nd tank vs the corresponding results from the one tank mode of the overall bed. Please comment on any differences. Thanks.
I can't get the single and 32 tank plots on the same plot, so I'll create two. Here is the single tank model plot, where I have taken the volume area and solid mass we had in the original single tank model, and divided them by n = 32:
Screenshot 2021-12-05 at 15.15.13.png

So it takes about 2 seconds before the temperature levels off in the single tank

Similarly, for the final tank here is the outlet temperature as a function of time:
Screenshot 2021-12-05 at 16.26.35.png

So yes the 32 tank model predicts it will take about 80s for the temperature to level out in the final tank (note the time axis shows x1000 currently. This is 0 to 80s). The single tank model predicts it will take 2 seconds for the temperature in the single tank model to level out.

Also the jumps around the 7 to 10s mark are due to the enthalpy function not being continuous. I'm using the enthalpy derivative to calculate the fluid temperatures

Lastly here's the first tank temperature versus time, showing about 30s to level out (also much slower than the single tank model)
Screenshot 2021-12-05 at 16.30.12.png


Looking into this now

Update: I've got another person to check the newer model and it seems to look ok. Its likely the single tank model that has the error. Checking now
 

Attachments

  • Screenshot 2021-12-05 at 15.32.55.png
    Screenshot 2021-12-05 at 15.32.55.png
    12.1 KB · Views: 96
Last edited:
  • #193
Chestermiller said:
No. I want to compare what each of the two models predicts for the temperature as a function of time of the gas coming out of the overall bed.
Results for this are in post #192. Is it true to say that there is an error in one of the models because the single tank model temperature profile does not match the first tank in the multi-tank model?
ie.
These are not the same:
screenshot-2021-12-05-at-15-15-13-png.png

screenshot-2021-12-05-at-16-30-12-png.png

I haven't seemed to find any errors in either just yet
 
  • #194
casualguitar said:
Results for this are in post #192. Is it true to say that there is an error in one of the models because the single tank model temperature profile does not match the first tank in the multi-tank model?
ie.
These are not the same:
View attachment 293642
View attachment 293643
I haven't seemed to find any errors in either just yet
The Single tank model for the entire bed should match the 32nd tank of the multi tank model. Well what I really mean is that the time scale should match approximately.
 
  • #195
Chestermiller said:
The Single tank model for the entire bed should match the 32nd tank of the multi tank model. Well what I really mean is that the time scale should match approximately.
The time scale of the models further back is much closer to the new spatial variation model, which suggests there is some error in the single tank model, which would seem to make sense anyway as the purge time is very low. Looking into it
 
  • #196
Chestermiller said:
The Single tank model for the entire bed should match the 32nd tank of the multi tank model. Well what I really mean is that the time scale should match approximately.
Getting closer to the solution to this. Its almost definitely got something to do with how I'm adjusting volume, area and solid mass for the single tank model to match the multi tank model values. The reason I think this is because when I fully remove any 'n' from the single tank model i.e. just use the values I used before, the shape of the single and multi tank plots are very similar. Still slightly off in terms of time but they look alike:

Single tank plot:
Screenshot 2021-12-05 at 22.49.38.png

Multi tank plot:
Screenshot 2021-12-05 at 22.50.29.png

So when I try to divide by n it fails and I get a plot similar to the very short time scale in a previous post. So it seems that using volume/n, area/n and solidmass/n is not doing what I expected it to do in the single tank plot

Note the times for the multitask plot are x1000 as I haven't figured out how to scale down the x-axis by 1000. The time range here is 0 to 80s

Do these plots 'match'? Or do you reckon there's an error in one?
 
  • #197
Edit: The above plots are of time versus enthalpy (forgot to change the y-axis label)

Here are the plots of fluid temperature versus time for both cases:

1) The single tank model:
Screenshot 2021-12-06 at 10.21.50.png

Last tank in the 32 tank model (where actual t = t/1000):
Screenshot 2021-12-06 at 10.22.18.png

These plots seem to show a similar trend and an approximately equal 'levelling off' time for the fluid temperature. The fix (if you agree these plots look ok) was in how I was dividing up the volume, area, and solid mass per unit area

I am absolutely ready to work some more on this model today if you think we're ready to do some more
 
Last edited:
  • #198
casualguitar said:
Getting closer to the solution to this. Its almost definitely got something to do with how I'm adjusting volume, area and solid mass for the single tank model to match the multi tank model values. The reason I think this is because when I fully remove any 'n' from the single tank model i.e. just use the values I used before, the shape of the single and multi tank plots are very similar. Still slightly off in terms of time but they look alike:

Single tank plot:
View attachment 293646
Multi tank plot:
View attachment 293648
So when I try to divide by n it fails and I get a plot similar to the very short time scale in a previous post. So it seems that using volume/n, area/n and solidmass/n is not doing what I expected it to do in the single tank plot

Note the times for the multitask plot are x1000 as I haven't figured out how to scale down the x-axis by 1000. The time range here is 0 to 80s

Do these plots 'match'? Or do you reckon there's an error in one?
They have to approximately match on the time scale. The multi-tank time variation of the temperature leaving the tank should be sharper (closer to a square wave) than the single tank model of the overall bed. But they need to be close to one another. The multi-tank should have lower temperatures at short times and higher temperatures at longer times; so they have to cross over one another.

The time scale for the response should be roughly on the order of $$\frac{m_SC_S}{UA}$$What value do you calculate for this?

I'm going to try to leave the coding up to you and only offer guidance on model structure.
 
  • #199
Chestermiller said:
The time scale for the response should be roughly on the order of mSCSUAWhat value do you calculate for this?
11 for this (##mS = 1, C_ps = 1.1, U = 1, A = 0.1##). Is this time scale term an approximation for the time it should take to reach steady state in a tank?
Chestermiller said:
The multi-tank time variation of the temperature leaving the tank should be sharper (closer to a square wave) than the single tank model of the overall bed.
Ok so are you saying there is an error in the multi-tank model because it doesn't really cross over the single tank model at all? i.e. higher temperature at low and high times

Chestermiller said:
I'm going to try to leave the coding up to you and only offer guidance on model structure.
Thats good with me, I don't think the code will get much more complex math-wise than it is currently anyway
 
  • #200
casualguitar said:
11 for this (##mS = 1, C_ps = 1.1, U = 1, A = 0.1##). Is this time scale term an approximation for the time it should take to reach steady state in a tank?
For the bed
casualguitar said:
Ok so are you saying there is an error in the multi-tank model because it doesn't really cross over the single tank model at all? i.e. higher temperature at low and high times
I don’t know which model has the error (or errors). This is part of doing the validation of the model.
 
Back
Top