Question

can someone write a basic c program for this problem?

ENGR 200 SPRING, 2019 Al: Computing Mass Flow Rate, Volume Flow Rate, and Average Velocity in Pipe Branches (basic program development) DUE: Jan. 22, 2019 at 11:59 pm, CST, (Mon/Wed section) Jan. 22, 2019 at 11:59 pm, CST, (Tues & Distance sections) POINTS: 35 INTRODUCTION: A water piping system has a T-fitting that splits the flow into two flows. See the illustration below. Water enters the main pipe at a volume flow rate of Vgpm-350 gal/min. The flow will split into branch one with diameter Dı, and into branch two with diameter D2. The average velocity of the water in branch two is Vz 3 m/s Discharge 1 Branch 1 Diameter Main Diameter Discharge2 Branch 2 Diameter The governing equations are A,-- (Computes cross-sectional area of branch 1, m2) 4 TTD A2 -2 (Computes cross-sectional area of branch 2, m2) 4 * (Converts main pipe gal/min to m3/s) cmps gpm 264.17 60 V2- A2V V1-Vemps -V2 (Computes volume flow in branch 1, m3/s) m1-ρνι (Computes mass flow in branch i, kg/s) m2pV Computes mass flow in branch 2, kg/s) (Computes volume flow in branch 2, m%) V. (Computes velocity in branch 1, m/s)

ASSIGNMENT: Write a C program that will compute the mass flow rate and the volume flow rate in each pipe branch, and the average velocity in pipe branch 1. The program will prompt the user to enter the main pipe volume flow rate, the diameter of branch 1, the diameter of branch 2, and the average velocity of branch 2. The program must define π and pas symbolic constants in the preprocessor direction section. For π use 3.14159 and for ρ use 1000. To test the program, use 7 cm for branch 2 diameter and 4 cm for branch 1 diameter The output format is shown below. Use your PCs cursor to determine the horizontal and vertical spacing for the output OUTPUT FORMAT: オオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオ SPLIT PIPE COMPUTATIONS Enter main volume flow rate in gal/min: x Enter diameter of branch 1 in cm Enter diameter of branch 2 in cm Enter velocity of branch 2 in m/s: RESULTS Main volume flow rate Main volume flow rate Branch 1 diameter Branch 2 diameter Branch 1 area Branch 2 area Branch 1 volume flow ratexxxxx cubic m/s Branch 2 volume flow rate -xxxXx cubic m/s Branch 1 mass flow rate = XX..※ kg/s Branch 2 mass flow rate = XX.XX kg/s Branch 1 average velocity - .xx m/s Branch 2 ave rage velocity-X, XX, m/s = XXXaK gal/min xxxxx cubic m/s X. XXXXX sg meters XvXXXXX.5Я meters オオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオオ

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

#include <stdio.h>
int main()
{
double D1,D2,V1,V2,v1,v2,pi=3.14159,p=1000,A1,A2,Vgpm,Vcmps,m1,m2;
printf("Enter the main volume flow rate in gal/min: ");
scanf("%lf",&Vgpm);
printf("Enter diameter of branch 1 in cm: ");
scanf("%lf",&D1);
printf("Enter diameter of branch 2 in cm: ");
scanf("%lf",&D2);
printf("Enter velocity of branch 2 in m/s: ");
scanf("%lf",&v2);
D1=D1/100.0;
D2=D2/100.0;
Vcmps=Vgpm/(264.17*60.0);
A1=pi*D1*D1/4.0;
A2=pi*D2*D2/4.0;
V2=A2*v2;
V1=Vcmps-V2;
m1=p*V1;
m2=p*V2;
v1=V1/A1;

printf("Main volume flow rate = %.1f gal/min ",Vgpm);
printf("Main volume flow rate = %.5f cubic m/s ",Vcmps);
printf("Branch 1 diameter = %.1f cm ",D1*100.0);
printf("Branch 2 diameter = %.1f cm ",D2*100.0);
printf("Branch 1 area = %.5f sq meters ",A1);
printf("Branch 2 area = %.5f sq meters ",A2);

printf("Branch 1 volume flow rate = %.5f cubic m/s ",V1);
printf("Branch 2 volume flow rate = %.5f cubic m/s ",V2);

printf("Branch 1 mass flow rate = %.2f kg/s ",m1);
printf("Branch 2 mass flow rate = %.2f kg/s ",m2);

printf("Branch 1 average velocity = %.2f m/s ",v1);
printf("Branch 2 average velocity = %.2f m/s ",v2);

}

FAchecki main.exe Enter the main volume flow rate in gal/min: 35e Enter diameter of branch 1 in cm: 4 Enter diameter of branch 2 in cm: 7 Enter velocity of branch 2 in m/s: 3 Main volume flow rate350.e gal/min Main volume flow rate-8.82288 cubic m/s Branch 1 diameter 4.0 cm Branch 2 diameter = 7.8 cm Branch 1 area8.e8126 sq meters Branch 2 area.88385 sq meters Branch 1 volume flow rate - 8.81854 cubic m/s Branch 2 volume flow rate - 0.01155 cubic m/s Branch 1 mass flow rate = 18.54 kg/s Branch 2 mass flow rate 11.55 kg/s Branch 1 average velocity 8.38 m/s Branch 2 average velocity = 3.00 m/s Process returned 38 (ex26 execution time 4.286s Press any key to continue ENG 3:16 AM O Type here to search

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
can someone write a basic c program for this problem? ENGR 200 SPRING, 2019 Al: Computing...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT