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.
  • #101
casualguitar said:
Got it

To describe the above equations I would say the following, where every term is per unit volume:
1) The rate of increase of mass plus the rate at which mass leaves in the ##x## direction ##= 0##
I would call it the net rate at which mass leaves
casualguitar said:
2) The rate of increase of energy plus the rate at which energy leaves in the ##x## direction = the rate of axial dispersion in the x direction plus the heat transfer between the fluid and solid
I would call it "rate of increase of enthalpy per unit volume" and "the net rate at which enthalpy per unit volume leaves the control volume in the x direction"
casualguitar said:
(I notice we have arrived at the same equation I started the post with (!), just using enthalpy instead of temperature. Nice)Understood

Understood. I think I have seen some correlations for ##D## the axial dispersion coefficient but I guess this is of secondary importance for now.

The mass balance is straightforward, however I do have questions on the energy balance to clear up.

Points of confusion:
1) Are you using the term 'heat balance' and 'energy balance' interchangeably?
Yes.
casualguitar said:
2) Is this an advection term: ##\frac{\partial (\phi h)}{\partial x}##? I'm not familiar with advection, other than its definition as the transfer of heat through fluid flow, so I guess this is it
As we said before, it represents the net advection of enthalpy per unit volume out of the control volume.
casualguitar said:
3) So the axial dispersion coefficient is a 'catch all' term for a number of energy transport processes as far as I know (diffusion and conduction within the fluid, convection by the fluid in the axial direction, axial and transverse mixing of the fluid, etc, as far as I know). What terms are included in this term in our case?
Like you said, it is a catch all for the net of all these effects. It's probably not going to be worthwhile trying to quantify it to a more detailed extent, and, in my judgment, it will be preferable to treat the dispersion length l as an adjustable parameter that the experimental results will be used to calibrate.
casualguitar said:
4) The final term seems to be the convection between the fluid and the solid term. Why does this term not have a time or space derivative, because it will surely depend on space and time? Is it because 'time/space dependence' is built in, in the sense that ##T## and ##T_S## will change with time and space, meaning that the convection term will also change with time and space indirectly?
No. The heat transfer coefficient will depend on the fluid parameters, velocities, and bed geometry, so, in reality, it can be a function of location and time. I too will be difficult to quantify, and I recommend, at least initially, treating it as a constant and, like the dispersibity, calibrating it to the experimental results. (This is how we treated it in the lumped model) Later, if necessary, we can "sharpen our pencils."
casualguitar said:
Got it

So now instead of solving a fluid and solid energy balance, we will be solving the mass balance for the fluid, and the energy balance for the fluid/solid instead?
No. The solid energy balance is still used. We have just had the add the mass balance because the density is a function of x and t (which needs to be accounted for, since the density varies by a factor of 1000 from liquid to vapor).
 
Engineering news on Phys.org
  • #102
Chestermiller said:
I would call it the net rate at which mass leaves
Chestermiller said:
I would call it "rate of increase of enthalpy per unit volume" and "the net rate at which enthalpy per unit volume leaves the control volume in the x direction"
Chestermiller said:
It is really the microscopic energy balance expressed in terms of enthalpy, assuming negligible viscous heating. See Eqn. S in Table 11.4-1 of Transport Phenomena by Bird, et al.
Chestermiller said:
As we said before, it represents the net advection of enthalpy per unit volume out of the control volume.
Chestermiller said:
Like you said, it is a catch all for the net of all these effects. It's probably not going to be worthwhile trying to quantify it to a more detailed extent, and, in my judgment, it will be preferable to treat the dispersion length l as an adjustable parameter that the experimental results will be used to calibrate.
Chestermiller said:
No. The heat transfer coefficient will depend on the fluid parameters, velocities, and bed geometry, so, in reality, it can be a function of location and time. I too will be difficult to quantify, and I recommend, at least initially, treating it as a constant and, like the dispersibity, calibrating it to the experimental results. (This is how we treated it in the lumped model) Later, if necessary, we can "sharpen our pencils."
All understood. Ok so we're leaving the dispersion length and the heat transfer coefficient as calibration parameters
Chestermiller said:
No. The solid energy balance is still used. We have just had the add the mass balance because the density is a function of x and t (which needs to be accounted for, since the density varies by a factor of 1000 from liquid to vapor).
Understood yes this is what I was trying to communicate also

I follow all of that. No further questions on any of the above

I do have two short questions on the assumptions we will make here:
1) Are we assuming here that saturation occurs at a specific temperature (rather than find the temperature with bubble/dew point correlations)
2) Should I prepare to start using correlations for any parameters previously kept constant (heat capacity, enthalpy, etc), or will we be using the equations used previously
 
  • #103
casualguitar said:
All understood. Ok so we're leaving the dispersion length and the heat transfer coefficient as calibration parameters

Understood yes this is what I was trying to communicate also

I follow all of that. No further questions on any of the above

I do have two short questions on the assumptions we will make here:
1) Are we assuming here that saturation occurs at a specific temperature (rather than find the temperature with bubble/dew point correlations)
2) Should I prepare to start using correlations for any parameters previously kept constant (heat capacity, enthalpy, etc), or will we be using the equations used previously
A foundation of success in doing modeling is to start with simple models and gradually build to more advanced versions incorporating additional features of scomplexity until one arrives at a final version that satisfies the modeler (and matches whatever experimental data has been developed to characterize the system and test the model). So, typically, the data development and the model development are done in tandem. So you should have in mind going to more advanced version of the model as needed.

Depending on your judgment, it may be necessary to employ more accurate correlations of physical property parameters as the model evolves to future versions.

Understand that it is a very bad idea to try to include everything in the model all at once. The concept is that, if you can't solve the more simple versions, you'll never be able to solve the most complex version. Moreover, for each version along the way, you will already have model results to show for your effort (which can be compared with the previous results to quantify the effect of the added complexity and to compare with experimental data).

Right now, as initially specified by you, the model assumes a pure component phase change. But there is no reason you can't start doing separate calculations by hand or by computer to evaluate the VLE behavior at a specified pressure of the effect of temperature in the 2-phase region. Start with one mole of an air mixture, and, using Raout's law, as a function of temperature, calculate the molar split of vapor and liquid, the specific volume of the vapor, the specific volume of the liquid, the average specific volume of the combination of vapor and liquid, the specific enthalpy of the liquid, the specific enthalpy of the vapor, the average specific enthalpy of the combination of vapor and liquid. Get an idea of what this all looks like. Maybe it can be incorporated pretty easily into the model.

