Cannot find the Temperature Change inside of a Tank

In summary: If the pressure is greater, then the volume of gas will be greater, and the pressure-volume product (PV) will be greater. Since the PV is a positive number, then the internal energy (U) will be increased.3. At some point, just like diffusion of dye in clear water, I would assume that mixing of high pressure gases would act similarly, but perhaps much quicker Diffusion of gases is a slow process. However, once the gases are mixed, the heat of gas exchange will cause the temperature of the gas mixture to rise.
  • #71
treddie said:
Chester,
I just noticed that your graphs disappeared, and some posts from you about a week and a half ago, that I never saw! This is weird.
I am going over your posts from June 5, which for some reason never showed up on my side.
My graphs are in that private conversation that we have been having in parallel with this.
 
Science news on Phys.org
  • #72
Mystery solved. Thank you Sherlock!

Watson
 
  • #73
Chestermiller said:
How did that middle term get in there? Skip that term. It's wrong, and move on to the third equality.

Quantum uncertainty may have thrown it in. :)
 
  • Like
Likes Chestermiller
  • #74
Would it help if I provided my C# code?
 
  • #75
Yes, that might help, thanks!

One thing I notice is that our curves do not show the Joule-Thompson Effect when the tank starts at low pressures, but moderate temperatures.
 
  • #76
treddie said:
Yes, that might help, thanks!

One thing I notice is that our curves do not show the Joule-Thompson Effect when the tank starts at low pressures, but moderate temperatures.
This is not a Joule-Thompson situation.
 
  • #77
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;
namespace Tank_Temperature_Problem

{

class Program

{

static void Main(string[] args)

{

double vdw_a = 8541.0;

double vdw_b = 0.685;

double[] lb_moles = new double[20];

double[] sp_vol = new double[20];

double[] temperature = new double[20];

double[] pressure = new double[20];

double tank_vol = 7.068; double R = 10.731573;

double C_v = 3.3 * R;

double gamma = 4.3 / 3.3;
double dm = 0.3;
//Initialization of Tank Contents

//*******************************
lb_moles[0] = 1.55;

temperature[0] = 582.0;

sp_vol[0] = tank_vol / lb_moles[0];

double term = (R * temperature[0]) / (sp_vol[0] - vdw_b);

pressure[0] = -vdw_a / (sp_vol[0]*sp_vol[0]) + term;

Console.WriteLine("The initial pressure is " + pressure[0]+ " psi");
//Initialization of Inlet Line

//****************************

double v_in = 1.3;

double T_in = 552.0;

term= (R * T_in) / (v_in - vdw_b);

double p_in= -vdw_a / (v_in * v_in) + term;

Console.WriteLine("The inlet line pressure is " + p_in + " psi");
double term1 = gamma * T_in - temperature[0]

+ (1 / sp_vol[0] - 2 / v_in) * vdw_a / C_v;

term1 = term1 + vdw_b * R * T_in / C_v / (v_in - vdw_b);

double term2 = vdw_a / C_v / tank_vol;
for (int i = 1; i < 12; i++)

{

lb_moles = lb_moles[i - 1] + dm;

temperature = temperature[0]+ term1 * (lb_moles - lb_moles[0]) / lb_moles + (lb_moles-lb_moles[0]) * term2;

sp_vol = tank_vol / lb_moles;

term = (R * temperature) / (sp_vol - vdw_b);

pressure = -vdw_a / (sp_vol * sp_vol) + term;

Console.WriteLine(lb_moles + " " + temperature+" "+pressure);

}
Console.WriteLine();

Console.WriteLine("reduced temperature, reduced pressure, z facto");

for (int i = 1; i < 12; i++)

{

double tr = temperature / 344;

double pr = pressure / 673.3;

double z_factor = pressure * sp_vol / R / temperature;

Console.WriteLine(tr + " " + pr + " " + z_factor);

}

Console.ReadKey();
}

}

}
 
  • #78
Chestermiller said:
This is not a Joule-Thompson situation.

I thought that whenever a gas moved from a high pressure volume to a low pressure volume that that gas cooled as it expanded, but that when it encounters more and more collisions in the tank, it quickly heats up?

Thanks again for your code. I will compare your output with mine for the same initial conditions.
 
  • #79
treddie said:
I thought that whenever a gas moved from a high pressure volume to a low pressure volume that that gas cooled as it expanded, but that when it encounters more and more collisions in the tank, it quickly heats up?
There are two things happening here, and it is important to understand the basic physical mechanisms that apply to each.

The first thing is that the entering gas goes through the inlet valve from the high pressure feed line to the lower pressure in the tank. From the open system version of the first law of thermodynamics, we know that this change (taking place strictly in the inlet value) occurs at constant enthalpy. For an ideal gas, this means that the temperature of the entering gas does not change across the inlet valve. This is basically the Joule-Thompson effect. But how can this be? After all, the gas has expanded, so, as you pointed out, it should be cooling. However, the pressure drop in the inlet value is caused by viscous friction, which is a dissipative process, involving so-called "viscous heating" of the gas. As it turns out, the cooling effect from expansion is exactly canceled out by the heating effect from viscous dissipation. So the net effect is no temperature change for an ideal gas passing through the inlet valve.

