60 const double p2 = p0*p2Byp0;
61 const double kappa = 1.4;
63 const double etac = pow(2.0/(kappa+1.0), kappa/(kappa-1.0));
72 const double Cd0 = 0.84;
73 const double Cd1 = 0.66;
77 Cd0 - Cd1*pow(p1/p0, 2.0) + (2*Cd1-Cd0)*pow(p1/p0, 3.0);
83 *(pow(p1/p0, 2.0/kappa) - pow(p1/p0, (kappa+1.0)/kappa))
86 return M_PI*pow(D, 2.0)*Cdg*Phi*sqrt(2.0*rho0*p0);
91 main (
int argc,
char *argv[])
97 cerr <<
"Could not open in.txt!" << endl;
101 double D, rho0, p0, p1Byp0;
102 fi >> D >> rho0 >> p0 >> p1Byp0;
104 double mdot =
flowRate(D, rho0, p0, p1Byp0);
106 double p1 = p0*p1Byp0;
109 <<
" rho0 = " << rho0
111 <<
" p1/p0 = " << p1Byp0
113 <<
" mdot = " << mdot
int main(int argc, char *argv[])
Reads parameters. Creates struts and walls. Saves foam morphology to a file.