One thing we haven't discussed yet is the possibility that the liquid will be traveling through the bed at a different velocity than the vapor (because of viscous drag on the liquid). You should also be thinking about the possibility of pressure variations due to drag, and how that might come into play for a two phase mixture in a packed bed (as well as for the single phase regions). (You have chosen a very complicated problem to work on). All these things should be in the back of your mind, and you should be starting to think about whether they need to be included in later versions of your model (or, at least, how to estimate whether to include them).
 
Last edited:
  • Like
Likes casualguitar
  • #104
RECOMMENDED FINITE DIFFERENCE SCHEME

The finite difference scheme I am recommending employs a finite difference grid with spacing ##\Delta x##, grid cell boundaries at ##(x=0,\ \Delta x,\ 2\Delta x...)##, and grid cell centers at ##(x=\Delta x/2,\ 3\Delta x/2,\ 5\Delta x/2,\ ...##). The mass flux into the bed ##\phi_0## is known at the cell boundary x = 0, and we calculate the mass flux at all the other cell boundaries. On the other hand, we calculate the fluid temperatures, enthalpies, and densities at the cell centers.

Based on this description, and employing the method of lines, the 2nd order accurate finite difference representations of the mass balance and heat balance equations for the fluid are expressed as:
$$\frac{d\rho_x}{dt}=\frac{(\phi_{x-\Delta x/2}-\phi_{x+\Delta x/2})}{\Delta x}$$and$$\frac{d(\rho_xh_x)}{dt}=\rho_x\frac{dh_x}{dt}+h_x\frac{d\rho_x}{dt}$$$$=\frac{\phi_{x-\Delta x/2}\left(\frac{h_{x-\Delta x}+h_x}{2}\right)-\phi_{x+\Delta x/2}\left(\frac{h_{x+\Delta x}+h_x}{2}\right)}{\Delta x}$$$$+l\frac{\phi_{x+\Delta x/2}(h_{x+\Delta x}-h_x)-\phi_{x-\Delta x/2}(h_x-h_{x-\Delta x})}{(\Delta x)^2}$$$$+\frac{Ua(T_{S,x}-T_x)}{\epsilon}$$
OK so far?

Are you familiar with the finite differencing concepts of upwind differencing and numerical dispersion associated with modeling advection in transport models?
 
Last edited:
  • #105
Chestermiller said:
A foundation of success in doing modeling is to start with simple models and gradually build to more advanced versions incorporating additional features of complexity until one arrives at a final version that satisfies the modeler
Might have to add this as my laptop wallpaper
Chestermiller said:
Understand that it is a very bad idea to try to include everything in the model all at once.
Got it. From my own limited experience I don't think I've never actually been able to implement the full version of any model first try. I always end up fighting the urge start simply though, as it feels unintuitive and as though it would be slower overall than tackling the entire thing first go I suppose. I'll remember to avoid this approach from now on, and start simply
Chestermiller said:
But there is no reason you can't start doing separate calculations by hand or by computer to evaluate the VLE behavior at a specified pressure of the effect of temperature in the 2-phase region. Start with one mole of an air mixture, and, using Raout's law, as a function of temperature, calculate the molar split of vapor and liquid, the specific volume of the vapor, the specific volume of the liquid, the average specific volume of the combination of vapor and liquid, the specific enthalpy of the liquid, the specific enthalpy of the vapor, the average specific enthalpy of the combination of vapor and liquid. Get an idea of what this all looks like. Maybe it can be incorporated pretty easily into the model.
Understood. I've actually got some dew/bubble point functionality coded up, and also flash functionality (TP,PH, etc) for pure fluids and mixtures, so really in including two components instead of 1, a boiling range instead of a single temperature etc, the difficult bit for me is conceptualising the model. The functionality in code is ready to be used
Chestermiller said:
One thing we haven't discussed yet is the possibility that the liquid will be traveling through the bed at a different velocity than the vapor (because of viscous drag on the liquid). You should also be thinking about the possibility of pressure variations due to drag, and how that might come into play for a two phase mixture in a packed bed (as well as for the single phase regions). (You have chosen a very complicated problem to work on)
Got it. I suppose with the approach of gradually building in complexity, this is something that doesn't have to be included now but can be looked at later (once other things, like the boiling range, have been added)

Actually one note I want to add is that I haven't yet described the existing functionality I've got available in code. Effectively any property/basic functionality like property calculations for pure fluids/mixtures, temperature and/or pressure dependent properties, flash for mixtures to calculate liquid fractions, or the composition of the gas/liquid at given conditions, etc is all possible. So as I mentioned above the most difficult part is likely the conceptualisation of the model. I mention this mainly because I don't want to limit the model capability (where possible) because of lack of access to property/process functionality like the above
 
  • #106
Chestermiller said:
The finite difference scheme I am recommending employs a finite difference grid with spacing Δx, grid cell boundaries at (x=0, Δx, 2Δx...), and grid cell centers at (x=Δx/2, 3Δx/2, 5Δx/2, ...).
Got it. I have implemented some basic FD schemes manually before so I'm not starting from zero (just close to it)
Chestermiller said:
The mass flux into the bed ϕ0 is known at the cell boundary x = 0, and we calculate the mass flux at all the other cell boundaries
Chestermiller said:
On the other hand, we calculate the fluid temperatures, enthalpies, and densities at the cell centers.
So this bit I'm not sure about. I think these questions clear up the confusion though:
1) You say we're calculating mass flux at the cell boundaries, so at ##(x=0,\ \Delta x,\ 2\Delta x...)##. But in eq.1 the flux terms are evaluated ##\phi_{x-\Delta x/2}## and ##\phi_{x+\Delta x/2}##, which are not at the cell boundaries if I'm correct. How can we know these values, if we are evaluating only mass flux at the boundaries i.e. ##\phi_{x}## and ##\phi_{2\Delta x} ## etc

2) Similarly in eq.2, I follow the algebra, however if we're evaluating enthalpy at the cell centre, then I thought the subscript would be ##x+\Delta x/2## etc rather than ##(x=0,\ \Delta x,\ 2\Delta x...)##, which are the boundaries.

