# Can Someone Write My fluid mechanics using matlab Flawlessly?

Get In Touch With Our PhD Writers At matlabassignmentexperts.com For Excellence

## Fluid mechanics, Bernoulli’s approach, Hardy Cross & Monte Carlo methods

In this Matlab sample solution, the expert has demonstrated his capabilities to solve problems on topic fluid mechanics. The solution has been provided using Matlab. The given problem showcases an application of concepts like Bernoulli approach, the minimum pressure in vena contracta, Cavitation, Hardy cross method, and Monte Carlo method, etc.

## Fluid mechanics

Before we go ahead and define what fluid mechanics is, let’s understand what a fluid is. A Fluid as you probably know means a liquid. But in physics, it has a different meaning. It is defined as any substance that changes its shape when some external forces are applied to it. They include liquids and gases. Fluids are said to have shear modulus, which is a physical term that implies zero resistance to any force applied to it. Fluids and solids are all states of matter. Therefore fluids are substances that can flow and do not resist any change to its shape.
Fluid mechanics
Fluid mechanics is a branch of physics that focuses on fluids, i.e., liquid, air, and plasma.
This branch of physics has lots of applications in many disciplines, which is not restricted only to real-life scenarios. The engineers are also interested in fluid mechanics because they can use the forces used in fluids for other meaningful purposes. Meteorologists also study fluid mechanics as it can help them in forecasting the weather patterns of a place. Let’s not forget that physicists study fluid mechanics to discover the movement of particles through magnetic fields, which help them in search of an acceptable means of harnessing energy for nuclear fusions.
Fluid mechanics has lots of applications that make it an important topic in most engineering fields. Here we will show you some of the practical applications of fluid mechanics.

### Branches of fluid mechanics

Fluid mechanics is further subdivided into two branches which are:-
Fluid Statics -Fluid statics involves studying fluids which are at rest. It carries out a study of fluids that are in an equilibrium state. Fluid statistics has specific applications in real life. It can be used to explain the real-life phenomena such as the changes in atmospheric pressure with changes in altitude or why a block of wood floats in water while a stone cannot. It also finds its way in astrophysics, geophysics, and meteorology.
Fluid dynamics- Fluid dynamics is in contrast to fluid statistics. It studies the fluids in motion. The various empirical laws have been developed to tackle the different fluid movement problems. Sometimes, determining the properties of a fluid such as viscosity and density could be the solutions. Fluid dynamics can be subdivided further into aerodynamics and hydrodynamics—the latter deals with the movement of liquids while the former with the movement of gases. Fluid dynamics has wide-ranging applications, which include traffic engineering, predicting weather patterns, and aircraft movements.

### History of fluid mechanics in a nutshell

The origin of fluid mechanics can not be traced specifically to any point in time. But it is said to be used in the ancient civilizations that flourished in Egypt and Babylon. The Egyptians used hydraulic pressure to water their fields, which were situated close to the river beds. As civilizations developed, scientists like Archimedes contributed to it by coming up with the Archimedes principle. Other great scientists, such as Blaise Pascal and Isaac Newton, contributed to the formulation of current laws that we study today.

### Fluid mechanic’s common terms, and governing laws.

If you are studying fluid mechanics, there are some of the terms and governing laws that you will encounter from time to time. They form the basis of this topic. Some of these terms include: –
Viscosity. This is a term that implies the resistance of a fluid to deformation. It could also be defined as the inability of fluid to refuse to flow. A fluid with high viscosity is said to be very dense which could achieve the shape of a solid. High viscosity always happens in low temperatures. A fluid with low viscosity is known as an ideal fluid.
Surface tension. It is a phenomenon that is commonly seen on the surface of liquids. Mostly, these surfaces shrink together to occupy a minimum surface area. In water, this surface allows for other insets to float on water. Surface tension can be explained in terms of cohesive forces. In a liquid, all the molecules are attracted to each other by cohesive forces. But the issue is different at the surface as all the molecules do not have other molecules to hold them at the top. As a result, they shrink inwards.
According to this explanation, we can say that surface tension also affects the shape of droplets.
Archimedes principle. Archimedes principle is named after an ancient Greek named Archimedes who discovered it. It states that a body that is submerged in water is rested upon by an equal force even if it’s fully or partially submerged. It’s also known as the law of buoyancy, and one of its common applications is in ships. A ship floats on the sea once its weight is equal to the one it displaces in water.
Pascal’s law. This is a law about the transmission of pressure in a fluid. It states that in a confined and incompressible fluid, a pressure change on one side will lead to an equal transmission of the fluid on another part of the confined area. This law is very important and has its applications in real life.
Bernoulli’s principle. This is a law that was proposed by Daniel Bernoulli in 1738. It states that as the flow of the liquid increases, the pressure in the liquid decreases.

