Solve a fluid mechanics problem using your C++ programming skills.
Program Description:
|
Pipe friction factor, f, the fluid velocity in the pipe, V, and the “head” difference, h, which is indicative of pressure difference or drop between upstream and downstream sections in the pipe can be calculated. (See the figure below.) Using C++ write a program to solve these fluid mechanic problems.
Formulas:
A. Pipe friction factor, valid for Re>2000
B. Velocity (For this project, we assume the fluid is H20.)
C. Head difference (drop)
Where:
f pipe friction factor
E pipe surface roughness
D diameter of the pipe
Re Reynolds number
V velocity of the fluid
h head (pressure) drop
L length of the pipe
g gravitation constant= 9.81
Notes:
The data file is on Angel called fluid.txt. It is an EOF data type.
Each formula will be its own function.
All variables will be meaningful and related to the data variable names.
Do not worry about unit measurements; this has been taken care of for you.
All of your results will be sent to an output file called fluidout.txt. See the example below on how to format the output.
Both input and output files need to be located in P:\\Private directory. If not, the program will be marked as not running.
When calculating the pipe friction factor (f), start f at .02. Continue to calculate until the |fnew-fstart| <= .001.
I recommend you start this project early and not the day before it is due.
“Your lack of planning does not constitute an emergency for me.” ~ Anonymous
Data file:
EOF Data file with the data in the following order:
Re D L E
Output Example:
= = = = = = = = = = = = = = = = = = = == = = = = = = = = = = = = = = = = = = =
For record 1:
Input:
Pipe surface roughness: .12 x 10e-3
Diameter of the pipe: 0.01
Reynolds number: 2000
Length of pipe: .1
Results:
Pipe friction factor: 0.054947
Velocity of the fluid: 0.26
Head drop: 0.018932
= = = = = = = = = = = = = = = = = = = == = = = = = = = = = = = = = = = = = = =
Once again, do not worry about units.
Do format decimal values to a reasonable amount.
Do output which record you are on.
The above data is only a sample, it may not be accurate.
What are you turning in?
- A printout of your original source code
- A printout of your output file. Remember: I will be testing your program with different data. Make sure it works for all situations!
- Log into Angel and locate the Project drop box. Upload your project’s .cpp file that you created. Make sure this file is named correctly. Points will be deducted if your Penn State ID is not part of the name.
If you neglect to either upload your file or turn in your hard copy, your project will not be graded and you will get a zero for the assignment. I assume you are all adults and I do not have to track you down for both parts of this assignment.
Graded on:
~~This project is worth 15% of the 25% allotted for projects this semester.
- Good programming
- Neat & readable code
- Comments
- Data file manipulation
- Functions
- Function Header comments
- Calculations
- Meaningful variables & constants
- Input – prompting & use
- Output – both results & format
- -10 points if you fail to name the cpp file correctly
- 0 on the project if you fail to upload the file or turn in the hard copy
DATA File
10e4 .020 7.5 .24e-4
9e5 .016 6 .37e-3
12e4 .015 5.5 .68e-3
8.2e5 .017 3 .51e-3
2.4e4 .005 2.4 .82e-4
11 years ago
100
Purchase the answer to view it

- archive.zip
- 6. Explain the difference between a hazmat employer and a hazmat employee, giving pertinent examples of each in your response.
- TinselWriter
- BABER MAKAYLA ONLY
- A 15.0 ohm resistor is connected in series to a 120 volt generator and two 10.0 ohm resistors that are...
- PHYLLIS YOUNG
- howwork
- COM 480 Week 1 DQ 2 ( Post your Blog URL ) <<< 2 Answers To The Discussion For Price Of One - A Graded Tutorial >>>
- quantum chemistry
- Can you assist Business research
- BAM 402_Exam_Public Relations_Solution