So the above two questions are really the same and are just 'what does it mean to evaluate flux at the boundary, and the other properties at the cell centre?'

3) Final question on that is why not evaluate all properties at the boundary, or at the centre. I guess there is a limitation here in that we can't evaluate flux at the centre or the other properties at the boundary, but I can't see it yet. I will look for this limitation in the morning

Chestermiller said:
Are you familiar with the finite differencing concepts of upwind differencing and numerical dispersion associated with modeling advection in transport models?
I'm familiar with upwind schemes. I do not know what numerical dispersion associated with modelling advection is though, and did not seem to find much online about this. What is this?
 
  • #107
casualguitar said:
Got it. I have implemented some basic FD schemes manually before so I'm not starting from zero (just close to it)So this bit I'm not sure about. I think these questions clear up the confusion though:
1) You say we're calculating mass flux at the cell boundaries, so at ##(x=0,\ \Delta x,\ 2\Delta x...)##. But in eq.1 the flux terms are evaluated ##\phi_{x-\Delta x/2}## and ##\phi_{x+\Delta x/2}##, which are not at the cell boundaries if I'm correct. How can we know these values, if we are evaluating only mass flux at the boundaries i.e. ##\phi_{x}## and ##\phi_{2\Delta x} ## etc

2) Similarly in eq.2, I follow the algebra, however if we're evaluating enthalpy at the cell centre, then I thought the subscript would be ##x+\Delta x/2## etc rather than ##(x=0,\ \Delta x,\ 2\Delta x...)##, which are the boundaries.

So the above two questions are really the same and are just 'what does it mean to evaluate flux at the boundary, and the other properties at the cell centre?
Let's consider the 3rd cell. The cell center is at ##x=\frac{5}{2}\Delta x##. The left boundary of the cell is at ##x-\frac{\Delta x}{2}=\frac{5}{2}\Delta x-\frac{\Delta x}{2}=2\Delta x##. The right boundary of the cell is at ##x+\frac{\Delta x}{2}=\frac{5}{2}\Delta x+\frac{\Delta x}{2}=3\Delta x##.
casualguitar said:
3) Final question on that is why not evaluate all properties at the boundary, or at the centre. I guess there is a limitation here in that we can't evaluate flux at the centre or the other properties at the boundary, but I can't see it yet. I will look for this limitation in the morning
For accuracy of the finite difference scheme, it is better to evaluate the fluxes at the cell boundaries, and the non-fluxes at the cell centers. For example, in a conductive heat transfer finite difference scheme, we evaluate the q's (##q=-k\frac{\partial T}{\partial x}##) at the cell boundaries and the temperatures at the cell centers (or vice versa, which is equivalent). The point is that the fluxes are evaluated a half-grid-space away from the temperatures. In an advective transport problem like ours, another advantage of this approach is that the grid cells preserve the physically intuitive analogy to a series of mixed tanks, with fluid flowing in at the left cell boundary and exiting at the right cell boundary.
casualguitar said:
I'm familiar with upwind schemes. I do not know what numerical dispersion associated with modelling advection is though, and did not seem to find much online about this. What is this?
Are you saying that you are familiar with upwind (first order) finite difference schemes applied to advection-dispersion problems?
 
  • #108
Chestermiller said:
Let's consider the 3rd cell. The cell center is at x=52Δx. The left boundary of the cell is at x−Δx2=52Δx−Δx2=2Δx. The right boundary of the cell is at x+Δx2=52Δx+Δx2=3Δx.
Understood
Chestermiller said:
The point is that the fluxes are evaluated a half-grid-space away from the temperatures. In an advective transport problem like ours, another advantage of this approach is that the grid cells preserve the physically intuitive analogy to a series of mixed tanks, with fluid flowing in at the left cell boundary and exiting at the right cell boundary.
Got it
Chestermiller said:
Are you saying that you are familiar with upwind (first order) finite difference schemes applied to advection-dispersion problems?
I have seen (and understood) examples of upwind finite difference schemes applied to advection equations. The key idea is that we use information 'upstream' of the flow direction i.e. ##x < x_{i} ## to solve at ##x_{i}##. I have not seen upwind schemes applied to advection-dispersion equations. Are there key differences between advection, and advection-dispersion upwind schemes? Or will an understanding of upwind schemes applied to advection problems be enough here i.e. the addition of the dispersion term doesn't add any other difficulties
 
  • #109
casualguitar said:
Understood

Got it

I have seen (and understood) examples of upwind finite difference schemes applied to advection equations. The key idea is that we use information 'upstream' of the flow direction i.e. ##x < x_{i} ## to solve at ##x_{i}##. I have not seen upwind schemes applied to advection-dispersion equations. Are there key differences between advection, and advection-dispersion upwind schemes? Or will an understanding of upwind schemes applied to advection problems be enough here i.e. the addition of the dispersion term doesn't add any other difficulties
If you understand that upwind difference schemes are first order accurate and introduce unwanted numerical dispersion into the calculation (over and above actual physical diffusion/dispersion), while central difference schemes (e.g., the one we are using), while sometime problematic with respect to advection (by sometimes resulting in unwanted "zig-zags" in the axial profiles) do not introduce numerical dispersion, that will be sufficient.
 
  • #110
Chestermiller said:
(over and above actual physical diffusion/dispersion)
Ah I didn't understand what you meant by this previously. I do now
Chestermiller said:
that will be sufficient.
All understood. Ready to go

Is there anything I should do before we continue?
 
  • #111
casualguitar said:
Ah I didn't understand what you meant by this previously. I do now

All understood. Ready to go

Is there anything I should do before we continue?
Let's continue.

Here's a math problem for you: What would the finite difference version of our heat balance equation reduce to if the dispersion length ##l## in the equation just happened to be equal to half our selected grid spacing ##\Delta x##? (That is ##l=\frac{\Delta x}{2}##)
 
  • #112
Chestermiller said:
Let's continue.

Here's a math problem for you: What would the finite difference version of our heat balance equation reduce to if the dispersion length ##l## in the equation just happened to be equal to half our selected grid spacing ##\Delta x##? (That is ##l=\frac{\Delta x}{2}##)
We'll get:
##=\frac{\phi_{x-\Delta x/2}h_{x-\Delta x} -\phi_{x+\Delta x/2} h_{x}}{\Delta x}## ##+\frac{Ua(T_{S,x}-T_x)}{\epsilon}##

Working:
image_67180801.JPG
 
  • #113
casualguitar said:
We'll get:
##=\frac{\phi_{x-\Delta x/2}h_{x-\Delta x} -\phi_{x+\Delta x/2} h_{x}}{\Delta x}## ##+\frac{Ua(T_{S,x}-T_x)}{\epsilon}##

Working:
View attachment 292769
Correct. Do you realize that this is the exact same result you would get if you used upwind differencing on the advection term and if the system did not feature any real physical dispersion? Any thoughts on how you could capitalize on this?
 
  • #114
Chestermiller said:
Correct. Do you realize that this is the exact same result you would get if you used upwind differencing on the advection term and if the system did not feature any real physical dispersion? Any thoughts on how you could capitalize on this?
Ok so finite difference and ##=\frac{\Delta x}{2}## gives the same result as upwind differencing and ##l = 0##?

No I've thought about and I have no good suggestions so far. I guess we are somehow looking to use the advantages the upwind differencing scheme gives, while not assuming physical dispersion is zero? But no, I can't see how we can capitalize. How would we do this?

I have thought about it some more and no nothing jumps out to me. Hmm any hints?
 
Last edited:
  • #115
casualguitar said:
Ok so finite difference and ##=\frac{\Delta x}{2}## gives the same result as upwind differencing and ##l = 0##?

No I've thought about and I have no good suggestions so far. I guess we are somehow looking to use the advantages the upwind differencing scheme gives, while not assuming physical dispersion is zero? But no, I can't see how we can capitalize! How would we do this?
Your guess is correct. We are seeing that a grid spacing of ##\Delta x=2l## gives the exact same amount of numerical dispersion for the upwind differencing scheme without actual dispersion as the more accurate 2nd order scheme with actual dispersion included. So, in this case, the upwind differencing numerical dispersion exactly matches the actual dispersion (at least in the 2nd order approximation). Suppose that, in our full 2nd order scheme with dispersion, a grid spacing of ##\Delta x=2l## were found to be sufficiently adequate to accurately solve the true differential differential equation (and thus to accurately model the real physical system, assuming a constant value of ##l## in the model could do this). Then we could use the upwind difference scheme without dispersion (with its desirable advantages) to model the system, and could employ the grid spacing ##\Delta x##, rather than the dispersion parameter ##l##, as a calibration parameter for matching the experimental data. When we got a match, we would know the value of ##l## that would also match the data with the full 2nd order scheme including dispersion. Your thoughts? (This is entirely new. I have never seen this simple strategy for a dispersion problem with dispersivity parameter ##l## identified before.)
 
  • Like
Likes casualguitar
  • #116
Chestermiller said:
We are seeing that a grid spacing of Δx=2l gives the exact same amount of numerical dispersion for the upwind differencing scheme without actual dispersion as the more accurate 2nd order scheme with actual dispersion included. So, in this case, the upwind differencing numerical dispersion exactly matches the actual dispersion (at least in the 2nd order approximation).
Got it
Chestermiller said:
Suppose that, in our full 2nd order scheme with dispersion, a grid spacing of Δx=2l were found to be sufficiently adequate to accurately solve the true differential differential equation (and thus to accurately model the real physical system, assuming a constant value of l in the model could do this). Then we could use the upwind difference scheme without dispersion (with its desirable advantages) to model the system, and could employ the grid spacing δx, rather than the dispersion parameter l, as a calibration parameter for matching the experimental data. When we got a match, we would know the value of l that would also match the data with the full 2nd order scheme including dispersion. Your thoughts?
So if I follow this correctly, you're saying:
1) Let's use ##\Delta x=2l## to build the model because we can use the upwind scheme without dispersion
2) Once experimental results are produced, we can use ##\Delta x## to match the model with the data
3) If we can match the model to the data well enough, then we can say that using an upwind scheme without dispersion is a valid approach
4) If it is a valid approach, then we can also just divide our ##\Delta x## value by two to find the value of ##l## that would produce the same results in the model with dispersion?

If this is all correct then I follow fully so far
 
  • #117
casualguitar said:
Got it

So if I follow this correctly, you're saying:
1) Let's use ##\Delta x=2l## to build the model because we can use the upwind scheme without dispersion
2) Once experimental results are produced, we can use ##\Delta x## to match the model with the data
3) If we can match the model to the data well enough, then we can say that using an upwind scheme without dispersion is a valid approach
A valid approach to simulate central differencing with dispersion included.
casualguitar said:
4) If it is a valid approach, then we can also just divide our ##\Delta x## value by two to find the value of ##l## that would produce the same results in the model with dispersion?

If this is all correct then I follow fully so far
Yes, you are right on target. But, if this approach is used, I need you to confirm that you are comfortable with it. After all, it is really your research, and you are in the drivers seat. I'm just here to help you identify the possibilities and offer suggestions.

In terms of calibrating the model, might I also suggest doing experiments not on the actual fluid, but on say, just a gas or a liquid without phase change.

Continuing the development, we recognize that, using our unwinding approach, what we are dealing with here conceptually is a series of stirred tanks with the fluid entering each tank having the same enthalpy at that present in the previous tank. For the full heat balance equation corresponding to your result in post #112, what do you get if you substitute ##\phi_{x+\Delta x/2}## from the mass balance equation into this relationship?
 
Last edited:
  • #118
Chestermiller said:
Yes, you are right on target. But, if this approach is used, I need you to confirm that you are comfortable with it. After all, it is really your research, and you are in the drivers seat. I'm just here to help you identify the possibilities and offer suggestions.
I'm comfortable with it. One hope of mine is that work I publish will be 'useful' to others. As I learn I'm hoping that I will get a better intuition for spotting 'useful' research. For example, is this approach (above) as useful as one that uses known correlations for the dispersion coefficient, for example? I think at some stage I would like to compare this approach with a model that uses correlations for the dispersion coefficient, however as you said the idea is to gradually build in complexity so I think this is a solid approach that I'm 100% happy to work on

But yes as I go I will aim to focus on doing the widely 'useful' model rather than any other
Chestermiller said:
In terms of calibrating the model, might I also suggest doing experiments not on the actual fluid, but on say, just a gas or a liquid without phase change.
Can do there are plenty options available in the lab for this
Chestermiller said:
Continuing the development, we recognize that, using our unwinding approach, what we are dealing with here conceptually is a series of stirred tanks with the fluid entering each tank having the same enthalpy at that present in the previous tank. For the full unwinding heat balance equation corresponding to your result in post #112, what do you get if you substitute ϕx+Δx/2 from the mass balance equation into this relationship?
Working on this now
 
  • #119
Chestermiller said:
what do you get if you substitute ϕx+Δx/2 from the mass balance equation into this relationship?
Hmm I'm not sure I understand. Are you asking me to solve for \phi_{x+\Delta x/2} in the fluid mass balance equation, and to sub this into the heat balance in #112?

Ah if you are saying this I think I see why. We would have the mass flux in terms of the mass flux 'upwind' and the density? The idea here being to get things in terms of the upwind parameters? If the above is true, I am not sure how to deal with the density derivative

Got a result. Posting now
 
Last edited:
  • #120
casualguitar said:
Hmm I'm not sure I understand. Are you asking me to solve for \phi_{x+\Delta x/2} in the fluid mass balance equation, and to sub this into the heat balance in #112?

Ah if you are saying this I think I see why. We would have the mass flux in terms of the mass flux 'upwind' and the density? The idea here being to get things in terms of the upwind parameters? If the above is true, I am not sure how to deal with the density derivative

Got a result. Posting now
Yes. That is what I am asking for.
 
  • #121
Chestermiller said:
Yes. That is what I am asking for.
Result:
image_67144705.JPG

Is this correct?

So what I take from the above is:
1) We've got the enthalpy in terms of upwind mass flux and enthalpy values
2) We've also combined the mass and heat balances into one (removing the density derivative)

Also, is it correct to say we haven't really made any assumptions yet in terms of:
1) where saturation will occur (one temperature or a range)
2) which parameters are constant (none assumed constant yet)

So this equation is general enough to be used for a range of future models? i.e. the boiling range and non-constant parameter models?

EDIT: Whoops just noticing I left out the last term. Let me fix it
 
Last edited:
  • #122
casualguitar said:
Whoops just noticing I left out the last term. Let me fix it
Fixed it. I had just forgotten to add the final term back in:
image_67206657.JPG
 
  • #123
casualguitar said:
Result:
View attachment 292788
Is this correct?
You're missing a factor of ##\rho_x## on the LHS.
casualguitar said:
So what I take from the above is:
1) We've got the enthalpy in terms of upwind mass flux and enthalpy values
2) We've also combined the mass and heat balances into one (removing the density derivative)
Yes, but we're still going to need to use the mass balance equation...to be discussed soon
casualguitar said:
Also, is it correct to say we haven't really made any assumptions yet in terms of:
1) where saturation will occur (one temperature or a range)
2) which parameters are constant (none assumed constant yet)
Yes.
casualguitar said:
So this equation is general enough to be used for a range of future models? i.e. the boiling range and non-constant parameter models?
probably
casualguitar said:
EDIT: Whoops just noticing I left out the last term. Let me fix it
Please compare this new version of the heat balance equation with the single tank lumped model we developed previously.

Isn't it past your bedtime? Don't you ever sleep?

Do you really play guitar? I play blues keyboard.
 
  • #124
Chestermiller said:
You're missing a factor of ρx on the LHS.
Third time lucky:
image_67194625.JPG

Chestermiller said:
Yes, but we're still going to need to use the mass balance equation...to be discussed soon
Got it
Chestermiller said:
Please compare this new version of the heat balance equation with the single tank lumped model we developed previously.
To clarify, compare with post #38?
Chestermiller said:
Isn't it past your bedtime? Don't you ever sleep?
On occasion I do. Doing a PhD mostly from home (so far) is tough because any small thing that could have been answered by a postdoc/other research student in the lab as a throwaway comment turns into hours (or days) of me trying to figure it out myself (I will never underestimate the usefulness of a lab environment again once life returns to normal). So yes I value progressing this conversation, and conversations like this, more than sleep! It is bedtime now though
Chestermiller said:
Do you really play guitar? I play blues keyboard.
I do play. Mostly fingerstyle guitar covers of well known songs like this if you're interested:

I haven't had a chance to post in months although I am learning jingle bells currently. Hopefully in time for christmas!

Do you play music from any musicians in particular?
 
  • #125
casualguitar said:
Third time lucky:
View attachment 292791

Got it

To clarify, compare with post #38?
No. Post #57
casualguitar said:
On occasion I do. Doing a PhD mostly from home (so far) is tough because any small thing that could have been answered by a postdoc/other research student in the lab as a throwaway comment turns into hours (or days) of me trying to figure it out myself (I will never underestimate the usefulness of a lab environment again once life returns to normal). So yes I value progressing this conversation, and conversations like this, more than sleep! It is bedtime now though
I assume you have an advisor. We've covered a lot of ground so far, and you need to run all this by him/her so that they can be brought up to date and have an opportunity to comment. If you are going to do this using the approach that we've gravitated to, you need to get their sign-off on it. Otherwise, you could face big trouble later.
casualguitar said:
I do play. Mostly fingerstyle guitar covers of well known songs like this if you're interested:

Enjoyed your performance. Was this by ear or from sheet music?
casualguitar said:
I haven't had a chance to post in months although I am learning jingle bells currently. Hopefully in time for christmas!

Do you play music from any musicians in particular?
I used to be in a ballroom dance band, playing for cotillions, dancing school events, and weddings. We did fox trots, jitterbug, waltz, rumba, cha cha, salsa, tango, meringue, samba. But I'm no longer involved in such because the rehearsal took up too much time and we basically got paid very little (not that that mattered). In addition, I've developed Parkinson's starting 18 months ago, so my dexterity and balance have deteriorated. I could no longer carry all that heavy equipment (keyboard, speaker, music stand, piano seat, electrical wiring) and get everything connected with dexterity; plus my playing has deteriorated because of erosion of my motor skills. It really sucks. Even typing this is difficult.
 
  • #126