## Applications of fluid mechanics.

The real-life applications of the topic are numerous. Some of its uses are listed as follows: –
Hydroelectric power. Here, fluid mechanics is applied to determine the power capabilities of a certain area.
Housing. Fluid mechanics is responsible for the distribution of water in cities and towns. It can be used to calculate the amount of water that is needed in these cities. We can even know their monthly water consumption.
Biology. In biology, we can apply fluid mechanics to know the rate at which blood flows in the veins.
Pumps. Pumps are devices that are made for fluid movements. No matter what pump you are using, they apply the fluid mechanic's laws, such as Bernoulli’s principle and Pascal’s law.
Wind power
Aerodynamics

## Fluid mechanics using Matlab

Matlab is one of the finest mathematical computing software that exits in the world. It was built to help engineers and scientists in their research assignments. Matlab was developed during the internet age in the 1980s, but its use has grown exponentially since that time. Today, most institutions have incorporated it into their curriculum, while most science and engineering practitioners prefer to use Matlab. It’s therefore, a widely accepted programing language.
For fluid mechanics, Matlab has the CFD toolbox, which is an app for all computational fluid dynamics problems. With it, you can model fluid dynamics, simulate it, and use it for predictions. In other cases, you could use the symbolic math toolbox for calculations involving fluid mechanics.

## Matlab assignment experts

