###### Search Results

75 results 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

• 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 fluids, but there are 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 modelled as compressive and normal to the surface Viscous – these are 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 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 continuum assumption above) 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: 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 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 types of flow we have defined here, and a few more to be aware of: Steady flow moves at a constant rate Unsteady flow moves at a rate that varies with time Viscous flow has non-zero viscosity Inviscid flow has very small/no viscosity Incompressible flow has constant density (liquids) Compressible flow has density that varies significantly with pressure (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

• Energy, Heat & Work

• 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 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 into a function involving 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 the 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 using hydrostatics: 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

• Properties of Substances

• 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, mass, energy, momentum etc. 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 R equal to m, meaning that η equals: 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. E.g. 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 become 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:

• Material Properties and Engineering vs True Stress & Strain