Chestermiller said:
No. Post #57
Got it. Oh that's interesting, they're extremely similar. I know exactly what you mean now by 'series of stirred tanks'. We've converted the single tank lumped model into a series of stirred tanks model by essentially replacing the ##{m}_{in}## and ##h_{in}## terms we had in the single tank lumped model with the flux/enthalpy to each of the 'sub tanks' I suppose you could call them. Basically we're updating enthalpy and mass flux for each cell rather than taxing the initial values. I think this is simply equivalent to saying we are now considering space as a variable that affects flux and enthalpy, when previously we were not

Chestermiller said:
I assume you have an advisor. We've covered a lot of ground so far, and you need to run all this by him/her so that they can be brought up to date and have an opportunity to comment. If you are going to do this using the approach that we've gravitated to, you need to get their sign-off on it. Otherwise, you could face big trouble later.
I do have an advisor and I can confirm that I will be getting sign off on this progress this week. He won't mind about the general modelling approach taken, but will have comments on the required functionality of the model absolutely. It won't be a problem getting approval on this
Chestermiller said:
Enjoyed your performance. Was this by ear or from sheet music?
Sheet music. Most stuff I play is broadly similar to that. At the start of Covid I played constantly and improved a lot. Now I only play on occasion. That cover was arranged by Kent Nishimura, who is probably my favourite guitarist right now (if you're interested have a look at his YouTube channel, there are songs spanning a broad range of genres/decades)

Chestermiller said:
I used to be in a ballroom dance band, playing for cotillions, dancing school events, and weddings. We did fox trots, jitterbug, waltz, rumba, cha cha, salsa, tango, meringue, samba. But I'm no longer involved in such because the rehearsal took up too much time and we basically got paid very little (not that that mattered). In addition, I've developed Parkinson's starting 18 months ago, so my dexterity and balance have deteriorated. I could no longer carry all that heavy equipment (keyboard, speaker, music stand, piano seat, electrical wiring) and get everything connected with dexterity; plus my playing has deteriorated because of erosion of my motor skills. It really sucks. Even typing this is difficult.
Very cool. I would imagine playing in a band is a lot more enjoyable than solo play! I'd love to play with a band. Sorry to hear about your Parkinson's. I would guess playing piano actually could actually help with Parkinson's though? In terms of maintaining dexterity/motor skills? Ever consider a piano YouTube channel?
 
  • #127
If we multiply the finite difference versions of the mass balance equation and energy balance equation for the fluid by ##A_C\epsilon\Delta x##, where ##A_C## is the overall cross sectional are of the bed, we obtain :$$\frac{m_j}{dt}=\dot{m}_{j-1}-\dot{m}_j\tag{1}$$and $$m_j\frac{dh_j}{dt}=\dot{m}_{j-1}(h_{j-1}-h_j)+UA_j(T_{S,j}-T_j)\tag{2}$$where the subscript j refers to the j'th tank, ##m_j=\rho_jA_C\epsilon \Delta x=\rho_j(V/n)## is the mass of fluid in the j'th tank, V is the total pore volume of the bed, n is the total number of tanks (grid spaces) in the bed, ##\dot{m_j}=\phi_{x+\Delta x/2}A_C\epsilon## is the mass rate of fluid flow exiting the j'th tank, and ##A_j=A/n## is the heat transfer area in the j'th tank (equal to the total heat transfer area in the bed A divided by the number of tanks).

Similarly, if we multiply our energy balance on the bed by ##A_C(1-\epsilon)\Delta x##, we obtain
$$m_{S,j}C_{PS}\frac{dT_{S,j}}{dt}=UA_j(T_j-T_{S,j})\tag{3}$$ where ##m_{S,j}=\rho_S A_C(1-\epsilon)\Delta x=M_S/n## is the mass of solid packing in the j'th tank and ##M_S## is the total mass of solid in the bed.

We can find the rate of fluid flow exiting the j'th tank (and entering the (j_1)'th tank) by rearranging Eqn. 1 to read: $$\dot{m}_j=\dot{m}_{j-1}-\frac{dm_j}{dt}\tag{4a}$$with $$\frac{dm_j}{dt}=\frac{V}{n}\frac{d\rho_j}{dt}=\frac{V}{n}\left(\frac{d\rho}{dh}\right)_j\frac{dh_j}{dt}\tag{4b}$$
 
  • #128
Chestermiller said:
If we multiply the finite difference versions of the mass balance equation and energy balance equation for the fluid by ACϵΔx, where AC is the overall cross sectional are of the bed, we obtain :(1)mjdt=m˙j−1−m˙jand (2)mjdhjdt=m˙j−1(hj−1−hj)+UAj(TS,j−Tj)where the subscript j refers to the j'th tank, mj=ρjACϵΔx=ρj(V/n) is the mass of fluid in the j'th tank, V is the total pore volume of the bed, n is the total number of tanks (grid spaces) in the bed, mj˙=ϕx+Δx/2ACϵ is the mass rate of fluid flow exiting the j'th tank, and Aj=A/n is the heat transfer area in the j'th tank (equal to the total heat transfer area in the bed A divided by the number of tanks).

Similarly, if we multiply our energy balance on the bed by AC(1−ϵ)Δx, we obtain
(3)mS,jCPSdTS,jdt=UAj(Tj−TS,j) where mS,j=ρSAC(1−ϵ)Δx=MS/n is the mass of solid packing in the j'th tank and MS is the total mass of solid in the bed.
I follow this much exactly. Makes perfect sense
Chestermiller said:
We can find the rate of fluid flow exiting the j'th tank (and entering the (j_1)'th tank) by rearranging Eqn. 1 to read: ##m˙j=m˙j−1−\frac{dm_j}{dt}## with ##\frac{dm_j}{dt}=\frac{V}{n}\frac{d\rho_j}{dt}=\frac{V}{n}\left(\frac{d\rho}{dh}\right)_j\frac{dh_j}{dt}\tag{4b}##
I follow the maths here also.

So the flow of calculations here may be:
1) ##4b## supplies ##4a## with ##\frac{dm_j}{dt}##
2) ##4a## calculates ##\dot{m}_j##
3) ##4a## supplies ##\dot{m}_j## to equation ##2##
4) Then we're at the point of having all required inputs for eq ##2## and ##3## which can then be solved
5) The new ##\frac{dh_j}{dt}## value can be subbed into ##4b## to repeat the cycle

However, I've skipped over the ##\frac{d\rho}{dh}## term here, which we don't have an equation for.

