Cannot find the Temperature Change inside of a Tank

Click For Summary
The discussion revolves around the challenge of determining the internal temperature change in a pressurized tank containing real gas when additional gas is added at a different temperature. The original poster expresses frustration over the lack of clear solutions and references, particularly regarding the application of the Van der Waals equation of state instead of the ideal gas law. Key points include the complexities of energy transfer, mixing dynamics, and the need for an understanding of the open-system version of the first law of thermodynamics. Participants discuss the relationship between internal energy, enthalpy, and the effects of specific volume on these properties. The conversation highlights the need for further research and clarification on thermodynamic principles to address the problem effectively.
  • #31
treddie said:
This is a Van der Waals gas, but all I can find are Cv tables for ideal gases at various "ideal" temperatures. If I look for information on calculating Cv for real gases, I find this gets complicated very quickly. Basically I end up with having to know the energy change, ##\delta u##, to calculate Cv, but I don't know ##\delta u##.
The ideal gas molar heat capacity Cv of air in your temperature range of interest is 2.5 R, where R is the ideal gas constant. For a Van der Waals model of air, Cv is exactly the same value. So, if you are going to use the Van der Waals equation of state to describe your gas, you use the ideal gas value of Cv. This is a general characteristic of a Van der Waals gas: Cv for the Van der Waals gas is exactly the same as the ideal gas value.

If you can't solve this problem for an ideal gas, you certainly won't be able to do it for a Van der Waals gas. So you might as well get some practice first, solving the problem assuming ideal gas behavior. You are extremely close to the final answer. The equation you wrote in Post #28 is the desired algebraic solution, and now all you need to do is plug in parameter values.
 
  • Like
Likes treddie
Science news on Phys.org
  • #32
Oops. Sorry. I need to take a step back from what I said in my previous couple of posts. For a Van der Waals gas, the internal energy is indeed not just a function of temperature, but also a function of specific volume v. However, I was correct in saying that the heat capacity at constant volume is independent of specific volume (and a function only of temperature). The correct relationships should be as follows:
$$u_f-u_0=C_v(T_f-T_0)+a\left(\frac{1}{v_0}-\frac{1}{v_f}\right)$$
and
$$u_{in}-u_0=C_v(T_{in}-T_0)+a\left(\frac{1}{v_0}-\frac{1}{v_{in}}\right)$$
with ##v_0=V/m_0##, ##v_f=V/m_f##, "a" is the Van der Waals pressure constant, and where V is the volume of the tank.
 
  • Like
Likes treddie
  • #33
Thank you for the update!

I am currently making revisions.
 
  • #34
Here is the revision to the final equation (post 28) for a Van der Waals gas, transient open-system:

##T_f = \frac{\Delta m}{m_o + \Delta m} \left( T_{in} - T_o + \frac{a}{v_oC_v} - \frac{a}{v_{in}C_v} \right) + \frac{\Delta m}{m_o + \Delta m} \left( \frac{(Pv)_{in}}{C_v} \right) - \frac{a}{v_oC_v} + \frac{a}{v_fC_v} + T_o##

Now, that original post 28...Would that be for an ideal gas?
 
  • #35
treddie said:
Here is the revision to the final equation (post 28) for a Van der Waals gas, transient open-system:

##T_f = \frac{\Delta m}{m_o + \Delta m} \left( T_{in} - T_o + \frac{a}{v_oC_v} - \frac{a}{v_{in}C_v} \right) + \frac{\Delta m}{m_o + \Delta m} \left( \frac{(Pv)_{in}}{C_v} \right) - \frac{a}{v_oC_v} + \frac{a}{v_fC_v} + T_o##

Now, that original post 28...Would that be for an ideal gas?
That's not what I get. I obtain:
$$T_f=\left(\frac{m_0}{m_0+\Delta m}\right)T_0+\left(\frac{\Delta m}{m_0+\Delta m}\right)T_{in}+\frac{a}{VC_v}\left(\frac{\Delta m}{m_0+\Delta m}\right)\left(2m_0+\Delta m-\frac{V}{v_{in}}\right)+\left(\frac{\Delta m}{m_0+\Delta m}\right)\frac{(Pv)_{in}}{C_v}$$

