Which way does the water flow?

Friday's article on the collision of an interview task with the real world.



There is a fairly well-known problem - in front of you there is a metal pipe with water flowing inside. How to determine which way it flows? It can still be asked for you in interviews.



Many problems with inaccurate formulation have already been passed, let's figure out what is wrong with this pipe.



The expected solution is to heat the pipe and see in which direction the heat will spread. But there are many additional nuances here. As a rule, it is assumed that they will heat with a gas burner. There was even a restriction that you can have any item worth up to one hundred rubles, which makes the task practically unsolvable in this way, but more on that later.



First, you need to be sure the water temperature is low enough to be touched. Well, more precisely, so that you can understand the difference between "very hot" and "very, very hot". It is difficult to say for sure, but it is unlikely that it is higher than 50 degrees Celsius.



Secondly, you need to be sure that the water flows at a speed much greater than the rate of heat propagation in the water. For example, at a flow rate of 1mm / s, you are unlikely to understand where the water is moving or if it is moving at all.



Thirdly, you need to be sure that the water does not flow at too high a speed. Otherwise, she simply will not have time to warm up enough.



Human temperature sensitivity to temperature differences is approximately one degree. Based on the heat capacity of water ~ 4.2 kJ / kg, we get that per gram of flowing water we must transfer in the region of 4.2 Joules in order to be able to feel the temperature difference.



Suppose that by heating the pipe with some kind of burner, we transfer to the pipe about half of the heat of the combustible fuel. This is a fairly generous assumption, for example, good gas boilers have an efficiency in the region of 95%.



The flow rate in a conventional cold water supply is approximately 1m / s. For an ordinary 1/2 "pipe, say in a bathroom, this will give a flow rate of about 200 g / s. We will rely on these figures to have an idea of ​​what size the pipe should be so that at the usual flow rate we can determine its direction.



Let's go with the trump cards. Suppose you have a good welding torch, acetylene and oxygen to solve the problem. The burner consumption is about a kilogram of acetylene per hour, the heat of combustion is about 50 MJ / kg. Accordingly, we get about 13888 J per second, taking into account the low efficiency of the pipe, about 7000 of them will be transferred. In principle, you can warm up a pipe by a degree with a passage of 1.7 kg of water per second.



Well ... The solution seems to work. But let's face it, most programmers have never had a welding machine in their hands. And looking at the architecture of some applications is for the best. Suppose that a regular gas burner with a replaceable cylinder, like the one used to light hookah charcoal, is used as a heating device. Gas consumption is approximately 100 g / h. For simplicity of calculation, we take the same heat of combustion of propane, that is, 50 MJ. We can get 700 J per second. This is enough to heat 170 grams of water.



It doesn't look so promising anymore. If a hose is put on the far end of this mysterious pipe and my grandmother pours tomatoes from it, that is, the flow of liquid through the pipe is practically unlimited, then we will no longer be able to understand the direction of the flow. Granny will have to lightly pinch the hose with her finger so that the task becomes solvable.



In general, the condition implied that a smart applicant would take a lighter and heat the pipe. I could not find gas consumption rates for lighters anywhere. Probably, it never occurred to anyone to make such changes.



Let's take the data on gas soldering irons. Definitely, this is a more powerful device than a lighter, but let's take these numbers for calculation. A gas-fired soldering iron consumes approximately 20 ml / hour, that is approximately 10 g / hour. This means that with its help we will be able to heat about 17 grams of water per second by one degree.



17 g / s is very little. For such a flow, a very modest consumer must be connected to the pipe, for example, a soda machine. Moreover, this is not the same machine as in a shopping center - five seconds and a half-liter glass is ready. It is a machine that pours a glass very slowly, with a solemnity befitting the occasion.



Summarizing all of the above, the problem should be posed as follows:



You are in an endless field. Here is a metal pipe no more than a standard plumbing pipe. Water flows in it, temperatures not higher than 50 degrees Celsius, at a speed of no more than 1 m / s and not less than 1 mm / s. You cannot reach the beginning and end of this pipe. What item do you need to determine the direction of movement of the fluid?



Sounds pretty silly. And we also omitted absolutely stupid clarifications like the fact that the pipe is not made of gallium, the temperature around is not -190, the atmosphere does not consist of explosive gas, or you are not reincarnated into a chipmunk.



To solve a problem in any way close to real conditions, you need very serious equipment. By the way, you probably don't know how to work with.



As in all logic problems, conventions here are simply innumerable. Even if you take the problem with a wolf, a goat and a cabbage - how is this even possible? Are you naked, standing on the bank of the river, in front of you all this good and you need to cross? Oh yes, the banks of the river are made of adamantium, so you wouldn't guess to bury cabbage. In such a situation, any normal person will first of all think about whether to call an orderly.



We have already figured it out above, for what a normal person imagines with the phrase "pipe with water", the thermal solution is practically inapplicable. At least if you do not accidentally have a burner and two cylinders with you.



However, several other solutions can be thought of. Also, not without restrictions, but more widely applicable.



Thermal, but "reverse" option - blow the pipe with carbon dioxide from a fire extinguisher and see how the frost melts.



You can put a tuning fork on the pipe and listen to the sound to the left and to the right. In the direction of fluid movement, the sound will spread further. Here, however, sufficiently high speeds are needed. For very high speeds, you can even hear the Doppler effect.



Especially powerful candidates can simply kick the pipe and see in which direction the wave decays faster.



With an adjustable clamping force, you can squeeze the pipe to reduce the passage and then measure the force required to compress it on both sides of the constriction.



In general, there are solutions. But rather bizarre for such a simple task. And they are all more difficult than the obvious - to reach the end of the pipe. In the real world, endless pipes do not occur. Moreover, where it is important, the direction of movement of the fluid is indicated during installation. And there are even valves to prevent back movement.



Unfortunately, such tasks will not tell anything about the candidate. Well, besides the fact that he loves to solve puzzles at his leisure.



All Articles