Guess for model progression from here:
Equation ##4b## does have a ##\frac{dh_j}{dt}## term in it though which means we could probably use equation two to help solve for ##\frac{d\rho}{dh}##. So my guess here would be that we won't need a relation for ##\frac{d\rho}{dh}##, instead we will have something like ##3## equations solving ##3## unknowns, rather than two equations and two unknowns like usual?

Edit: Also, I'm working on that 'documentation of the work so far' powerpoint now. What exactly we've done from the start is a bit hazy for me, so I think it will be interesting to see

Edit 2: Also out of curiosity what musicians do you play/listen to? Always looking for new music to listen to/play
 
Last edited:
  • #129
casualguitar said:
I follow this much exactly. Makes perfect sense

I follow the maths here also.

So the flow of calculations here may be:
1) ##4b## supplies ##4a## with ##\frac{dm_j}{dt}##
2) ##4a## calculates ##\dot{m}_j##
3) ##4a## supplies ##\dot{m}_j## to equation ##2##
4) Then we're at the point of having all required inputs for eq ##2## and ##3## which can then be solved
5) The new ##\frac{dh_j}{dt}## value can be subbed into ##4b## to repeat the cycle

However, I've skipped over the ##\frac{d\rho}{dh}## term here, which we don't have an equation for.

Guess for model progression from here:
Equation ##4b## does have a ##\frac{dh_j}{dt}## term in it though which means we could probably use equation two to help solve for ##\frac{d\rho}{dh}##. So my guess here would be that we won't need a relation for ##\frac{d\rho}{dh}##, instead we will have something like ##3## equations solving ##3## unknowns, rather than two equations and two unknowns like usual?

Edit: Also, I'm working on that 'documentation of the work so far' powerpoint now. What exactly we've done from the start is a bit hazy for me, so I think it will be interesting to see

Edit 2: Also out of curiosity what musicians do you play/listen to? Always looking for new music to listen to/play
The primary objective is: knowing the values h, ##\rho##, T, and ##T_S## in each of the tanks, getting the time derivatives of h and ##T_S## in each of the tanks. Understand that, in the previous lumped model, we had expressed both ##\rho## and T as physical property functions of h for each of the three enthalpy regions (liquid, saturated liquid-vapor mixture, and vapor). We use these exact same physical property relationships in this model. This allows us to determine ##d\rho/dh## for any tank in the sequence.

The computational flow goes like this:
1. Focus first on the 1st tank
2. We know ##\dot{m}_0## because this the mass flow rate into the bed.
3. Use Eqn. 2 to get ##dh_1/dt##
4. Use Eqn. 4b to get ##dm_1/dt##
5. Use Eqn. 4a to get ##\dot{m}_1## (the mass flow rate from tank 1 into tank 2)
6. Use Eqn. 3 to get ##dT_{S,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).
 
  • Like
Likes casualguitar
  • #130
I have a recommendation. Get some practice applying Eqns. 4 by using the lumped model to determine the mass flow rate out of the tank as a function of time. (We didn't do this in the lumped model so far because it was not needed.). See if you can make a graph of this (of course using a semilog scale for the mass flow rate out).

Blues musicians I like: B.B. King, Dr. John, Professor Longhair, John Lee Hooker, Pine Top Smith, Pine Top Perkins, Daryl Davis, Muddy Waters, Elmore James, Stevie Ray Vaughn, Katie Webster, Susan Tedeschi
 
  • #131
Chestermiller said:
We use these exact same physical property relationships in this model. This allows us to determine dρ/dh for any tank in the sequence.
Got it. I think I follow everything there except the above line. I'm not sure of we can get ##d\rho/dh##

So the relationships from post #62 give ##\rho(H)## and ##T(H)##:

If ##h\leq 0## then:
$$T=T_{sat}+h/C_{PL}$$
$$m=\rho_L V$$

If ##0\leq h \leq \Delta h_{vap}## then:
$$T=T_{sat}$$
$$m=\frac{V}{\left[\frac{1}{\rho_L}+\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)\left(\frac{h}{\Delta h_{vap}}\right)\right]}$$

If ##\Delta h_{vap}\leq h## then:
$$T=T_{sat}+(h-\Delta h_{vap})/C_{PV}$$
$$m=\frac{PM}{RT} V$$

Chestermiller said:
4. Use Eqn. 4b to get dm_1/dt
So for this calculation we need ##d\rho/dh##. Looking at the above equations, I can see that it will be 0 for the liquid phase because m is not a function of T. However for the other two cases we will need to know how to calculate ##d\rho/dh##. It is as simple as:
$$\frac{d\rho}{dh} = \frac{d\rho_j - d\rho_{j-1}}{h_j - h_{j-1}}$$

We would have the ##j-1## terms from the previous iteration, and we would have ##h_j## and ##h_{j-1}##. We're just missing ##\rho_j## then which we would calculate with your ##\rho(h)## correlations

Does that look right?
 
Last edited:
  • #132
Chestermiller said:
I have a recommendation. Get some practice applying Eqns. 4 by using the lumped model to determine the mass flow rate out of the tank as a function of time. (We didn't do this in the lumped model so far because it was not needed.). See if you can make a graph of this (of course using a semilog scale for the mass flow rate out).
I'll do this yes, I'd like to finish talking about this model (and I'll try write out a full model flow) first and then I'll start modelling with your recommendation
Chestermiller said:
Blues musicians I like: B.B. King, Dr. John, Professor Longhair, John Lee Hooker, Pine Top Smith, Pine Top Perkins, Daryl Davis, Muddy Waters, Elmore James, Stevie Ray Vaughn, Katie Webster, Susan Tedeschi
Oh interesting, I'll be honest the only musicians I know here are B.B. King and SRV (big fan of both, because of the guitar playing). I have never heard of any of the others. I guess I'll recognise songs if they're well known, but I'm not aware of any of them anyway. Might as well throw them on Spotify as background music for the day then!
 
Last edited:
  • #133
casualguitar said:
Got it. I think I follow everything there except the above line. I'm not sure of we can get ##d\rho/dh##

So the relationships from post #62 give ##\rho(H)## and ##T(H)##:

If ##h\leq 0## then:
$$T=T_{sat}+h/C_{PL}$$
$$m=\frac{V}{\left[\frac{1}{\rho_L}+\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)\left(\frac{h}{\Delta h_{vap}}\right)\right]}$$

If ##0\leq h \leq \Delta h_{vap}## then:
$$T=T_{sat}$$
$$m=\frac{V}{\left[\frac{1}{\rho_L}+\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)\left(\frac{h}{\Delta h_{vap}}\right)\right]}$$