If you want help with fluid mechanics using Matlab, then you can contact us. We are highly trained Matlab professionals with years of experience doing Matlab related assignments. We have been serving our clients for close to a decade and are still providing them with consistent results. We put the priorities of our clients first and ensure that we meet the deadlines and help them secure high grades.
You, too, can benefit from our top-notch services if you contact us. You won’t be disappointed with our services. Instead, you will join the cohort of numerous clients who are pleased with our services.
SOLUTION: –
Task 1.1: Use Bernoulli and textbook approach to estimate minimum pressure in vena contra(i.e. location in a fluid flow where the diameter of the flow is the smallest). If needed, review section 6.9 in the textbook by White to learn more about the vena contra. Assume that at the narrowest location effectively defective /D ~ 0.23 due to vena contra.
Solution:
• Explain/sketch geometry.
• Recall Bernoulli equation – see sketch below
• With p1 given in the assignment, estimated minimum pressure
• assuming 20C water, what are cavitation numbers based on both upstream and vena contra pressures. – leave the further discussion on if this might cavitate to task 1.3
Task 1.2: Evaluate the CFD results provided to you. Determine the margin to the onset of cavitation. If you are choosing your own case of interest, you will need to perform computations with a CFD software that you have available.
For this task, plot contours of pressure and identify and label minima. Plot velocity vectors, streamlines, and vorticity contours. Calculate the mass flow rate in and out as a check.
Take great care to not blindly trust the results. CFD is an indispensable tool for modern engineers, but the case you are working on highlights the need for critical thinking and proper problem setup, and the sample data provided will be imperfect on purpose.
Solution:
• Plot
velocity vectors,
streamlines and
vorticity contours
Calculate the mass flow rate in and out as a check.
• assuming 20C water, what are cavitation numbers based on both upstream and vena contra pressures. – leave the further discussion on if this might cavitate to task 1.3
For example, here is a streamline plot. Your plots should be formatted to be easier to read with proper labels, etc. Note for example that in this plot axis labels are too small to even read.
Task 1.3: Consider the limitations of both theory and numerical model used. Also, reviewing the literature, explore the effect of fluid temperature and nuclei contents to point where incipient cavitation may be expected to occur. Discuss how such cavitation could be detected, qualitatively observed, quantified, and what impact it may have in pipeline performance overall.
Explain what assumptions may be faulty and what physical phenomena are or are not accounted for that may lead to differences in the results of the inviscid theory, CFD vs. experiment.
Solution:
• Discuss/list how both Bernoulli and the time-averaged axisymmetric CFD were idealizations and may have been limited
• Based on cavitation numbers from tasks 1.1 and 1.2, do you think cavitation might occur?
• How does this conclusion match with data from Testud et al. (2007)?
Task 1.4: What measurement techniques discussed in the course could you use to observe the flow in this case, and succinctly discuss what would limit their suitability for the case in question.
Solution:
List or make a table of suitable techniques and why they are useful, and up to what point. At least 5 should be easy to recall and discuss. See slides¬es from days 3&4 to recall techniques discussed.
Technique                                                                         Why                                                                     Limitation
Part 2
Set Q at all outlets, some of them must equal our single inlet.
Calc pump power assuming lowest pressure node at 300kPa absolute, (note all up in solution are relative and since we treat fluid as incompressible absolute pressure within HC solution can be adjusted afterward if needed – pressure differences are still what the solution yield), the reservoir at 100kPa (1 atm absolute).
Task 2.1: Write your own code using the Hardy-Cross method to calculate pressure distribution in the sample pipe network. (Contact SSA for sample Hardy-Cross – at which time SSA will want to schedule a virtual meeting with you to discuss through the example. Also, another similar sample will be discussed by Gabriel.) Use the Haaland explicit approximation to compute you the friction factor – just like we did in class!(Make code flexible and see steps below to enable evaluation of temperature etc. effects.) Compute the power required to pump water through the \textbf{ideal} network at given flow rates.
Solution:
• Setup Hardy-Cross solution for pipe network – start either from sample code SSA will provide and discuss with you, or from example, Gabriel will discuss
• Use equations covered in class to estimate pumping power
• Optional: assume something for pump efficiency and discuss succinctly
Task 2.2: Use your code and Monte-Carlo method for propagating uncertainty (section $\text{???}$$\ref{section:MC}$) and consider i) uncertainty in pipe roughness (see the table in handout), ii) uncertainty in pipe length, ii) uncertainty in temperature and iv) uncertainty in pipe diameter. To estimate uncertainty in roughness, use data from White table 6.5. (Consider, for example, if water temperature goes from 5C to 30C, what effect will this have?)
Solution:
• Modify code to loop over HC calculation and run MC for at least 100,000 cases – more if histogram looks ‘rough’. Plot histogram of needed pumping power – just like we did during Day 5 for White example 6.16
Task 2.3: Within each pipe, calculate viscous length scale (SSA will provide example upon request), wall shear stress and estimate if a superhydrophobic coating with a damage threshold of 50 Pa of shear and manufacturable with RMS roughness from 5 to 200 microns might result in drag reduction in each pipe segment (Requires having roughness below ~5 viscous length scales. For simplicity: assume that there would be a way to avoid entrainment of gas from the surface into the flow and a way to supply gas to the surface at pipeline pressure. – not necessarily achievable presently).
Solution:
• For each pipe, knowing diameter and average flow rate, calculate viscous length scale
• How smooth is the pipe compared to the viscous length scale (epsilon over length scale, if<5 smooth, if >70 fully rough and in-between transitional – see White’s book)?
• Calculate shear in each pipe (average at the wall)
• Discuss if SHS may survive given damage threshold
Bonus task 2.1: add the cost of components and energy to try to improve your pipe network. Explain the cost basis you selected and your results.
Solution:
• Assume a cost for pipes with smoother and more durable (e.g. stainless) being a higher price. Compare energy cost vs. initial cost for different options you chose.