-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3_function1.cpp
39 lines (30 loc) · 912 Bytes
/
3_function1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* calculating the Reynolds number using a "void" function
written by Tariq Ridwan: 👉 https://tariqridwan.github.io/
Universitat Politècnica de Catalunya, Barcelona */
#include<iostream>
#include<string>
// #include<cmath>
using namespace std;
void Reynolds(double rho, double U, double mu, double D);
int main()
{
double U, rho, mu, D;
string write_intro;
write_intro = "Calculating Reynolds number\n";
cout << write_intro;
cout << "What is the velocity in (m/s)?" << endl;
cin >> U;
cout << "What is density in (kg/m3)?\n";
cin >> rho;
cout << "What is the dynamic viscosity?" << endl;
cin >> mu;
cout << "What is the characteristic length (m)?" << endl;
cin >> D;
cout << "So the Reynolds number is:" << endl;
Reynolds(rho,U,mu,D);
return 0;
}
void Reynolds(double rho, double U, double mu, double D)
{
cout << rho*U*D/mu << endl;
}