# How do we calculate work and heat for something that is not an ideal gas?

To make learning an easier process, things are considered simple and ideal.

That is great, and in the case of thermodynamics it makes calculating heat and work transfer a simple thing that is easy to understand.

The definition of work is somehow "the energy it takes to apply a force to move something".

For a straight line movement and a constant force that is parallel to that line it simplifies as the product of force and distance.

For an ideal gas that pushes the walls of a container, it is similar but considering forces on surfaces (pressure) and "multi-dimension distance" (volume).

All of this gets calculated by adding up a huge lot of very small differential changes.

This does not come from intuition, but from doing the maths.

So far, everything is okay.

Based on what I learned, thermodynamics is "just" a tool that makes understanding/creating machines related with heat and work flow possible.

But all the simplified versions of everything is not always making it easier.

In fact, it leads to confusion when you try to understand real things with simple concepts.

I do not pretend to go deep into all the maths here and now, but I would like to understand the following:

Question:

In the real applications of thermodynamics, to calculate work and heat of processes, do engineers really apply all the maths to get to the very exact amounts or is it not that important, and work with ideal processes knowing that the real result will have certain differences?

This question raises from the fact that heat and work are not state functions, and all the examples I have seen always tend to stick to enthalpy, entropy and internal energy with values taken from tables. Of course, somebodies created those tables, but stuff is not always measured mathematically. Sometimes it's done experimentally, since measuring is nothing else than comparing.

This may seem an irrelevant or an abstract question, but I think a point of view of a real engineer who actually makes something out of this big set of ideas, may help me and other readers understand what the point of thermodynamics is and how it really works.

Like many things, it depends. And it depends on what kinds of things an engineer/scientist is studying. Here's a short list of examples from aerospace/propulsion applications:

1. Diesel injectors, liquid rocket motors -- the pressure is so high that many of the flows are trans-critical or super-critical. This means they deviate pretty significantly from ideal gas, and so we use so-called "real-gas" equations of state. These are usually based on cubic functions to approximate the properties. These work well away from the critical point, but at the critical point they all blow up. But, most of the time, there's very few places that are at the critical point and so we can get away with just ignoring it. To get critical points right requires... something. Molecular dynamics hasn't been able to do it reliably, and experiments are incredibly hard.

2. Air-breathing propulsion devices (jet engines, afterburners, etc.) -- the pressure is low enough that the gas is considered ideal. However, combustion and pressure changes through the compressor and/or turbine stages means the gas properties are variable. So, we use a thermally-perfect equation of state typically.

3. Low-speed aerodynamics -- by low speed, I mean subsonic and in the realm where cars to things like commercial jets operate. The working gas is usually unchanging (air, with no chemical reactions) and the pressure and temperature changes are small. So ideal gas is great. In fact, we can get away with calorically perfect gas and just hold all of our properties fixed.

4. High-speed aerodynamics -- this is for things that travel around the speed of sound to perhaps a few times the speed of sound. Here, compression starts to really matter and the gas properties are again changing a lot depending on the local flow regime. So just like in air-breathing engines, we use thermally perfect idea gas relations.

5. Hypersonic aerodynamics -- interestingly, once you go fast enough, the gas starts to take on constant properties once again. This is something like 5-10 times the speed of sound. So somewhat paradoxically, we can actually go back to calorically perfect equation of state and hold our properties constant. Of course, the constants we choose will be different from the low-speed case, but constant anyway.

6. Rarified gas dynamics -- when you have something like a re-entry body, strange things start to happen. The molecules of the gas might have different energies in different modes, and it is no longer an equilibrium. In these non-equilibrium flows, we have to resort to much more expensive calculations of energy populations. We can model these using multiple temperatures and can assign state equations for different energy modes. This is something you will not encounter in classical thermodynamics, but comes up in statistical mechanics/gas dynamics.

So that's a laundry list of things that I work on regularly and how we handle the EOS. You can see that for many things, the ideal gas equation of state works perfectly (pun intended) well. We can get fantastic scientific information using it -- not just engineering approximations. And often, when we want an engineering approximation to things, there are so many fudge factors due to uncertainties and safety margins that the errors from the "wrong" EOS are marginal.

However, it really depends on what you want to calculate. If you're doing studies are very high pressures, you need to account for the non-ideal effects. If you're doing things in rarefied gases, you need to account for non-equilibrium effects.

As a result, when I want to calculate heat, sometimes it's as simple as $$\Delta H = C_p \Delta T$$. Sometimes I need to solve the integral equation because the gas is thermally perfect and so the change in properties really is important. And other times, the EOS is non-analytical and I have to resort to numerical integration of lookup tables because it involves phase changes and exotic states.

Like all engineering work, we have to look at the totality of our assumptions and how much cost we are willing to put into a solution. If I need to design something to extract 10 MW of power, I can start with a simple hand-calculation assuming everything is perfect and if the math shows I can only get 1 MW of power out of it, odds are good it's not worth spending more time/money/energy doing further calculations. If it shows I get 11 MW, then it's worth moving to the next level of fidelity, for whatever that might entail.

As a perhaps useful exercise, pick a few problems of interest and do the calculation a couple of different ways to see if the difference. Take a gas, say air, at 1 bar and 300 K and put in a little bit of enthalpy. Maybe something equivalent to turning on a heater in a room. Calculate the final temperature as a calorically perfect gas and as a thermally perfect gas (by solving the integral -- numerically of course). Compare the final temperature.

Do it again by adding a lot of enthalpy. Orders of magnitude more enthalpy. Something more like the enthalpy released due to burning jet fuel. Compare the final temperature.

That should give you an idea of what kinds of differences are involved, both in terms of the accuracy and the cost involved. Engineers will develop experience to know which tools to apply to which problems, but it takes doing some simple exercises like this one to build up that expertise!