61 const double p2 = p0*p2Byp0;
62 const double kappa = 1.4;
64 const double etac = pow(2.0/(kappa+1.0), kappa/(kappa-1.0));
73 const double Cd0 = 0.84;
74 const double Cd1 = 0.66;
78 Cd0 - Cd1*pow(p1/p0, 2.0) + (2*Cd1-Cd0)*pow(p1/p0, 3.0);
84 *(pow(p1/p0, 2.0/kappa) - pow(p1/p0, (kappa+1.0)/kappa))
87 return M_PI*pow(D, 2.0)*Cdg*Phi*sqrt(2.0*rho0*p0);
92 main (
int argc,
char *argv[])
98 cerr <<
"Could not open in.txt!" << endl;
102 double D, rho0, p0, p1Byp0;
103 fi >> D >> rho0 >> p0 >> p1Byp0;
105 double mdot =
flowRate(D, rho0, p0, p1Byp0);
107 double p1 = p0*p1Byp0;
110 <<
" rho0 = " << rho0
112 <<
" p1/p0 = " << p1Byp0
114 <<
" mdot = " << mdot
int main(int argc, char *argv[])
Reads parameters. Creates struts and walls. Saves foam morphology to a file.