top of page
Search Results

75 items found for ""

  • Python Cheat Sheet

    Libraries Before you can use libraries, you need to import them. For maths: import maths For random: import random If the library name i slong, such as for plotting, you can set a shortened name: import matplotlib.pyplot as plot Useful random functions To generate a random number, n, in the range 0 ≤ n < 1: n = random.random() To generate a random integer, n, in the range a ≤ n ≤ b: n = random.randint(a,b) Therefore, a function for rolling a standard six-sided die is: roll = random.randint(1,6) Lists / Arrays n number of data points can be stored in lists, where each data point is given an index address. The first term has address [0], and the last term has address [n-1]. Indexing can be done in negative: in this case, the last term has address [-1] and the first term has address [n]. Defining Lists To define lists manually: Age = [18, 18, 19, 18, 17 ... ] Colour = ['Blue', 'Green', 'Yellow' ...] Note that you need to put strings in quote marks. To define lists automatically as a list of integers from a range of a to b: R = range(a, b+1) A = [] for members in R: A = A + [members] To generate a list from a series of values, for example a set of random numbers: for members in A: members = random.randint(1,6) die.append(members) Integer Lists To sum all the terms in a list: for members in List: members = sum(List) To apply maths on every member of a list, L: Lx2 = list(map(lambda x: x * 2, L)) Lplus1 = list(map(lambda x: x + 1, L)) Lsquared = list(map(lambda x: x ** 2, L)) To multiply all the numbers in a list together: def multiply(List): total = 1 for n in List: total *= n return total print(multiply((List))) To swap two elements in a list: L = [1,2,3,4,5] #to swap 2 and 3: temp = L[1] L[1] = L[2] L[2] = temp Searching Lists To search for a value in a list, there are two options. The first is to use a for loop - this is used when you want to carry on searching the list even after you found the value: List = #define list find = input() # Convert to integer if necessary found = False for members in List: if members == find: found = True print(found) The second is to use a while loops - this will stop counting either when you reach the value, or when the whole list has been counted: List = #define list N = len(List) find = input() # Convert to integer if necessary found = False count = 0 while (not found) and count < N: if List[count] == find: found = True else: count = count + 1 print(found) Boolean Operations The if-else function is used to test boolean outcomes (where the outcome is either 'yes' or 'no'). a == b a equals b a != b a does not equal b a < b a is less than b a > b a is greater than b a <= b a is smaller than or equal to b a => b a is greater than or equal to b A nice example is rolling two dice. This requires two loops, the first tests for a draw, the second for a winner. import random as rn #Setting up rolling functions Die1 = rn.randint(1,6) Die2 = rn.randint(1,6) #Rolling the dice print('Die 1 lands on a', Die1) print('Die 2 lands on a', Die2) if Die1 == Die2: #it is a draw print('It is a draw.') else: if Die1 < Die2: #Die2 wins print('Die 2 wins.') else: #Die1 wins print('Die 1 wins.') Quick Functions Type function To find what type of variable a variable is: #for variable = var type(var) #to print this: print(type(var)) Remainder Function To find the remainder of a division: # a is the numerator # b is the denominator # r is the remainder r = a//b print(r) I/O Files Data can be input directly or indirectly to a code. Direct inputs are provided interactively, while the programme is running (e.g. using a keyboard and the input() function). Indirect inputs are when data is read from a predefined location, such as a file. Writing to Files Just like libraries, files need to be uploaded before they can be accessed: f = open('FileName.txt', 'w') This opens the file 'FileName.txt' to write to it, and assigns it to variable f. To write something to the file, for example a number of strings, use the write command: # To add strings a and b to the file on separate lines: f.write(str(a) + '\n') f.write(str(b) + '\n') To write from a list: # To add a list to a file, with each element on a new line: for item in a: f.write(str(item) + '\n') To create a file with numbers from 1 to 100: f = open('Numbers100.txt', 'w') R = range(1, 101) for i in R: f.write(str(i) + '\n') f.close() Reading from Files Instead of using a 'w', an 'r' represents reading: f = open('FileName.txt', 'r') By default, the program will read a file exactly as it is: f = open('FileName.txt, 'r') a = f.read() f.close() print(a) If, however, you want to compile all the lines into a list, use the .readlines command: f = open('FileName.txt', 'r') a = f.readlines() f.close print(a) This produces a list of strings with operators '\n' attached. The new line trail can be removed using a strip function: f = open('FileName.txt', 'r') a = f.readlines() f.close() b = [] for items in a: b = b + [items.rstrip()] print(b) Creating a List of Integers from a .txt File f = open('IntegerList.txt', 'r') a = f.readlines() f.close() b = [] for items in a: b = b + [int(items.rstrip())] Closing Files When finished with a file, it needs to be closed (this is like saving it): f.close() Matrices Python is a very powerful tool for computing data stored in matrices. Defining a Matrix from a List n is the number of rows m is the number of columns 'List' is... the list def Matrix(n, m, List): row = [] matrix = [0 for height in range(0, n) for p in range(0, n, 1): for i in range((p*m), ((p+1)*m)): row = row + [List[i]] matrix[p] = row row = [] return matrix Finding the Transpose of a Matrix M is the matrix we want to transpose n is the number of rows in M m is the number of columns in M def Transpose(n, m, M): #M is an nxm matrix row = [] transpose = [0 for height in range(0, m)] #B is the column number for B in range(0, m): #A is the row number for A in range(0, n): row = row + [M[A][B]} transpose[B] = row row = [] return transpose Finding the Product of Two Matrices def MatrixMult(A, B): #A and B are the matrices, AB = C if len(A[0]) == len(B): add = 0 C = [[0 for width in range(len(B[0]))] for height in range(len(A))[ for x in range(0, len(A)): for y in range(0, len(B[0])): for z in range(0, len(A[0])): add = add + (A[x][z]*B[z][y]) C[x][y] = add add = 0 return C else: return Approximating Pi import matplotlib.pyplot as plot import random as rn print('Input n:') n = input() n=int(n) r = range(1,n) xout = [] xin = [] yout = [] yin = [] pointsinside = 0 pointsoutside = 0 for c in r: x = rn.random()-0.5 y = rn.random()-0.5 if(x**2 + y**2 < 0.25): xin = xin + [x] yin = yin + [y] else: xout = xout + [x] yout = yout + [y] pi = len(xin)*4/n print('Pi =', pi) plot.scatter(xin, yin, color = 'green') plot.scatter(xout, yout, color = 'black') TEST FOR jqMATH $$y-y_0=m(x-x_0)$$ $$y-y_0=m(x-x_0)$$ $$ax^2$$ is there an equation here? \( ax^2 \) I wonder if it works

  • Fundamentals of Fluid Mechanics

    In fluid mechanics, ‘flow’ is what we call a fluid’s tendency to deform continuously under a shear force. This response to tangential forces and not normal forces is what differentiates fluids from solids: Both the solid and the fluid will deform slightly under the uniform normal force, but then resist any further compression. When a shear (tangential) force is applied to a solid, it deforms slightly in the direction of the force, but then resists further deformation. When a shear force is applied to a fluid, however, it immediately begins to deform, and will continue to do so until the force is removed (it will then eventually come to rest due to the frictional force between the fluid and the container wall). When acted on by a normal force, solids and fluids behave similarly. When acted on by a shear force, they behave very differently. As well as differentiating solids and fluids, we must differentiate between liquids and gasses: A gas will fill the whole space it is given, a liquid will fill the bottom Gasses are far more compressible, as their density is dependent on pressure The Continuum Viewpoint Fluids, like solids, are made up of a vast number of molecules. If we really wanted to, we could therefore investigate the flow and deformation of fluids by looking at the motion of each individual molecule. This is called the molecular viewpoint and is the most fundamental viewpoint – it is used in the pure sciences, but in engineering it is far too complex. Instead, we make the continuum assumption: A body consists of infinitely many homogeneous elements, each one significantly smaller than the body itself, but significantly larger than the individual molecules. We model the elements as homogeneous, as this allows us to define important properties, such as density, temperature etc. at the point of the element. Assuming that the body is not homogenous on the whole, we can find the average density of the body: If we define an element in the body to have mass δm and volume δV, where the volume tends towards zero, we can work out the density of the individual element: The continuum assumption suggests that as the element gets smaller and smaller, the density does not change. This assumption is only valid at certain scales If δV gets too close to zero, we intrude on the molecular scale where density fluctuates hugely between molecules, if δV is too far from zero, the assumption is vastly inaccurate. Field Descriptions The continuum viewpoint allows us to model properties such as density as a function in space. This is because they are not uniform throughout the body, but they are distributed continuously: Density is a scalar quantity, so the above graph is a ‘scalar field’. If we want to model vector properties, then each plot is a vector from a point, not just a point: it has magnitude and direction as well as location. This is known as a ‘vector field’: Scalar and vector fields can be steady or unsteady: Steady functions do not change with respect to time Unsteady functions do change with time Therefore, we can write functions as: The most common example in fluid mechanics is the velocity field: This is often written in shorthand as: Generally, velocity fields are three dimensional, however sometimes they can be one or two dimensional: A common example of a one-dimensional velocity field is for steady laminar pipe flow. We can reduce this three-dimensional system to be one dimensional by plotting it in polar form, assuming that the cross-sectional profile is the same everywhere and also axisymmetric (circular – does not vary with θ): Streamlines & Pathlines To simplify complex velocity fields, we can plot streamlines. These are lines that are always tangential to the instantaneous velocity vectors, and can be thought of as ‘joining the dots’ (ish). These streamlines are for the same two-dimensional velocity field shown higher in the page. Streamlines can never cross This means that the streamlines in a tube are always contained in the tube: Steady Streamlines For a steady two-dimensional velocity field, u(x, y), the equation for the streamlines can be found by integrating: This will give a family of streamlines (because of the ‘+c’ constant of integration). To find a specific streamline, you need to know coordinates. In steady flow, the streamline is constant. This means that the particles always follow it, and so we can investigate it by observing how some marked fluid particles (e.g. dye) travel. Unsteady Streamlines & Pathlines In unsteady flow, the fluid particles always follow the streamline, but the streamline is constantly changing. This means that the particles eventually deviate from the observed instantaneous streamline. The actual trajectory of a particle is therefore not shown by the streamline, but by another line: the pathline. For two-dimensional fields, the pathline can be found in parametric form, with parameter t (time): Streaklines Streaklines are a third type of line we can plot from unsteady velocity fields: these are lines that join particles that pass through the same point, at different times. For example, smoke particles passing through a chimney. In steady flow, streamline, pathlines and streaklines are all the same. Summary Flow is a fluid’s tendency to continuously deform under a shear stress In engineering, we apply the continuum viewpoint to simplify fluid models Properties such as density can be modelled as scalar fields, and quantities like velocity can be modelled in vector fields Steady functions do not change with respect to time; unsteady functions do Streamlines are tangential to the instantaneous vectors on the velocity profile Pathlines are used in unsteady flow to model the actual trajectory of a fluid particle Streaklines join particles that pass through the same point in space at different points in time Next: Forces in Fluids ▸

  • Foundations of Thermodynamics

    There are four Laws of Thermodynamics: The Zeroth Law of Thermodynamics says that if two bodies are in thermal equilibrium with a third body, the two bodies are also in thermal equilibrium with one another The First Law of Thermodynamics states that energy can neither be created nor destroyed: it always exists, and can only be converted from one form into another The Second Law of Thermodynamics The Third Law of Thermodynamics The Macroscopic Viewpoint We know that substances are made up of particles and molecules. For example, a gas exerts a pressure on its container due to the individual molecule collisions with each other and the walls. This is called classical thermodynamics, but this microscopic viewpoint is not particularly helpful for engineering problems as it overcomplicates things massively. Instead, we model the particles grouped together as a substance. This is called the macroscopic viewpoint and it applies the continuum assumption that properties within a substance are equally and evenly distributed. Systems and Control Volumes Systems are defined as certain amounts of matter within a specified space. Everything outside the system is known as the surroundings, where the boundary is the zero-thickness line that separates the two. Boundaries can be fixed (such as a pressure vessel) or movable (a piston). If no matter can cross the boundary, the system is said to be closed. Energy in both heat and work forms can cross the boundary, and the volume is not fixed. If no matter nor energy can cross the boundary, the system is said to be isolated. If both mass and energy can cross the boundary, the system is said to be open – or more commonly, it is described as a control volume. Examples include turbines or compressors: the volume is arbitrarily defined in space and is fixed, though the boundaries can move. Properties of Systems All systems have properties that are true anywhere in the system. These could be intensive of extensive: Intensive properties are independent of a system’s size (e.g. temperature, pressure, and any constants such as viscosity) Extensive properties are dependent on a system’s size (e.g. total mass and volume) Specific properties are extensive properties per unit mass, and are noted using the lower-case version of their assigned letter: V is the total (extensive) volume of the system v is the specific volume, the volume per unit mass, V/m The properties of a system in a given state do not depend on the circumstances by which the system came to be in that state. Simple Compressible Systems A ‘simple compressible system’ is one which can be fully defined by two independent intensive properties. This is when the impact of gravity, motion, and many other properties such as magnetic fields can be neglected. Equilibrium If a system is in equilibrium, it is not experiencing any change. All the properties are uniform (do not vary in space) and steady (do not vary in time): they are said to be constant and describe the state of the system. As soon as one property changes, so does the state. If a system is totally independent from its surroundings – there is no heat or work transfer across the system boundary – then the system is in internal equilibrium. Nothing from the surroundings can impact the properties of the system, and so there is no change in properties with respect to time. Here, the gas is an insulated system in equilibrium: If the diaphragm breaks, the system is no longer in internal equilibrium: Eventually, a new internal equilibrium is reached, where the gas is at a lower pressure: When a system is impacted by its surroundings, equilibrium is also reached. A common example is a movable piston: in its initial state, the piston is held in a fixed position and the gas (the system) is in compression, at a greater pressure than the surroundings: Then, the peg is removed so piston can move, and so it moves until the forces from pressure on either side of the piston are balanced: If the same system were arranged vertically, the weight of the piston would need to be considered as well. Problems like this are solved simply by resolving forces, remembering that: Processes, Paths & Cycles A process is when a system changes from one state to another. The path is the steps taken to complete that process – e.g. any intermediate states. Processes are defined in terms of the initial and final states, and the properties at each of these states: If a process is particularly slow, and the change in state is infinitesimally small per unit time throughout, we can model the process as quasi-equilibrium (sometimes called quasi-static). This is because at every point throughout the process, the system may as well be in equilibrium: for example, a slow moving piston. If the piston is suddenly stopped, and the ‘settling time’ for the system to return to equilibrium is miniscule (< 1/10th speed of sound) in comparison to the time taken to notice a change in properties, the process is described as quasi-equilibrium. There are a number of constant-property processes to be aware of: Isothermal processes have constant temperature Adiabatic processes experience no heat transfer Isobaric processes have constant pressure Isochoric processes have constant volume - also known as isometric Isenthalpic processes have constant enthalpy You must be familiar with this terminology Cycles A cycle is a series of processes that take place one after the other. The final process must end in the same state as the first process starts in, forming a closed loop on a two-property graph: The ‘air-standard’ model is the idealised cycle of a diesel cylinder, shown here. Process 1-2 Air is compressed by the piston (constant temperature) Process 2-3 Air expands at constant pressure as heat is transferred to it Process 3-4 Air continues to expand to maximum volume, but pressure decreases (constant temperature) Process 4-1 Pressure and temperature fall to initial value instantaneously, volume remains maximum Summary Closed Systems contain a fixed mass of matter, and only work and heat energy can cross the boundary (not mass) Control Volumes occupy a given volume of space. Energy and mass can cross the boundary Intensive properties of a system are independent of the system’s size, extensive properties are dependent on size Specific properties are given by lower-case letters, and are the property per unit mass A system is in equilibrium if there is no change in its properties with respect to space or time A process is a change from one form of equilibrium to another, through a specific path A quasi-equilibrium process is an idealised model for processes where the change in state is infinitesimally small per unit time A cycle is a series of processes that start and finish at the same state

  • Forces in Fluids

    There are many forces that act on solids, but there are only four main forces present in fluids: Gravity – this is always present, but is sometimes negligible in comparison to other forces Pressure – this is also always present, and is always modelled as compressive and normal to the surface Viscous – this is always present as well, and similar to gravity, can sometimes be ignored Surface Tension – this is only present where a liquid meets another medium, like in bubbles and sprays Since fluids are constantly moving, the forces surrounding them are constantly changing. We split these forces into two types: body forces and surface forces. Body Forces Body forces are forces that act everywhere throughout the body. They occur when a body is subjected to an external field, and the magnitude of such forces depends on the volume of the body. Gravity is a body force The gravitational force per unit volume is given by: Therefore, the magnitude of the force acting on an element of volume δV (from the continuum assumption) is given by: Since acceleration due to gravity is constant, the gravitational force depends only on density and volume. Surface Force As the name suggests, a surface force is distributed across a surface, and (just like body forces) we use it in terms of intensity: the force per unit area. You may recognise this as pressure or stress – it is the same. If the force is evenly distributed across the surface, the stress on the surface, τ, is given by: However, when the force is not evenly distributed, we apply the continuum assumption to a small section of the surface, δA: If the force is not normal to the surface, you need to find the perpendicular and parallel components: the normal and shear stresses respectively Pressure Force The pressure force is a surface force that is perpendicular to the surface. This means it is a normal stress: From the molecular viewpoint, pressure is caused by the molecules colliding with the surface. From the continuum viewpoint, pressure is given as the normal force per unit area on an infinitely small surface. Pressure is always compressive, and has the same magnitude in all directions Viscous Force The viscous force is the frictional force that opposes a fluid’s flow. Therefore, it is a shear force, as it is tangential to the velocity. From the molecular viewpoint, it is caused by the intermolecular forces and collisions, but we look at it as deformation instead. The viscous force is only present when the fluid is in motion. Once the external shear force causing the fluid to move is removed, the viscous force will bring the fluid to a halt. Therefore, the viscous force dissipates energy. The No-Slip Condition From velocity fields, we know that the deformation in fluids is different in different layers of the fluid: the layer that is furthest from a wall has the highest velocity relative to the wall the layer that is touching the wall has zero velocity relative to the wall This is known as the no-slip condition. Newton’s Law of Viscosity Newton’s Law of Viscosity states that viscous stress is proportional to the local viscosity, the velocity gradient: τ is still the shear stress, and μ is the viscosity. Newton’s Law of Viscosity only applies to Newtonian Fluids. Viscosity is different for all fluids, and depends on the conditions of the fluid, especially temperature. It is found from data tables. Sometimes, Kinematic Viscosity, ν, is used instead of viscosity. This is defined in terms of density: Fluids that do not obey this law are called non-Newtonian: Pseudoplastics are an example, in which the viscosity decreases with strain rate. A common example is non-drip paint. Dilatants are the precise opposite of Newtonian fluids: their viscosity increases with strain rate. The best example is corn flour & water: the harder you stir, the more solid it becomes. Bingham plastics behave as a solid up to a specific yield stress. Beyond this, they act as a Newtonian fluid (e.g. toothpaste) The magnitude of the viscous force is given by the shear stress multiplied by the area: The sign of the force depends on what else is going on: This diagram shows three layers of the same fluid. The darker the layer, the higher the velocity of the fluid To know the directions of the viscous force on the top and bottom boundaries of the central layer: Draw the axes that are normal to the boundary between the layers, pointing outwards (y-axis) Draw the axes that are tangential to the boundary, pointing 90 degrees clockwise from the normal boundary(x-axis) If the tangential axis (x-axis) is in the same direction as the velocity (u), then the viscous force will be positive: If it points in the opposite direction, the viscous force will be negative: In this example, the force on the top boundary is positive, and on the bottom boundary it is negative. Rates of deformation and velocity As a fluid element moves and deforms under the shear stress over a time interval δt, an angle forms between the two sides of the element, δθ. This angle is the shear strain. For small sear strains, we can apply the small-angle approximation for tan: The rate of deformation (shear strain) is equal to the velocity gradient, acceleration. Surface Tension Surface tension is a force that occurs whenever there is an interface between a liquid and another medium and opposes the increase in contact area between the two mediums. It happens because there is a difference in the intermolecular forces in the liquid and the other medium, meaning that liquid molecules at the boundary experience different forces than the molecules far from the boundary. Surface tension is responsible for the shape of water droplets and bubbles. Types of Flow There are a number of standard types of flow to be aware of: Steady flow moves at a constant rate (no acceleration) Unsteady flow moves at a rate that varies with time Viscous flow is affected by viscous forces Inviscid flow is not affected/negligibly affected by viscous forces Incompressible flow has constant density (assumed for most liquids) Compressible flow has density that varies significantly with pressure (e.g. high-speed gasses) Laminar flow is ordered: there is only one space/time scale (one velocity profile) Turbulent flow is chaotic: there are multiple space/time scales (multiple velocity profiles) Internal flow is entirely enclosed within boundaries (e.g. pipes or bottles) External flow is unbounded (e.g. air flow around an object) Summary Body forces in fluids (such as gravity) act everywhere in the fluid Surface forces act at the interfaces between fluid layers and fluid boundaries The viscous force is the frictional force that opposes flow, and obeys the no-slip condition Newton’s law of viscosity applies to all Newtonian fluids: τ = μ du/dy The rate of deformation is equal to the velocity gradient Surface tension is the force that opposes the increase in contact area between a liquid and another medium Next: Fluid Statics ▸

  • Energy, Heat & Work

    In mechanics, the key forms of energy are kinetic and potential. These energies apply to a body as a whole, and so can be seen as macroscopic. Microscopic energies are the forms of energy within that body: bond energies, kinetic and potential energies of individual particles (sometimes known as the ‘sensible’ energy), nuclear energy etc. All these microscopic energies are grouped together as internal energy, U. The total energy of a system, E, is given as the sum of the internal, kinetic, and potential energies: By dividing by the mass, the specific energies can be found: Closed systems generally remain motionless, so rarely experience a change in kinetic or potential energies. In this case, the change in total energy is equal to the change in internal energy. For control volumes, fluid may be moving in and out at a mass flow rate (represented by an m with a dot above it). In this instance, the energy flow rate is: We can group internal energies into two parts: the static energies and the dynamic energies. The former are fixed within the system, and so cannot change the overall internal energy. The latter are free to cross the system boundary, and so it is these that we are interested in. There are only two forms of energy transfer for a closed system: heat transfer and work. In a closed system, an energy transfer is always a heat transfer if it is brought about by a temperature difference. In all other situations, the energy transfer takes the form of a work transfer. Heat Transfer Heat transfer, Q, is the transfer of energy due to a difference in temperature between a system and its surroundings. In thermodynamics, the term ‘heat’ should only be used to refer to heat transfer. If you are talking about the energy due to temperature of a substance or system, call this ‘thermal energy’. It is convention to define heat transfer from the surroundings to the system as positive, and heat transfer from the system to the surroundings as negative. Heat transfer can take one of three forms: Conduction between neighbouring particles Convection between a solid and a fluid Radiation through electromagnetic waves or photons Work Transfer Work transfer, W, is the transfer of energy between a system and its surroundings that is not caused by a difference in temperature. Sometimes it is useful to think about work transfer as the lifting of a mass: if the energy transfer can in any way be modelled as raising a mass, then it is a work transfer and not a heat transfer. The sign convention for work transfer is the opposite to that of heat transfer. A positive work transfer means work transfer from the system to the surroundings A negative work transfer means work transfer from the surroundings to the system There are two key types of mechanical work transfer: displacement work and shaft work. Displacement Work Displacement work is the work done in moving a system boundary by a certain distance in the direction of a normal force. A common example is a piston moving due to a change in pressure, volume, and/or temperature. In this instance, the change in work is given as the product of the pressure and the change in volume: If the expansion is fully resisted, it can be modelled as a quasi-equilibrium process. When this is the case, we can plot it on a P-V graph where the work is the area under the graph: Therefore, the work done is given as the integral of P dv: There are a few key forms that are useful to know, to spare integrating them every time: Shaft Work Shear work is the work done in moving a system boundary in the direction of a tangential force (a shear force). This is very common in liquids, where they interact with their container. Shear work transfer into a fluid typically comes from a stirring force: Instead of modelling the system as just the fluid, we can model the system as the fluid, the paddle, and the shaft. This means the only input to the system is a shear work on the shaft, known as shaft work. The force involved is a torque couple, and so the power of the shaft (the rate of work transfer) is given as: The 1st Law of Thermodynamics The first law of thermodynamics states: Energy must be conserved: it can neither be created nor destroyed This means that in any process, 1-2, where there is a heat transfer to the system and a work transfer from the system, the difference in these transfers must equal the total change in energy of the system: Remember the sign conventions for Q and W are opposite For a cycle, there can be no overall change in energy in the system at the start and end. Therefore: Where the heat and work transfers are summed respectively: Adiabatic & Isothermal Processes In a reversible process, assuming we can measure the changes in pressure and volume, we can calculate the work output as PΔV. Applying this to the first law gives: We only know one quantity in the equation: ΔQ and ΔU are both unknown, and as such we either need to define one of them or use the second law. These are two ways in which we can define one of the unknown properties above. Adiabatic In an adiabatic process, there is no change in heat: This then fully defines the process, and the first law can be used to find the change in internal energy: From this, we get the following relationships for an ideal gas in an adiabatic process: See the derivations here. Isothermal Instead of insulating the system, a thermal reservoir is attached. This means the fluid is always at the same temperature (that of the reservoir), and as such there is no change in internal energy: Again, the process is now fully defined, and so the change in heat can be found using the first law: Note that adiabatic processes are far quicker than isothermal processes (see the gradients of the curves) This is because the equation of the curve is given as: In an adiabatic process, T decreases as V increases In an isothermal process, T is constant so only V increases Summary The total energy of a system is given as the sum of the internal, kinetic, and potential energies For a closed system, the change in total energy = change in internal energy Heat transfer is the transfer of energy between a system and its surroundings due to a temperature difference A heat transfer to the system (heating up) is positive, a heat transfer from the system (cooling down) is negative Work transfer is the transfer of energy between a system and its surroundings that is not due to a temperature difference According to the first law, energy must be conserved: ΔQ – ΔW = ΔU For a cycle, ΣU – ΣW = 0

  • Fluid Statics

    Since fluids are almost always in motion, there is not all that much to fluid statics. Yay! Really, the only bits are the hydrostatic equation (which is used as the basis of any fluid statics problem), pressure variation with depth, and forces on submerged surfaces – though these can be tricky. The Hydrostatic Equation The derivation of this equation is simple. Take a fluid particle, where the area at the top and bottom is A and the height is δz Taking the pressure at the bottom as P, we can work out the pressure at the top as P + the difference in pressure: Using F = PA, calculate the force on the bottom and top: The gravitational force of the fluid particle (the weight) is given as: Now, we can balance the forces on the fluid particle: This is the Hydrostatic Equation, and integrating both sides gives the equation for change in pressure with change in height that you are probably familiar with: Note that you are probably familiar with ΔP = ρgh. This is the same, h is just defined as (z₁-z₂), hence the negative sign disappears. This form is sometimes known as the integrated form. It is important to note that in this derivation, density has been assumed to be constant. In reality, this is often not the case. Gauge Pressure In the derivation above, we have ignored atmospheric pressure. This is because we assume it acts the same on each surface, so cancels out. Pressure that ignores atmospheric pressure is called gauge pressure, as it is the pressure a gauge will read (for example on a bicycle pump). Manometry A manometer is a device used to measure a pressure difference: If we know the difference in heights of the fluid interfaces, l, we can calculate the pressure difference of P₁ and P₂, because the pressure at A (a point in height that we chose to define) must be the same in each side: Combining these equations gives: As you can see, the height l’ is irrelevant. Hydrostatic Forces on Flat Surfaces Since pressure varies with depth, the magnitude of the force on a submerged surface also varies with depth: it is known as a distributed force. When combining fluid mechanics with solid mechanics, however, this is not helpful. Instead, we want to know the resultant force of the pressure on the surface. There are three things we need to know to fully define the resultant force: The magnitude The point of application The direction The direction is easy: pressure force always acts perpendicular to the surface. To find the magnitude and direction we use a particular form of two-dimensional integration: surface integrals. We know that the pressure force on an infinitesimally small area is given by: Integrating this on a surface gives the sum of the forces on the infinitesimally small areas: The subscript A under the integral sign tells us it is a surface integral. Solving Surface Integrals Writing pressure in terms of y (using the hydrostatic equation) gives: Converting this into a function involving dy allows us to integrate the function as a standard integral: For a rectangle width y and length L, dA can be written as L dy: You must find pressure as a function of y. It is easy to forget to do this! Finding the Point of Application To find the point at which the resultant force acts, you can solve using moments, as the resultant force must have the same moment as the sum of all the forces acting on the infinitesimally small areas. y’ is the distance along the surface that the resultant force acts on. The sum of moments of the tiny forces can be worked out by another surface integral, but this time, there is an extra y term. Therefore, the moment is given by: This means that the distance along the surface that the force acts on, y’, is given by: Now that we know all three parts of the resultant force (magnitude, point of application and direction), we can solve problems like a vertical gate on the side of a tank: If you know the dimensions and depth of the gate, as well as the density of the fluid in the tank, you can work out where and what magnitude of force is required on the outside of the gate to keep it closed. Hydrostatic Forces on Curved Surfaces Integrating pressure over a curved surface is often very complicated. Instead, there is a simpler method that involves balancing horizontal and vertical forces. Take this quarter-cylindrical surface: The horizontal force acting on it is the resultant pressure force and is found exactly the same as for a flat vertical surface: The vertical force action on the surface is the weight of the fluid above, acting downwards: Therefore, the total resultant force is given as a vector: The j component is negative, as the weight acts downwards. Buoyancy All submerged bodies experience an upwards force. This is because the pressure force acting up on their lower surface is greater than the pressure force acting down on their upper surface. The difference in force is known as upthrust, or the buoyancy force. According to Archimedes’ Principle: The magnitude of the upthrust is equal to the weight of water displaced. This is proven hydrostatically: If the weight of the object is less than or equal to the magnitude of the upthrust, the object will float. If the centre of gravity of the object does not align with that of the displaced fluid, there will be a net resultant moment acting on the object. This is what causes ships to capsize. Summary The change in pressure with height is given by the hydrostatic equation: Δp = ρgΔh Gauge pressure neglects atmospheric pressure, as it acts the same everywhere A manometer is used to measure a difference in pressure Surface integration is used to find the resultant force and moment on submerged surfaces If the surface is curved, split the resultant force into vertical and horizontal components where the vertical component is the weight of water above Archimedes’ Principle states that the magnitude of the upthrust (buoyancy force) is equal to the weight of water displaced Next: Control Volume Analysis ▸

  • Properties of Substances

    In order to predict how systems will behave, we need to understand their properties at different equilibrium states. Pure Substances A pure substance is one that is chemically homogenous (it has the same chemical composition everywhere in the substance). Examples include hydrogen pure water a mixture of water and steam air (all the gaseous substances are distributed evenly, everywhere) Examples do not include Mixtures of oil and water (oil is not soluble in water, so the two will always be separate) Mixtures of liquid and gaseous air (different parts of air condense at different temperatures, so the mixture is not homogeneous) Phase Changes While there are three main phases a substance can be in (solid, liquid and gas), there are also a number of sub-phases within these: As you can see, the liquid phase is broken into two bands: subcooled (compressed) liquids are when the liquid is not about to evaporate. For example, water at 20°C saturated liquids are when the liquid is about to evaporate. For example, water at 100°C The gas phase is also split into two bands: saturated vapours are vapours that are about to condense. This region overlaps with the saturated liquids phase, so at 100°C, water exists as a mixture of liquid about to vaporise and vapour about to liquify superheated vapours are gases that are not about to condense. For example, steam at 300°C The boiling point is also referred to as the saturation temperature and pressure. This is the given temperature and/or pressure that the liquid-vapour mixture is seen. It is important to note that the temperature remains constant during a phase change. There are two other important point between phases: the critical and the triple point. At the triple point, gas, solid and liquid phases can coexist. Above the critical point, liquid and vapour can no longer be distinguished. It is the high-pressure form of the liquid-vapour mixture phase, known as the supercritical fluid phase. Latent Heat The energy absorbed or released during a phase change between solid and liquid is called latent heat of fusion; that absorbed or released between the liquid and vapour states is called latent heat of vaporisation. Behaviour of Gasses Equations of state (EoS) are laws that apply at any point in a given state. These are helpful to describe and model the behaviour of substances, especially of ideal gasses. Making three assumptions about gasses simplifies the models greatly: Momentum is conserved when gas molecules collide with the container wall Gas molecules have negligible volume Any attractive forces between gas molecules is negligible These assumptions are known as the kinetic theory of gasses, and give us the ideal gas EoS: A more common form of the equation uses the specific gas constant, R, and the mass, m, of gas: Dividing both sides by the mass gives the specific volume form: Since R is constant, we can write this as: It follows from this that specific internal energy, u, is only a function of temperature, and not pressure: When Kinetic Theory Doesn’t Apply If we cannot assume that molecular volume and inter-molecular attraction are negligible, then the EoS has to be re-written in van der Waals form: Perfect Gases If the process occurs over a very small change in temperature, we can model the ideal gas EoS as being linear: Cv here is the specific heat at a constant volume. Enthalpy For a constant pressure process, work transfer is given as W = P x ΔV (See notes sheet on energy, heat & work). Applying this to the first law, Q – W = ΔU gives: Therefore, heat transfer is given as the change in (U + PV). Since U, P and V are all properties, (U + PV) must also be a property: enthalpy, H: Specific enthalpy is therefore given by: Applying the EoS for ideal gasses, we can write specific enthalpy like this, too: For ideal gases, the change in internal energy is given by the integral of Cv, the specific heat at constant volume, with respect to temperature: Meanwhile the change in enthalpy is given by the integral of Cp, the specific heat at constant pressure, with respect to temperature: For ideal gasses: For a perfect gas, Cp and Cv are constant so the changes in enthalpy and internal energy can be modelled as: From h = u + RT, we can write h – u = RT. Dividing both sides by T gives dh/dT and du/dT on the left-hand side, and just R on the right. Therefore: Another important quantity is the ratio of the two specific heats, γ: For a perfect gas: Vapours & Liquids The behaviours of vapours and liquids can be represented on a P-v diagram, as shown above. The isotherms are increasing towards to the top right, so the bottom left line represents the lowest temperature, and the top right line represents the highest temperature. The grey shaded region of wet vapour is sometimes called the vapour-dome. The straight horizontal line here represents an isobaric (constant pressure) process. The graphs are useful as they give a lot of information: The substance is a subcooled liquid, being heated up The substance has heated up and is now a saturated liquid The temperature is the same and the substance is made up of a mixture of saturated liquid and saturated vapour The temperature is the same and the substance is a saturated vapour The substance has heated up more and is now a superheated vapour Properties on the liquid side of the vapour-dome are noted using subscript f (from the German word ‘flüssig’, meaning liquid), while properties on the vapour side are noted with subscript g (from the German word ‘Gas’, meaning… gas): A change in any property between the saturated liquid and saturated vapour states is noted with the subscript fg: Dryness Fraction Inside the vapour-dome (the wet vapour state), the isobars and isotherms are on top of one another. This means that for wet vapours, the two are dependent, and so the vapour can be fully defined with just v and either P or T. Sometimes, we want to know how much of a wet vapour is saturated liquid and how much is saturated vapour. To do this, we use linear interpolation along the horizontal line of temperature and pressure. This is called the dryness fraction, x: For a saturated liquid, x = 0 For a wet vapour, 0 < x < 1 For a saturated gas, x = 1 Often it is more helpful to use volume instead of mass: From this, we can derive useful equations to calculate the internal energy, enthalpy and volume at a given point in the wet vapour phase: Summary A pure substance is one that is chemically homogeneous Subcooled liquids are not about the evaporate, saturated liquids are about to evaporate Saturated vapours are about to condense, superheated vapours are not Wet vapour is the mixture of saturated liquids and vapours The equation of state, PV = nRT applies anywhere in a given state (here R is the molar gas constant) This can be rewritten as PV = mRT, and Pv = RT (here R is the specific gas constant) Internal energy is only a function of temperature Enthalpy is given as h = u + Pv For perfect gases, Δh = Cp ΔT For perfect gases, Δu =Cv ΔT γ = Cp / Cv Dryness fraction is the proportion of wet vapour that is saturated liquid: x = V - Vf / Vg - Vf

  • Control Volume Analysis

    In this notes sheet... Mass Flow Rate Reynolds Transport Theorem Conservation of Mass Conservation of Momentum As seen in thermodynamics, there is a difference between systems and control volumes. The former are used for a fixed mass of fluid, constantly moving, the latter are used for fluid flow through a defined boundary. We hardly ever model a fixed mass of fluid, and as such we always use control volume analysis in fluid dynamics. Mass Flow Rate Over a set time δt, a distance δx is travelled by any given fluid particles. Therefore, the swept volume over time δt is Aδx. This volume has a mass, ρAδx. The mass flow rate is the derivative of this with respect to time: This can be re-written in terms of normal velocity, u: Mass flux is another description of flow, given as the mass flow rate per unit area: The velocity must be normal to the area. If the velocity is not normal to the area, δA, we need to find the normal component as the scalar product of the velocity and normal vectors: Writing δA as a vector: This is the most important equation for mass flow rate. It will crop up in the derivations of everything that follows in this notes sheet. Through a control volume, where there is inflow and outflow across the control surface (CS): Outflow gives a positive value, inflow gives a negative value. Volume Integrals If certain properties through the control volume, such as density, are not constant, then we need to treat the total volume as an infinite number of infinitesimally small volumes, each with mass: When density is constant: Reynolds Transport Theorem The Reynolds transport theorem is used to model the conservation of any given extensive property N. This could be any property: we will use it for mass, energy, and momentum. In the Reynolds transport theorem, the specific form of the property is used, η: Therefore, ρη is the property per unit volume. The theorem is: The term on the left-hand side is the rate of change of amount of property N in the system at any time. The first right-hand term is the rate of change of the amount of property N in the control volume overlapping with the system at the same time. The second right-hand term is the net flow rate of property N out of the system. See the derivation for the Reynolds Transport Theorem here. Steady Flow In steady flow, there is no net change in the amount of property N in the control volume, so the middle term disappears: This does not mean that there is no change at all: some amount of property N could be created within the control volume, but if this same amount flows out of it, the total amount of N in the CV is fixed. Conservation of Mass The Reynolds transport theorem can be used to get to the equation for the conservation of mass in a control volume. To do this, we set the property we wish to conserve, R, equal to m, meaning that η equals 1: Applying this to the Reynolds transport theorem: The left-hand term is the rate in change of mass in the system. Since mass is conserved, there is no change, so this term equals zero. This leads to the continuity equation: The left-hand term represents the rate at which the control volumes gains mass The right-hand term is the net rate of flow of mass across the control surface Negative, as flow is into the control volume Algebraically, this is written as: Where the sums are all the inflows and outflows added together. Steady Flow For steady flow, there is no net flow across a control surface, so the right-hand side of the continuity equation equals zero: Algebraically, this is the most common form: The total flow in equals the total flow out. For constant density (incompressible flow) and uniform velocity normal to the surface: Constant Density In this case, the left-hand term of the continuity equation equals zero: This represents the volumetric flow rate through the control surface. Algebraically, it is written as: This only applies when the control volume only contains fluid: it is full (not being filled/drained). Conservation of Momentum From Newton’s second law, we know that the sum of the forces is equal to the derivative of the momentum of a system: Rearranging this in terms of a volume integral and density, instead of mass: This is clearly the left-hand side of the Reynolds transport theorem, where: Swapping the right-hand side of the Reynolds transport theorem for the left-hand side gives the equation for the conservation of momentum in a control volume: Steady Flow In steady flow, there is no change with respect to time. Therefore, the first term on the right-hand side becomes zero: Even though one of the velocity vectors dots with the area vector to become a scalar, the second velocity vector remains. Therefore, the equation needs to be split into components, u and v: This can be interpreted to mean the sum of forces in a particular direction is equal to the momentum outflow minus the momentum inflow in that direction. As seen in the notes sheet of forces in fluids, all fluids consist of body and surface forces. All body forces in the control volume (e.g., weight) must be accounted for. Only the surface forces at the control volume boundary, however, must be taken account for here (as internal forces cancel out). These could be atmospheric pressure or reaction forces. Algebraic Formulation The integrated form of the conservation of momentum equation above is not all that useful. Instead, if velocity is uniform at an inlet or outlet, this inlet or outlet can be looked at individually. The surface integral for the whole control volume therefore becomes an area integral for just that inlet/outlet: (See mass flow rate above) Therefore, the conservation of momentum can be written in terms of the sum of all outlet momentums minus those at the inlets: For one inlet and one outlet: Using conservation of mass: Next: The Bernoulli Equation ▸

  • Material Properties and Engineering vs True Stress & Strain

    A material property can be defined as a specific characteristic in reaction to a certain stimulus. These properties differ between materials, but generally materials can be grouped into one of four types, based on their properties and structure: Metals & Alloys Ferrous Metals, such as steels and cast irons Non-ferrous metals, such as copper, aluminium, tungsten and titanium Plastics Thermoplastics, such as polythene, polypropylene, acrylics, nylons and PVC Thermosets, such as polyimides, phenolics and epoxies Elastomers, such as rubbers, silicones and polyurethanes Ceramics & Glasses These include oxides, nitrates, carbides, diamond and graphite Composites Polymer, metal, and ceramic matrices Basic Properties Strength A material’s ability to carry loads without deforming Young’s Modulus A material's ability to resist deformation under tensile or compressive loading Stiffness and ductility are not material properties, as they are geometry-dependent Hardness A material's ability to resist wear, scratching or indentation Fatigue Strength A material's ability to resist deformation caused by repeated (often cyclical) loading Creep Strength A material’s ability to resist deformation caused by a constant and unchanging load over a prolonged period of time Toughness A material’s ability to resist fracturing Chemical Properties These are also important material properties, and include Density Specific Heat Capacity Corrosion Resistance Flammability Toxicity Material Selection Factors These are not properties as such, but are also important factors to consider when selecting a material for a given purpose: Processability Cost Availability Sustainability Engineering Stress & Strain The majority of the properties listed above can be worked out from the stress-strain relationship of a material. Therefore, a tensile test is one of the most important procedures carried out in the study of materials. Tensile Test A test specimen is loaded into a test machine The moving crosshead slowly moves up or down, to apply a compressive or tensile load – the magnitude of this force is measured by the load cell An extensometer measures the extension/compression in the test specimen From the values of force applied and extension, engineering stress, σ, and engineering strain, ε are calculated: F is the force applied A is the cross-sectional area of the test specimen x is the extension l is the original length of the specimen Engineering stress and strain are obtained from a tensile test and are sometimes called nominal stress and strain The values for engineering stress and strain are plotted on a stress-strain graph: This graph is incredibly useful. It tells us: Young’s Modulus, E – The stiffness of the material, given by the gradient of the linear (elastic) region: Yield Strength, σ(y) – The end of the elastic region, the point where the material starts to deform plastically Proof Strength, σ(proof) – The stress at a certain strain offset from the yield strength. This offset is defined as a percentage. Ultimate Tensile Strength, UTS – The maximum stress a material can take without rupture Deformation & Work Hardening In the linear region of the stress-strain graph above (up to the yield strength), the material deforms plastically. This means that once the load is removed, the material will return to its initial length and shape. Beyond the yield strength, the graph is curved. This represents the plastic deformation region of the graph, where the material will no longer return to its initial length and shape: it is deformed permanently. If the material deforms elastically only, once the stress returns to zero (the load is removed), strain also returns to zero. However, if the material deforms plastically, when the stress returns to zero the strain still has a value. The material now has the same Young’s Modulus, but a higher yield strength, as shown in the graph above. This is known as work hardening. Poisson’s Ratio Poisson’s ratio describes how a material changes shape during deformation. It is defined as the ratio of transverse to longitudinal strain: For most ceramics, ν ≈ 0.2 For most metals, ν ≈ 0.3 For most polymers, ν ≈ 0.4 For uniaxial deformation (where the force is applied in one direction only), the fractional change in volume is given by: From this we can see that when ν = 0.5, there is no change in volume. Ductility Ductility is a measure of how much irreversible strain a material can withstand before fracturing. It can be defined wither as a percentage of elongation in a tensile test: Alternatively, it can be defined as the percentage of reduction in area. This is independent of geometry: Where A is the cross-sectional area, initially (0) and finally (f). True Stress & Strain Unlike engineering stress, true stress takes into account the change in cross-sectional area as the material stretches. In general, engineering stress and strain are good enough approximations for predicting how materials will behave under certain circumstances. However, for very large extensions, this approximation can cause serious errors. The change in cross-sectional area is particularly significant when necking occurs. Necking is when a material deforms locally (at a certain point), instead of uniformly. True Stress While engineering stress decreases after the UTS, true stress continues to rise. This is because the area continues to decrease, and true stress is defined as: During elastic deformation, volume is increasing: ν < 0.5 During plastic deformation, volume is constant: ν = 0.5 Therefore, assuming that plastic strain is significantly larger than plastic strain, we take deformation to occur at roughly constant volume. Assuming that volume in the test specimen above is conserved as it extends: Next, we can rewrite the equation for engineering strain as: Substituting these into the equation for true stress gives the definition of true stress: True Strain True strain considers the constantly changing nature of strain and can be approximated with small values of engineering strain. Engineering strain is only a valid as an approximation for true strain for values up to 1% As δl tends to zero, δε gives the true strain: Using the constant volume assumption, we can also define true strain as: Validity It is important to note that these equations are only valid up to the necking point. This is because after necking, the strain is so much higher at the neck than everywhere else, so it cannot be modelled as uniform: Engineering stress and strain can be used as an approximation for true stress and strain for small strains: roughly up to twice the yield strength This chart shows when each equation is valid: Summary Materials are generally grouped into four types: metals & alloys, plastics, ceramics & glasses, and composites Tensile tests are carried out to find the engineering stress-strain properties of a material These tests give us yield stress, UTS and the Young’s Modulus Work Hardening is when a material is deformed plastically, raising its yield stress once the load is removed Poisson’s ratio is the ratio of transverse to longitudinal strain Ductility is a measure of how much irreversible strain a material can withstand before fracturing Unlike engineering stress and strain, true stress and strain take into account the change in cross-sectional area of material as it experiences a load

  • Steady Flow Processes

    In this notes sheet: Modelling steady flow through a control volume The Steady Flow Energy Equation (SFEE) Applications of the SFEE Mass & volume flow rates The Rankine Cycle The basic form of the first law, ΔQ – ΔW = ΔE, only applies to closed systems - no mass can transfer across the system boundary, only energy in the form of heat and work. In reality, perfectly closed systems are quite rare (take a turbine, for example: air flows in as well as heat, shaft work and hot air flow out), and as such a different model is required: The energy transfers across the control volume surface are: Shaft work Heat transfer Energy in the working fluid (kinetic, potential, and internal energies) To simplify the process, we only look at the energy inputs and outputs: what goes on inside the control volume is irrelevant. We call where the working fluid enters and exits ports. The control volume above has two ports: one inflow and one outflow port. The Steady Flow Energy Equation (SFEE) In order to solve problems involving steady flow through a control volume, we use the Steady Flow Energy Equation (SFEE) instead of the simple first law equation: In a less mathematically intimidating form: Left hand side: rate of energy transfer – rate of shaft work Right hand side: sum of output mass energy flow rates – sum of input mass energy flow rates Note: The dot above the letters means it is a rate of change with respect to time: Thankfully, kinetic and potential energies can often be ignored, simplifying the equation immensely. However, it is important you start with the above form when solving problems, else you will likely forget parts. See the derivation of the SFEE here Mass Continuity Equation We can use the SFEE in conjunction with the principle of conservation of mass. This means that the mass in the control volume must stay constant, so the total input mass flow rate = total output mass flow rate: Therefore, for a two-port control volume where potential energies are negligible, the SFEE reduces to: When kinetic energy too can be ignored, it becomes: The point is, the SFEE in its full form may look difficult, but it really isn’t. Just be neat and methodical in your workings, and always start from the full form and then see which terms you can set to zero. Applications of the SFEE There are a number of very common examples where the SFEE is applied and simplified. These are worth knowing, as crop up in almost all problems involving steady flow. This is also where some actual real-life engineering gets involved. Which is fun. Each example has a standard block diagram symbol. These should be learned as they are used to describe multi-stage processes like the Rankine Cycle (see below). Partly Closed Valve (Throttling) This is the simplest form every term in the SFEE other than the enthalpies are negligible: Heat transfer is negligible when the valve is well insulated There is no shaft work Kinetic energy change is negligible Potential energy change is negligible There are two ports, so the SFEE reduces to: From this you can see that throttling (the process that takes place in a partly-closed valve) is isenthalpic. Nozzles A simple nozzle can be modelled as a duct of reducing cross-sectional area, used to increase the kinetic energy of the working fluid at the expense of its enthalpy. There is no heat transfer to or from the working fluid There is no shaft work There is a massive change in kinetic energy Potential energy is negligible Again, there are two ports, so the SFEE becomes: Boilers Heat is transferred to the working fluid to the point of saturation, and the fluid evaporates. Boilers are isobaric, meaning there is no work done. Kinetic energy is negligible Potential energy is negligible There are two ports, so the SFEE reduces to: Pumps & Compressors Pumps and compressors are exactly the same thing: the only difference is that a pump refers to a liquid and a compressor refers to a gas (as liquids are generally incompressible). There is typically no heat transfer – the process is adiabatic There is a pressure change, so there is shaft work Kinetic energy and potential energy can sometimes be ignored, but not always When KE and PE are negligible, the SFEE reduces to: If KE and PE are not negligible (e.g. pumping water up a hill), the SFEE becomes: Where v is the specific volume. In this instance, specific work is given by vΔP, not PΔv. Turbines The opposite of a pump or compressor, the working fluid expands in a turbine to provide shaft work. Heat transfer is generally negligible There is a lot of output shaft work (h₁ > h₂, so W > 0) Kinetic energy is sometimes negligible, but often not Potential energy can usually be ignored Two ports, so the SFEE becomes: Heat Exchanger A heat exchanger (as its name suggests) transfers heat from one working fluid to another. This means that if we make the control volume the whole exchanger with four ports, there is no net heat transfer. Obviously, there is also no shaft work or change in kinetic and potential energy. Therefore: Using mass continuity equations for ports 1 & 2 and 3 & 4, we can simplify the SFEE even further to: However, if we make the control volume just one of the two fluids with a positive or negative heat transfer from the other fluid, there are two ports and there is a heat transfer: Where the heat transfer comes from the hot stream: Mixing Chamber A typical mixing chamber has two inflow ports and one outflow port, though there could be many more inflow ports. There is no net heat transfer between the control volume and its surroundings (there may be a heat transfer between the mixing fluids, but this is inside the boundaries so irrelevant) There is no shaft work KE and PE are both negligible The only remaining factors are enthalpy and flow rates: Using mass continuity, we know that: Mass & Volume Flow Rates The mass flow rate can be calculated from the velocity and density of the working fluid, and the size of the duct/pipe it is flowing through: ρ is the density of the working fluid C is the velocity A is the area of the duct/pipe From this, we can calculate the volume flow rate: Combining these, and using specific volume gives us the most useful form: The Rankine Cycle First put forward by William Rankine in 1859, the Rankine Cycle models the performance of steam turbine systems: 1. Cold liquid is pressurised in the pump 2. Pressurised liquid is heated in the boiler (isobaric process) and vaporises 3. Vapour expands in the turbine as temperature and pressure reduce; dryness fraction decreases from 1 to inside the vapour-dome 4. Wet vapour condenses at constant pressure to become a saturated liquid

  • The Bernoulli Equation

    In this notes sheet... The Bernoulli Equation Derivation of the Bernoulli Equation Conservation of Energy for Steady Flow The Pipe Flow Energy Equation The Bernoulli Equation Generally, the Bernoulli Equation is expressed between two points, 1 and 2: See the derivation of the Bernoulli Equation here. This applies to steady, inviscid flow with constant density, where the two point lie on the same streamline, or the Bernoulli constant of each is the same: We can use the Bernoulli equation to model the conservation of mechanical energy (when there is no friction). Stagnation Point Flow In an ideal situation, when inviscid, incompressible steady flow with uniform velocity and pressure hits a wall, the central streamline will not deflect but become stationary. This is known as the stagnation point. In this instance, the Bernoulli equation simplifies to: All the mechanical energy is in terms of pressure potential energy: the maximum possible pressure in a given flow (stagnation pressure). In reality, this does not occur, as close to the wall the fluid is acted upon by the viscous force. Conservation of Energy for Steady Flow The first law of thermodynamics is the conservation of energy in a system: We can substitute this into the Reynolds transport theorem, where η is the total energy per unit mass: And for steady flow, where the d/dt term disappears: Here, the work done by the pressure force is included in the work term on the left. This is not helpful to us, so we want to extract it. Therefore: The shaft work on the left does not include pressure work (this is in the integral on the right). For a simple control volume with one inlet and one outlet, the bernoulli equation becomes: The Pipe Flow Energy Equation This is a simple conservation of energy equation for adiabatic flow. This means that the Q term disappears - though there is still a small amount of heat lost through friction. Therefore, we take into account energy losses: The pipe flow energy equation thus becomes becomes: Often, it is more helpful to give values in terms of height – from this the pressure can easily be calculated. We call these ‘heads’, and so the lost work and pump work become lost head and pump head respectively: This only applies in steady, adiabatic, incompressible, uniform velocity flow between a single inlet and outlet As you can see then, it’s a pretty niche equation. The pipe flow energy equation is the adiabatic equivalent of the SFEE in thermodynamics but for incompressible fluids, not compressible gasses. Next: Internal Flows ▸

  • Hardness, Toughness, Creep & Fatigue

    Hardness The hardness of a material is its resistance to wear or indentation. It is generally measured using one of two types of indentation test. Brinell Hardness A 10 mm diameter steel sphere is pressed into the test material by a known force. This causes the sphere to leave a circular impression in the test material. The hardness is given by the following function of force, P, sphere diameter, D and impression diameter, d: Vickers Hardness Instead of a sphere, a diamond shaped stud is used to indent the test material. The hardness is then calculated as a function of the force, P, and the diagonal of the square indentation, d₁: Toughness Toughness is related to a material’s ability to resist sudden, brittle fracture under a load. It is defined as the amount of energy needed for a material to fracture. Therefore, its units are Joules, J. It is related to the area under a stress-strain curve, but is entirely separate to Young’s Modulus: For fracture to occur, a crack needs to initiate somewhere and then propagate through the material. Often, the crack will initiate at a stress concentration like a screw hole or a bend. Fracture could be brittle or ductile. Charpy Impact Test The Charpy impact test is used to measure the toughness of a material. A heavy pendulum hits a notched test specimen, right opposite the notch. The material fractures The loss of potential energy of the pendulum (mgh) is calculated The loss of potential energy of the pendulum is more or less equal to the energy required for the material to fracture, its toughness There are a number of issues with this test, for example that energy is lost as heat, sound, kinetic energy etc – not all the GPE is transferred into fracturing the specimen. Toughness and Temperature The energy required for a material to fracture depends hugely on temperature. Generally, materials have a lower and upper ‘shelf’ of toughness. The graph below shows how the toughness varies with temperature of different carbon-content steels. You can see that, generally, a higher carbon content increases the strength of steel, but decreases its toughness dramatically. This is especially notable at room temperature (roughly 20 °C): high strength steels (0.8% C) have incredibly low toughness. Creep Creep is the way a material experiences an increase in strain over time (it extends). Stress is constant throughout. At low temperatures, deformation of metals and ceramics is generally only dependent on stress, not time. At higher temperatures, this changes: The sensitivity of a material to creeping is approximated by the ratio of temperature divided by melting point. Generally: For polymers, creep is a problem when T > 20°C For metals, creep is a problem when T > (0.3-0.4) x Melting T For ceramics, creep is a problem when T > (0.4-0.5) x Melting T Creep Curves A creep curve is a graph of increasing strain as time goes on. Stress is assumed constant throughout: Generally, there are three creep phases between the elastic strain and fracture point: primary, steady-state and tertiary. The steady-state creep rate is vital for calculating safe service life if the service life is expected to be very long. For shorter lifespans, the rupture lifetime (time before fracture occurs) is more important. Creep Law The creep law describes the relationship between steady-state creep rate, stress, and temperature: A is a constant Q is the activation energy for creep R is the universal gas constant, 8.31 T is the temperature σ is the stress n is the creep exponent, also known as stress dependent When temperature is constant, this reduces to: Constants B and n can be found by plotting a logarithmic graph: When stress is constant, the creep law becomes: Plotting the natural logarithm of the creep rate and the reciprocal of the temperatures allows us to find C and -Q/R: Fatigue While stress is applied constantly in a creep scenario, in fatigue situations, the material experiences cyclical loading and unloading. Fatigue is such a serious issue, because fracture can occur at stress levels significantly below the yield stress. Fatigue stresses can be applied in many different ways. Three of the most common examples are: Fully reversed The average stress is zero. This is common in rotary shafts. Tension-compressed The mean stress is not zero Random There is no system or useful average. This is common in suspensions where random shocks are common. There are a number of important fatigue parameters: Fatigue Cracks Like any fatigue, the crack must first initiate somewhere and then propagate through the material. Once the remaining cross-section is no longer sufficient to carry the load, the material will experience a brittle fracture. This could take anything from just a few to millions of cycles. More often than not, the cracks initiate at stress concentrations, such as defects or design aspects (drill holes, sharp corners etc.). It is easy to identify fatigue failure, as it leaves a distinct pattern of smooth slow crack growth around the epicentre, and rough brittle fracture marks everywhere else. Fatigue Testing In a fatigue test, a sinusoidal stress is applied to a test specimen and the number of cycles before fracture are recorded. Each experiment gives one datapoint, and so many iterations have to be done. The results are then plotted on a scatter diagram: The above graph is typical for ferrous metals. As you can see, there is a fatigue limit: below this stress value, the specimen will not experience fatigue failure. Other materials have a curved fatigue test scatter. There is no clear limit, and so there is no fixed stress value below which fatigue failure will not occur. Instead, we need to define either stress or number of cycles and read off the other. Fatigue Safety Factors It is often important to calculate safety factors for fatigue strength or service life. For a given desired service life and stress amplitude (N₃, S₃), the safety factors are given as: Summary Hardness is a material’s resistance to wear or indentation The two hardness tests are Brinell and Vickers Toughness is the amount of energy required for a material to fracture The Charpy Impact test investigates hardness Toughness varies with temperature Creep is when a material experiences an increase ins train over time In low temperatures, creep depends only on stress In high temperatures, creep depends on stress, temperature, and time Fatigue failure occurs due to constant cyclical loading and unloading Fatigue cracks tend to initiate at a stress concentration and propagate through the material Ferrous metals have a fatigue limit – below this stress, fatigue failure will not occur

bottom of page