The second thing that happens is that the gas entering the tank is causing the gas already present within the tank to compress adiabatically. So it is doing work on the gas already in the tank. This causes the gas in the tank to heat up. This adiabatic compression results in a temperature rise of the gas in the tank.
 
  • #80
But what is different then, between the inlet valve in our discussion, and the expansion valve in an air-conditioning system? Is it the liquid state of the refrigerant vs. the gas state of the tank fill model? Both are still regarded as "fluids".
 
  • #81
treddie said:
But what is different then, between the inlet valve in our discussion, and the expansion valve in an air-conditioning system? Is it the liquid state of the refrigerant vs. the gas state of the tank fill model? Both are still regarded as "fluids".
A liquid refrigerant and an ideal gas are quite different in their behavior (even though the change in enthalpy for each in passing through a valve is zero).
 
  • #82
True, true.

Update:
FINALLY got my code running now. I forgot to switch my VdW constants over to ##ft^3, atm, mol## units. Took me a while to track it down via process of elimination.

At any rate, I find it interesting that the curves for real gas vs. ideal gas show that they are switched relative to which ones are linear. For the real gas, temperature was linear, and pressure rose non-linearly. For the ideal gas, the situation was reversed.

Test 4 Real UpR.jpg

Test 4 Ideal UpR.jpg
 

Attachments

  • Test 4 Real UpR.jpg
    Test 4 Real UpR.jpg
    27.2 KB · Views: 784
  • Test 4 Ideal UpR.jpg
    Test 4 Ideal UpR.jpg
    27.3 KB · Views: 791
Last edited:
  • #83
treddie said:
True, true.

Update:
FINALLY got my code running now. I forgot to switch my VdW constants over to ##ft^3, atm, mol## units. Took me a while to track it down via process of elimination.

At any rate, I find it interesting that the curves for real gas vs. ideal gas show that they are switched relative to which ones are linear. For the real gas, temperature was linear, and pressure rose non-linearly. For the ideal gas, the situation was reversed.

View attachment 227554
View attachment 227555
It's got to be just a coincidence. Try the calculation with a and b halved and see how the shapes of the curves compare.
 
  • #84
You're right:

Test 5.jpg
 

Attachments

  • Test 5.jpg
    Test 5.jpg
    31.3 KB · Views: 425
  • #85
I also tested for pressures down in the ideal range, and both the ideal and real curves were almost coincident, which is what would be expected.
 
  • #86
treddie said:
I also tested for pressures down in the ideal range, and both the ideal and real curves were almost coincident, which is what would be expected.
Another way to test this is just to set a and b equal to zero.
 
  • #87
Tried a = 0 and b = 0, and as expected, the pressure curves and temperature curves were respectively coincident.

Also tried inlet temperature around 35 degF and initial tank temperature at about 90 degF (press = 100psi). There was a dip as the cold air filled the tank. After a time, of course, the temp went up to about 208 degF (5301 psi) (real case).
 
  • #88
I forgot to mention that the final test with cold inlet gas was with VdW a&b set to methane (not zero, or other).
 
  • #89
treddie said:
Tried a = 0 and b = 0, and as expected, the pressure curves and temperature curves were respectively coincident.

Also tried inlet temperature around 35 degF and initial tank temperature at about 90 degF (press = 100psi). There was a dip as the cold air filled the tank. After a time, of course, the temp went up to about 208 degF (5301 psi) (real case).
I confirm the small initial dip in temperature.
 
  • #90
At this point, I am going to get my graphics looking better. My current ones were just to get things displaying so I could see something. Now I just need to make them more traditional looking with tic marks and relative to a common origin (all my curves have been anchored to the origin at this point).
 
  • #91
Are you confident that you are getting the correct answer now? If so, I think were done here, right?
 
  • #92
Yes! I notice that I get some elevated values from yours, but from my experience in programming, and the fact that I approached a part of the code slightly different than yours, that there is just a final little "something" I need to nail down. But I am confident that I will have this solved on my own very shortly.

So, sir...I want to thank you for your tremendous help on all of this. Thermo is one of my weak points, and I have a good grasp now on a portion of it. I had hoped that I would not have had to stretch this out so long, but my work schedule has been really tight these last months. Thanks for hanging in there with me!
 
  • #93
...and a little update. I found the cause of the disparity between your results and mine this afternoon. I had used the wrong coefficient in C_v = c * R. I had it set to the diatomic value of 2.5, and have changed it to 3.3. Now our results are identical to many decimal places.
 
  • Like
Likes Chestermiller

Similar threads

Replies
3
Views
1K
Replies
69
Views
4K
Replies
5
Views
2K
Replies
15
Views
1K
Replies
5
Views
2K
Replies
56
Views
3K
Replies
22
Views
2K
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
14
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
Back
Top