INTRODUCTION: You are an engineer working for a company that is developing a ven
ID: 3782014 • Letter: I
Question
INTRODUCTION: You are an engineer working for a company that is developing a venturi meter for a project. The venturi has specific dimensional requirements that were established by the client to measure discharge rate. See the illustration below Direction of flow Throat diameter in centimeters. Piper diameter Monometer liquid in centimeters. is Mercury ASSIGNMENT: rate of waterin cm sec through the venturi meter having a Write a C program that will compute the discharge The difference of the liquid height pipe diameter of d in centimeters, and a throat diameter of dein through the keyboard the in the monometer tube is h The program will allow the user to enter the initial diameter, the throat diameter, and the liquid height in the monometer. Once the user enters values, the program will compute the discharge rate The discharge rate equation is: 1960hExplanation / Answer
#include<stdio.h>
#include<math.h>
#define PI 3.1415
int main()
{
float pipe_diameter;
float throat_diameter;
float height;
printf("*************************************************** ");
printf(" WATER DISCHARGE RATE ");
printf("Enter pipe diameter in centimeters : ");
scanf("%f", &pipe_diameter);
printf("Enter throat diameter in centimeters : ");
scanf("%f", &throat_diameter);
printf("Enter liquid height in centimeters : ");
scanf("%f", &height);
float pipe_area = (PI*pipe_diameter*pipe_diameter)/4;
float throat_area = (PI*throat_diameter*throat_diameter)/4;
float ratio = pipe_area/throat_area;
float temp = (1960*height)/(ratio*ratio - 1);
float discharge_rate = 25*PI*(sqrt(temp));
printf("RESULTS ");
printf("Pipe diameter = %.1f cm ", pipe_diameter);
printf("Throat diameter = %.1f cm ", throat_diameter);
printf("Monometer liquid height = %.1f cm ", height);
printf("Discharge rate = %.2f cm^3/sec ", discharge_rate);
printf("*************************************************** ");
}
/* Sample run
$ gcc discharge.c -lm
$./a.out
***************************************************
WATER DISCHARGE RATE
Enter pipe diameter in centimeters : 50
Enter throat diameter in centimeters : 25
Enter liquid height in centimeters : 12
RESULTS
Pipe diameter = 50.0 cm
Throat diameter = 25.0 cm
Monometer liquid height = 12.0 cm
Discharge rate = 3109.93 cm^3/sec
***************************************************
*/
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.