That original would indeed be for an ideal gas, if you can get the (Pv)in correct.
 
  • Like
Likes treddie
  • #36
Interesting...I have gone through my steps and cannot find anything wrong. I ran it through Maple, but of course it went about it differently and came up with an equivalent to mine, if mine is indeed correct. Perhaps mine and yours are equivalent. At any rate, here is what I did:

##u_f - u_o = \frac{\Delta m}{m_o + \Delta m}(u_{in} - u_o) + \frac{\Delta m}{m_o + \Delta m}(Pv)_{in}##

The substitutions were:

##u_f - u_o = C_v(T_f - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_f} \right)##

##u_{in} - u_o = C_v(T_{in} - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_{in}} \right)##

Substituting,

##C_v(T_f - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_f} \right) = \frac{\Delta m}{m_o + \Delta m} \left(C_v(T_{in} - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_{in}} \right) \right)+ \frac{\Delta m}{m_o + \Delta m}(Pv)_{in}##

Simplifying,

##T_f = \frac{\Delta m}{m_o + \Delta m} \left( T_{in} - T_o + \frac{a}{v_oC_v} - \frac{a}{v_{in}C_v} \right) + \frac{\Delta m}{m_o + \Delta m} \left( \frac{(Pv)_{in}}{C_v} \right) - \frac{a}{v_oC_v} + \frac{a}{v_fC_v} + T_o##

I can show the intermediate steps if you want.
 
  • #37
treddie said:
Interesting...I have gone through my steps and cannot find anything wrong. I ran it through Maple, but of course it went about it differently and came up with an equivalent to mine, if mine is indeed correct. Perhaps mine and yours are equivalent. At any rate, here is what I did:

##u_f - u_o = \frac{\Delta m}{m_o + \Delta m}(u_{in} - u_o) + \frac{\Delta m}{m_o + \Delta m}(Pv)_{in}##

The substitutions were:

##u_f - u_o = C_v(T_f - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_f} \right)##

##u_{in} - u_o = C_v(T_{in} - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_{in}} \right)##

Substituting,

##C_v(T_f - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_f} \right) = \frac{\Delta m}{m_o + \Delta m} \left(C_v(T_{in} - T_o) + a \left( \frac{1}{v_o} - \frac{1}{v_{in}} \right) \right)+ \frac{\Delta m}{m_o + \Delta m}(Pv)_{in}##

Simplifying,

##T_f = \frac{\Delta m}{m_o + \Delta m} \left( T_{in} - T_o + \frac{a}{v_oC_v} - \frac{a}{v_{in}C_v} \right) + \frac{\Delta m}{m_o + \Delta m} \left( \frac{(Pv)_{in}}{C_v} \right) - \frac{a}{v_oC_v} + \frac{a}{v_fC_v} + T_o##

I can show the intermediate steps if you want.
Sorry. You're right. The two are equivalent. But, you also need to eliminate v0 and vf by using ##v_0=V/m_0## and ##v_f=V/m_v##, where V is the volume of the tank.
 
  • Like
Likes treddie
  • #38
DoH!

##T_f = \frac{\Delta m}{m_o + \Delta m} \left( T_{in} - T_o + \frac{a}{\frac{V}{m_o}C_v} - \frac{a}{v_{in}C_v} \right) + \frac{\Delta m}{m_o + \Delta m} \left( \frac{(Pv)_{in}}{C_v} \right) - \frac{a}{\frac{V}{m_o}C_v} + \frac{a}{\frac{V}{m_f}C_v} + T_o##

Now, in the Pv term, is "v" the specific volume of the inlet mass?
 
  • #39
treddie said:
DoH!

##T_f = \frac{\Delta m}{m_o + \Delta m} \left( T_{in} - T_o + \frac{a}{\frac{V}{m_o}C_v} - \frac{a}{v_{in}C_v} \right) + \frac{\Delta m}{m_o + \Delta m} \left( \frac{(Pv)_{in}}{C_v} \right) - \frac{a}{\frac{V}{m_o}C_v} + \frac{a}{\frac{V}{m_f}C_v} + T_o##

Now, in the Pv term, is "v" the specific volume of the inlet mass?
T_in, P_in and v_in are the values in the inlet line to the tank, upstream of the inlet valve. The change in gas enthalpy per mole across the inlet valve is zero.
 
  • Like
Likes treddie
  • #40
Cool. Thanks!
 
  • #41
treddie said:
Cool. Thanks!
Please solve for the ideal gas case first so that you have something to compare with. Just a good modeling practice.
 
  • Like
Likes treddie
  • #42
Chet, one thing. As I am preparing my variables and initial conditions (making sure my units are all consistent and correct) I have come to the term ##v_f##, the final specific volume, where ##v_f = \frac{V}{m_f}##. My confusion is about the nature of ##m_f##. I would assume that ##m_o + \Delta m## IS ##m_f##, unless we are iterating through from initial state to a final state in increments of ##\Delta m##. This would mean that ##m_f## is my stopping point. From the perspective of a programmer, that makes sense to me, but from a pure math point and the fact that we are dealing with an equation here, it bugs me. I feel I am missing something subtle here.
 
  • #43
treddie said:
Chet, one thing. As I am preparing my variables and initial conditions (making sure my units are all consistent and correct) I have come to the term ##v_f##, the final specific volume, where ##v_f = \frac{V}{m_f}##. My confusion is about the nature of ##m_f##. I would assume that ##m_o + \Delta m## IS ##m_f##, unless we are iterating through from initial state to a final state in increments of ##\Delta m##. This would mean that ##m_f## is my stopping point. From the perspective of a programmer, that makes sense to me, but from a pure math point and the fact that we are dealing with an equation here, it bugs me. I feel I am missing something subtle here.
##\Delta m## is the change in moles through any arbitrary time, not just the final time.
 
  • Like
Likes treddie
  • #44
I thought "m" and "##\Delta m##" were mass, and change in mass.

At any rate, this is what bugs me...It seems I could make ##m_f## arbitrarily high as well, thus "bracketing" the whole process into a specific final amount , ##m_f## that could get really huge, thus affecting the outcome. It seems like an irrelevant term in that I should not have to worry about ##m_f##...##\Delta m## should be able to get me as far as I want to go, meaning that ##m_o + \Delta m## would always equal ##m_f##. I know this does not have anything to do with the ideal case, but it IS going to be important in the real case.
 
  • #45
You can work in terms of m being mass, but it's easier to work in terms of moles. Of course, the two differ only by the molecular weight. But, if you are working in terms of moles, then, from the ideal gas law (i.e., at least for the case of an ideal gas), ##(Pv)_{in}=RT_{in}##. There is no need to bring molecular weight into the calculation if you work the problem in terms of moles.

Regarding the final mass (or moles) in the tank, there is an additional constraint on this problem that we haven't discussed. The pressure buildup in the tank can not be higher than the pressure in the inlet line. So you need a relationship describing the relationship between the molar (or mass) flow rate into the tank and the pressure drop across the inlet valve. I was sure you were aware of this.
 
  • Like
Likes treddie
  • #46
Your first point makes perfect sense. The second one makes sense in that, yes, the flow rate will drop as the back pressure increases if the line pressure remains constant, but that would be true for the ideal case as well. Yet no ##m_f## term exists in the ideal equation for ##T_f##.
 
  • #47
treddie said:
Your first point makes perfect sense. The second one makes sense in that, yes, the flow rate will drop as the back pressure increases if the line pressure remains constant, but that would be true for the ideal case as well. Yet no ##m_f## term exists in the ideal equation for ##T_f##.
Of course it does. mf is not just the moles inside the tank in the final state. It is the number of moles in the tank at any instant of time. And Tf is not just the moles inside the tank in the final state. it is the temperature in the tank at any time.
 
  • Like
Likes treddie
  • #48
Ahhhh, yes! Of course.

And I forgot to mention that I had always assumed in my model, a constant differential pressure between the line and the tank, so that the flow rate would remain constant. I went with that case only because filling, say a vehicle CNG tank, would get preposterously slow near the end of the tank fill, if the line pressure was constant and close to the final desired tank pressure. So I simplified my thought experiment by simply letting the delta pressure remain constant, and when a limit was given for the final tank pressure, the inlet valve would close.
 
  • #49
