Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mass and energy balance equations for a tank filled with H20

  1. Jul 1, 2018 #1
    Hi, this problem should be very simple: I have a tank containing water. (going in and out). I want to write the differential equations to see what happen to the temperature and the level of the vessel if the flow of water is not constant.

    the system should be:

    $$A \frac {dl} {dt} = F_{in} - F_{out} $$
    $$ \frac {dE} {dt} = H_{in} - H_{out} - Q_{out} $$

    ##A## is the section of the tank
    ##l## is the level of water inside the vessel
    ##F## are the volumetric flow rates
    ##Q_{out}## represents the heat loss

    I have a problem with the second equation (energy balance). How do I handle ##H_{in}## and ##H_{out}## ?

    I tried to do this:

    $$ \frac {dE} {dt} = ρ F_{in} \left [ h(T_r) + \int_{T_r}^{T_{in}} cp \right ] - ρ F_{out} \left [ h(T_r) + \int_{T_r}^{T_{out}} cp \right ] - Q_{out}$$

    ##\rho## can be assumed to be constant, but ##F_{in} ≠ F_{out}##, so how to I handle ##h(T_r)##? I can arbitrary set ##h(T_r)## to be ##0##, but then what about ##T_r## ?

    Thanks
    Ric
     
  2. jcsd
  3. Jul 1, 2018 #2

    anorlunda

    Staff: Mentor

    Make up your mind. Either use mass flows, mass balance, and energy balance, or volume flow, volume balance, and temperature balance. Since you are dealing with water, it is easy either way. Use ##C_{[p,v]}## the Isobaric volumetric heat capacity (or ##c_p##) to convert between the two representations.

    I don't understand your energy balance. You didn't define all the symbols. I suspect that you also have problems with the units.

    But you have only two temperatures to work with, the inlet temperature and the tank temperature. Outlet flow comes at tank temperature by definition.

    You do not say what range of temperatures you need, or what accuracy. But either you assume ##C_{[p,v]}## is constant, or you can use the steam tables to get the values needed and make a curve fit ##C_{[p,v]}## as a function of temperature.

    The next step I presume is numerical integration of the differential equations. You are not trying for a closed form time domain solution, correct?

    Don't forget to add in the initial conditions for level and temperature.
     
  4. Jul 1, 2018 #3

    anorlunda

    Staff: Mentor

    By the way, you did not mention pressure. It is an open top tank, correct?
     
  5. Jul 2, 2018 #4
    First of all, thank you for the reply :)

    Mhm, I don't get what you are saying. Here's what I did (according to the properties of the system given by my professor - it is not really an exercise so I posted here ):

    Mass balance:

    $$ \frac {dm} {dt} = \dot m_{in} - \dot m_{out}$$
    $$ \frac {d( \rho V)} {dt} = \rho_{in} \dot F_{in} - \rho_{out} \dot F_{out} $$
    Assuming ##\rho## constant (the temperature range is not very wide) I get:
    $$ \frac {d(V)} {dt} = \dot F_{in} - \dot F_{out} → \frac {d(lA)} {dt} = \dot F_{in} - \dot F_{out}$$

    I also apologize for my bad notation: when I wrote ##c_p## I meant ##c = \left ( \frac {δQ} {dT} \right )## because, in fluids, ##c_p ≈ c_v ≈ c##.

    ##E## is the total energy: ##dE = d(U + K + φ) = dU ≈ dH## because, for fluids, at constant pressure and density ##d(PV) ≈ 0## so, internal energy can be replaced with enthalpy.

    ##K## is the kinetic energy, and so ##dK ≈ 0## (in this case).
    ##Φ## is the potential energy, and so ##dΦ ≈ 0## (in this case).

    ##H_{in }## and ##H_{out}## are the enthalpies of the inlet and outlet flow, because because mass flows carry energy inside and outside the system.
     
  6. Jul 2, 2018 #5
    Well, I want to know the temperature profile if something happens to ##F_{in}## or ##F_{out}##. ##F_{in}## has a Temperature of ##60 °C## while the outside temperature is ##25 °C##. Heat loss (##Q_{out}##) can be approximated with ##Q_{out} = UA(T-T_{outside})##. For a first general idea ##U## can be treated as a constant.

    Yes.

    Of course.

    Yes
     
  7. Jul 2, 2018 #6
    IN THIS ANALYSIS, THE F'S ARE GOING TO BE THE MASS FLOW RATES. SO THE MASS BALANCE ON THE TANK IS: $$\frac{A}{v}\frac{dl}{dt}=F_{in}-F_{out}$$ where v is the specific volume of the fluid (assumed constant).

    If you neglect kinetic energy and potential energy in the tank and assume that the fluid is compressible, then $$E=\frac{Al}{v}\left[e(T_r)+\int_{T_r}^T{C(T')dT'}\right]$$where, for an incompressible fluid, C is both the heat capacity at constant volume and the heat capacity at constant temperature. In addition, if the pressure is constant, $$h_{in}=e_{in}+Pv=e(T_r)+\int_{T_r}^{T_{in}}{C(T')dT'}+Pv$$and $$h_{out}=e_{in}+Pv=e(T_r)+\int_{T_r}^{T_{out}}{C(T')dT'}+Pv$$Furthermore, the open system energy balance should read:
    $$\frac{dE}{dt}=F_{in}h_{in}-F_{out}h_{out}-PA\frac{dl}{dt}+Q$$
    where the third term on the right hand side represents the work the tank contents are doing in pushing back the surroundings.

    If we combine these equations with the mass balance equation, we obtain:
    $$\frac{Al}{v}C\frac{dT}{dt}=F_{in}\int_T^{T_{in}}{C(T')dT'}-F_{out}\int_T^{T_{out}}{C(T')dT'}+Pv(F_{in}-F_{out})-PA\frac{dl}{dt}+Q$$
    But, from a volume balance, we have that: $$v(F_{in}-F_{out})=A\frac{dl}{dt}$$
    Therefore,
    $$\frac{Al}{v}C(T)\frac{dT}{dt}=F_{in}\int_T^{T_{in}}{C(T')dT'}-F_{out}\int_T^{T_{out}}{C(T')dT'}+Q$$
     
    Last edited: Jul 2, 2018
  8. Jul 2, 2018 #7
    Thank you @Chestermiller for the very interesting reply.

    Okay, here I am unprepared... my professors never considered the work done by the tank in this way so I'm a bit shocked (I'm not saying that I don't believe you, I'm just new to this). I tried to derive your formula in my own way... if you please can check it I will be very glad :smile: I will post il later because now I'm very busy.

    There are a few more things I'd like to understand:

    Where did ##e(T_r)## go?

    In your final formula what is ##T##? Is ##T = T_r##? And how can I find ##T##?
     
  9. Jul 2, 2018 #8
    It cancelled from both sides of the equation as a result of the mass balance.
    T is the temperature in the tank. Tr is gone. You need to go through the math.
     
  10. Jul 3, 2018 #9
    This problem can also be solved using the usual "closed system" version of the first law of thermodynamics, giving the identical results.
     
  11. Jul 3, 2018 #10
    Sorry If I'm not replying. I'll be back in a few days
     
  12. Jul 9, 2018 #11
    Okay, sorry for my late reply!

    I've been carefully revising balance equations and I made it to the and of your answer. I just have few things I'd like to ask you:

    1) When you use ##E## technically you are referring to ##U## (internal energy) but, since for incompressible fluids there is no difference between ##H## and ##U##, you use ##E##: it is just a matter of words, right?

    2) Is it safe to assume that ##T_{out} = T## to simplify the equation (assuming perfect mixing)?

    3) Just for the sake of it, I was trying to derive the macroscopic energy balance starting from the differential form of balance equations, but I get stuck... If you have time, can you please show me how it should be done?

    Thank you,
    Ric
     
  13. Jul 9, 2018 #12
    Even for an incompressible fluid, there is a difference between H and U. Pv is not equal to zero. This has been taken into account in the development I presented. Also, the open system version of the first law determines dU/dt for the control volume, not dH/dt.
    Yes, if you judge that that is a good approximation, such as if there is adequate stirring in the tank.
    This development is presented in detail in Transport Phenomena by Bird, Stewart, and Lightfoot
     
  14. Jul 9, 2018 #13
    Then why ##C(T) ≈ C_v(T) ≈ C_p(T)## for incompressible fluids ?


    I don't want to bother you any further, but I'm not finding it. I looked it up and I found the macroscopic energy balance and it differential formulation, but I didn't find how to switch from one to the other by integrating the equation.

    Thanks
    Ric
     
  15. Jul 9, 2018 #14
    Those are partial derivates with respect to T. The partial derivative of the Pv with respect to T is zero.
    Are the derivations in Chapters 7 and 15 not adequate for filling the gaps in your derivation? Let's see what you've got so far.
     
  16. Jul 10, 2018 #15
    I still don't understand why you used ##C## instead of ##C_v##...

    The derivations are very clear, I just have some problems trying to do it backward... I get stuck from the very beginning (I left out the irreversibility):

    $$\rho \left[ \frac {\partial \hat U} {\partial t} + \vec v ⋅ \nabla \hat U \right] = - \nabla ⋅ q - p(\nabla ⋅\vec v) $$

    The continuity equation yields:

    $$ \frac {\partial \rho} {\partial t} + \nabla ⋅(\rho \vec v) = 0 $$

    So I can use that result to write:

    $$ \rho \left[ \frac {\partial \hat U} {\partial t} + \vec v ⋅ \nabla \hat U \right] + \hat U \left[ \frac{\partial \rho} {\partial t} + \nabla ⋅(\rho \vec v) \right] = - \nabla ⋅ q - p(\nabla ⋅\vec v) $$

    Noting that ##\rho \vec v ⋅ \nabla \hat U + \hat U \nabla ⋅ (\rho \vec v) = \nabla ⋅ (\hat U \rho \vec v)## and that ##p(\nabla ⋅\vec v) = \nabla ⋅(\rho \vec v) - \vec v ⋅ \nabla p ## the equation becomes:

    $$ \rho \frac {\partial \hat U} {\partial t} + \hat U \frac {\partial \rho} {\partial t} + \nabla ⋅ (\rho \vec v \hat U) = - \nabla ⋅ q - \nabla ⋅(\rho \vec v) - \vec v ⋅ \nabla p $$
    $$ \frac {\partial \rho \hat U} {\partial t} = - \nabla ⋅ q - \nabla ⋅ (\rho \vec v \hat U) - \nabla ⋅(\rho \vec v) - \vec v ⋅ \nabla p $$

    But here I'm stuck
     
  17. Aug 14, 2018 #16
    Hi, sorry if I revive this old post, but I finally got enough free time to think about it and I still don't get what you did.

    The main thing I do not understand is this:

    From page 316 of "Transport Phenomena" I will write the infinitesimal energy energy equation (in the most general form possible):

    $$\frac {\partial}{\partial t} {\rho( \hat U + \frac 1 2 v^2)} = - ∇⋅\rho \mathbf v( \hat U + \frac 1 2 v^2) - ∇⋅ \mathbf q + \rho( \mathbf v ⋅ \mathbf g) - ∇⋅(p \mathbf v) - ∇⋅[ \mathbf \tau ⋅ \mathbf v] $$

    Let's forget about ##\frac 1 2 v^2##, ## \rho( \mathbf v ⋅ \mathbf g)## and ## ∇⋅[ \mathbf \tau ⋅ \mathbf v]##:

    $$\frac {\partial}{\partial t} {\rho( \hat U )} = - ∇⋅\rho \mathbf v( \hat U ) - ∇⋅ \mathbf q - ∇⋅(p \mathbf v) $$

    Putting together ##- ∇⋅\rho \mathbf v( \hat U )## and ##- ∇⋅(p \mathbf v) ##:

    $$ -∇⋅[ \rho \mathbf v( \hat U ) + (p \mathbf v)] = -∇⋅[ \rho \mathbf v ( \hat U + \frac p {\rho})] = -∇⋅[ \rho \mathbf v \hat H ] $$

    And back to the main equation:

    $$\frac {\partial}{\partial t} {\rho( \hat U )} = -∇⋅[ \rho \mathbf v \hat H ] - ∇⋅ \mathbf q $$

    Integrating over the Volume:

    $$ \int_V \frac {\partial}{\partial t} {\rho( \hat U )} dV = - \int_V ∇⋅[ \rho \mathbf v \hat H ] dV - \int_V ∇⋅ \mathbf q dV $$

    Now:

    $$\int_V \frac {\partial}{\partial t} {\rho( \hat U )} dV = \frac {\partial}{\partial t} \int_V {\rho( \hat U )} dV = \frac {dU}{dt} $$

    Using the divergence theorem:

    $$ \int_V ∇⋅[ \rho \mathbf v \hat H ] dV = \int_S \rho \mathbf v \hat H ⋅ d \mathbf S = -(H_{in} - H_{out}) $$

    Finally:

    $$ \frac {dE}{dt} = H_{in} - H_{out} + Q $$
     
  18. Aug 15, 2018 #17
    I don't have it in me to work out every last detail of the mathematics. But, your issue is definitely is related to the term ##\nabla \centerdot (p\mathbf{v})##. The divergence theorem applied to this term definitely includes entering and exiting streams, but it also includes the work done if the boundary of the control volume is moving (in regions where where mass is not entering or leaving) so that the control volume is expanding. If this were a closed system, for example, this term would lead to the familiar pdV/dt term.
     
  19. Aug 15, 2018 #18
    Oh, now I see it clearly. Thank you very much. But I have no idea how to show it mathematically...
     
  20. Aug 15, 2018 #19
    I have a suggestion to get you started. Try to do it first for a closed system in which you have a moving boundary like a piston (but no mass entering or leaving). Don't forget to use Reynolds' theorem for differentiation under the integral sign. See if you can derive the usual form of the first law of thermodynamics.
     
  21. Aug 16, 2018 #20
    Okay, I will try as soon as I can, thank you again!
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted