Modelling of two phase flow in packed bed using conservation equations

Click For 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.
  • #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:
Engineering news on Phys.org
  • #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?
 

Similar threads

  • · Replies 427 ·
15
Replies
427
Views
24K
  • · Replies 18 ·
Replies
18
Views
2K
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 48 ·
2
Replies
48
Views
5K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 35 ·
2
Replies
35
Views
4K
  • · Replies 8 ·
Replies
8
Views
9K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 67 ·
3
Replies
67
Views
6K