treddie said:
Let
##a = \frac{\Delta m} {m_o + \Delta m}##

Then,
##T_f = a(T_{in} - T_o) + \frac{a(Pv)_{in}}{C_v} + T_o##
Show that the solution to this is:
$$T_f=T_0+a(\gamma T_{in}-T_0)$$ where ##\gamma = C_p/C_v##, so that if you plot a graph of ##T_f## vs a, the value of Tf at a = 0 is To, and the value of Tf at a = 1 is ##\gamma T_{in}##.
 
  • Like
Likes treddie
  • #50
If I simultaneously solve the two, I get what would appear to be an intersection of them, not an equality. But in the process found that for that special case,
##(Pv)_{in} = T_{in}(C_p - C_v)##

And since, for an ideal gas,

##C_v = C_p - nR##

Then

##(Pv)_{in} = T_{in}(nR)##
 
  • #51
treddie said:
If I simultaneously solve the two, I get what would appear to be an intersection of them, not an equality. But in the process found that for that special case,
##(Pv)_{in} = T_{in}(C_p - C_v)##

And since, for an ideal gas,

##C_v = C_p - nR##

Then

##(Pv)_{in} = T_{in}(nR)##
Actually, there shouldn’t be an n. v is volume per mole.
 
  • Like
Likes treddie
  • #52
Arghh! Those damn moles and units! I am becoming constantpated. :)

Here we go,

##(Pv)_{in}=T_{in}(R)##

I am looking at what's going on here. Strange things are going on with ##m_o## and ##\Delta m## in order for (a) to grow from zero to 1. Don't have it straight in my mind yet. I think it has to do with ##C_p## and ##C_v## affecting ##m_o##.
 
  • #53
treddie said:
Arghh! Those damn moles and units! I am becoming constantpated. :)

Here we go,

##(Pv)_{in}=T_{in}(R)##

I am looking at what's going on here. Strange things are going on with ##m_o## and ##\Delta m## in order for (a) to grow from zero to 1. Don't have it straight in my mind yet. I think it has to do with ##C_p## and ##C_v## affecting ##m_o##.
No way. m zero is just the original number of moles of gas in the tank.
 
  • Like
Likes treddie
  • #54
I know. I realized that last night when I went to bed, as I was getting ready to drop off to sleep.

This is a very intriguing problem. Not giving up yet.
 
  • #55
Ok...I got something very close to your equation. Here was the path I took:

My equation for an ideal gas transient system was,
##T_f = T_o + a(T_{in} - T_o) + \frac{a(Pv)_{in}}{C_v} \space \space \space \space \space \space\space\space\space## Equ.1

Your equation for the problem is,
##T_f = T_o + a(\gamma T_{in} - T_o)\space \space \space \space \space \space\space\space\space## Equ.2

Solving simultaneously,
##T_{in}(C_p - C_v) = (Pv)_{in}\space \space \space \space \space \space\space\space\space## Equ.3

Now, in general, ##C_v = C_p - R##, so
##R = C_p - C_v\space \space \space \space \space \space\space\space\space## Equ.4

Substituting Equ.4 into Equ.3,
##T_{in}R = (Pv)_{in}\space \space \space \space \space \space\space\space\space## Equ.5

With this result, we can replace the Pv term in Equ.1:
##T_f = T_o + a(T_{in} - T_o) + \frac{aT_{in}R}{C_v}\space \space \space \space \space \space\space\space\space## Equ.6

But I need to reverse course here with, ##R = C_p - C_v##, so:
##T_f = T_o + a(T_{in} - T_o) + \frac{aT_{in}(C_p - C_v)}{C_v}\space \space \space \space \space \space\space\space\space## Equ.7

Simplifying,
##T_f = T_o + aT_{in} - aT_o + \frac{aT_inC_p}{C_v} - 1\space \space \space \space \space \space\space\space\space## Equ.8

##T_f = T_o + aT_{in} - aT_o + a\gamma T_{in} - 1\space \space \space \space \space \space\space\space\space## Equ.9

Finally,
##T_f = T_o + a(\gamma T_{in} - T_o) + aT_{in} - 1\space \space \space \space \space \space\space\space\space## Equ.10

This final equation differs from yours (Equ.2) in that mine has 2 additional terms at the end. And I didn't actually prove your equation because I used it right off the bat to simultaneously solve with (I cheated! :) ). Nonetheless, I have checked my math and I can find no mistakes.
 
Last edited:
  • #56
treddie said:
But I need to reverse course here with, ##R = C_p - C_v##, so:
##T_f = T_o + a(T_{in} - T_o) + \frac{aT_{in}(C_p - C_v)}{C_v}\space \space \space \space \space \space\space\space\space## Equ.7

Simplifying,
##T_f = T_o + aT_{in} - aT_o + \frac{aT_inC_p}{C_v} - 1\space \space \space \space \space \space\space\space\space## Equ.8
There is an algebraic error in the transition between Eqns. 7 and 8.
 
  • Like
Likes treddie
  • #57
Ohhhhh. Damn right! That might work in an alternate universe, but obviously it doesn't work here.

Starting with Equ.7,
##T_f = T_o + a(T_{in} - T_o) + \frac{aT_{in}(C_p - C_v)}{C_v}\space \space \space \space \space \space\space\space\space## Equ.7
##T_f = T_o + aT_{in} - aT_o + \frac{aT_{in}C_p-aT_{in}C_v}{C_v}\space \space \space \space \space \space\space\space\space## Equ.8rev1
##T_f = T_o + aT_{in} - aT_o + \frac{aT_{in}C_p}{C_v} - aT_{in}\space \space \space \space \space \space\space\space\space## Equ.9rev1
##T_f = T_o - aT_o + a \gamma T_{in}\space \space \space \space \space \space\space\space\space## Equ.10rev1
##T_f = T_o + a(\gamma T_{in} - T_o)\space \space \space \space \space \space\space\space\space## Equ.11

So by doing all of this, I came to realize that important little principal, that for an ideal gas, ##(Pv)_{in} = T_{in}(C_p - C_v)##. That was the glue that brought equations, Equ.1 and Equ.2 together.
 
  • #58
Here is a test run for the ideal case:

I am surprised that the pressure is linear. That is, if the program is running correctly. Overall. the values seem to be in the correct ballpark, considering these are high pressures and outside the ideal gas regime.
The target gas is Methane (CH4).

Test 1.jpg
 

Attachments

  • Test 1.jpg
    Test 1.jpg
    27.5 KB · Views: 364
  • #59
Are those pound moles or gram moles? What value of gamma did you use? What does the volume of the inlet gas refer to, and why is it equal to pi? What is the abscissa on the plot?
 
  • Like
Likes treddie
  • #60
What you see in that image is a quick run before I had made final fixes to the display of information. I went to bed before I could finish things up. To sum up:

"Are those pound moles or gram moles?"
Just gram-moles...Number of moles...6.02 X 10-23 molecules/per mole.

"What value of gamma did you use?"
Gamma = 1.4

"What does the volume of the inlet gas refer to, and why is it equal to pi?"
The two fields referring to volume of inlet gas and inlet pressure are unused...They showed up in the program because I was referring to old notes when I was building the program form, and I was still expecting to use ##(Pv)_{in}## instead of ##T_{in}(C_p - C_v)##. Those fields have now been deleted. Volume was equal to pi because it just happened to coincidentally come out that way. My unit inlet volume was a portion of the supply line enclosing a gas volume, 4" long X 1" dia., at 3600psi, 60 degF and held about .6 mole of molecules. Each one of those volumes would enter the tank at each time step. But with the ##(Pv)_{in}## approach now history, all of that stuff is now irrelevant.

"What is the abscissa on the plot?"
Abscissa is "Moles".
 

Similar threads

  • · Replies 109 ·
4
Replies
109
Views
7K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 69 ·
3
Replies
69
Views
7K
Replies
15
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
3
Views
2K
Replies
3
Views
1K
  • · Replies 60 ·
3
Replies
60
Views
9K