If ##\Delta h_{vap}\leq h## then:
$$T=T_{sat}+(h-\Delta h_{vap})/C_{PV}$$
$$m=\frac{PM}{RT} V$$So for this calculation we need ##d\rho/dh##. Looking at the above equations, I can see that it will be 0 for the liquid phase because m is not a function of T. However for the other two cases we will need to know how to calculate ##d\rho/dh##. It is as simple as:
$$\frac{d\rho}{dh} = \frac{d\rho_j - d\rho_{j-1}}{h_j - h_{j-1}}$$

We would have the ##j-1## terms from the previous iteration, and we would have ##h_j## and ##h_{j-1}##. We're just missing ##\rho_j## then which we would calculate with your ##\rho(h)## correlations

Does that look right?
No. The derivative is evaluated analytically for the same tank, with no reference to adjacent tanks. For the liquid/vapor region, the density is $$\rho=\frac{1}{\left[\frac{1}{\rho_L}+\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)\left(\frac{h}{\Delta h_{vap}}\right)\right]}$$So you just differentiate this analytically with respect to h. Similarly for the pure vapor region.
 
  • #134
Chestermiller said:
No. The derivative is evaluated analytically for the same tank, with no reference to adjacent tanks. For the liquid/vapor region, the density is $$\rho=\frac{1}{\left[\frac{1}{\rho_L}+\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)\left(\frac{h}{\Delta h_{vap}}\right)\right]}$$So you just differentiate this analytically with respect to h. Similarly for the pure vapor region.
Ah nice I see, got it. These are the results I got for the derivatives:
image_67149313.JPG

The negative sign shows the density will decrease with increasing enthalpy which is what we want I think i.e. more vapour = lower density

I think you have already laid out the full flow of calculations in post #129, but I'm going to read back through to be sure I follow the flow. So if we choose ##T_sat## and ##\Delta h_{vap}##, we're at the point of being able to model this it looks like?

It looks quite a bit more difficult to model than the previous models. So I'm going to avoid trying to model this, until I've implemented your recommendation above
 
  • #135
casualguitar said:
Ah nice I see, got it. These are the results I got for the derivatives:
View attachment 292908
The negative sign shows the density will decrease with increasing enthalpy which is what we want I think i.e. more vapour = lower density
That's not what I get when I differentiate. For the liquid/vapor region, I get:$$\frac{d\rho}{dh}=-\rho^2\frac{\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)}{\Delta h_{vap}}$$
and for the pure vapor region, I get:$$\frac{d\rho}{dh}=-\frac{PM}{C_{PV}RT^2}=-\frac{\rho}{C_{PV}T}$$I guess the latter is equivalent to what you had, but it's a much more compact form.
 
Last edited:
  • #136
Chestermiller said:
That's not what I get when I differentiate. For the liquid/vapor region, I get:$$\frac{d\rho}{dh}=-\rho^2\frac{\left(\frac{RT_{sat}}{PM}-\frac{1}{\rho_L}\right)}{\Delta h_{vap}}$$
and for the pure vapor region, I get:$$\frac{d\rho}{dh}=-\frac{PM}{C_{PV}RT^2}=-\frac{\rho}{C_{PV}T}$$I guess the latter is equivalent to what you had, but it's a much more compact form.
Hmm I see your solution for the liquid/vapour region has ##\rho## in it rather than ##h##. What relation are you using to replace ##h## with ##\rho##?
 
  • #137
casualguitar said:
Hmm I see your solution for the liquid/vapour region has ##\rho## in it rather than ##h##. What relation are you using to replace ##h## with ##\rho##?
I use the original equation for ##\rho##. $$1/denom^2=\rho^2$$

In particular, if $$\rho=\frac{1}{D}$$the$$\frac{d\rho}{dh}=-\frac{1}{D^2}\frac{dD}{dh}=-\rho^2\frac{dD}{dh}$$
 
Last edited:
  • #138
Chestermiller said:
I use the original equation for ##\rho##. $$1/denom^2=\rho^2$$

In particular, if $$\rho=\frac{1}{D}$$the$$\frac{d\rho}{dh}=-\frac{1}{D^2}\frac{dD}{dh}=-\rho^2\frac{dD}{dh}$$
Ahh I follow now. Why is it advantageous to sub ##\rho## back in though? Less code I guess, given that we'll already have an existing density function?

I'll summarise everything you've said on this model in the next comment
 
  • #139
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).
Yep I have effectively nothing to add to this summary, other than we will need to calculate ##\frac{d\rho}{dh}## before \frac{d_{m1}}{dt}, which we can do with your liquid/vapour/liquid-vapour enthalpy density/temperature equations

Chestermiller said:
I have a recommendation. Get some practice applying Eqns. 4 by using the lumped model to determine the mass flow rate out of the tank as a function of time. (We didn't do this in the lumped model so far because it was not needed.). See if you can make a graph of this (of course using a semilog scale for the mass flow rate out).
I guess I'll still need equations 2 and 3 here? Or are you describing a simpler model?

So the idea would be to not calculate mass flow/enthalpy at each point, but assume it is constant throughout the vessel (as we did previously). Then we can use the mass equations to calculate the hold-up mass and the mass flow out at any time?
 
  • #140
casualguitar said:
Ahh I follow now. Why is it advantageous to sub ##\rho## back in though? Less code I guess, given that we'll already have an existing density function?

I'll summarise everything you've said on this model in the next comment
Once you know h at all the grid cells, you also know ##\rho## and T. And, once you know those, you also know ##d\rho/dt##
 
  • #141
casualguitar said:
Yep I have effectively nothing to add to this summary, other than we will need to calculate ##\frac{d\rho}{dh}## before \frac{d_{m1}}{dt}, which we can do with your liquid/vapour/liquid-vapour enthalpy density/temperature equationsI guess I'll still need equations 2 and 3 here? Or are you describing a simpler model?

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

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

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

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

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

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