54 const double kappa = 1.4;
56 const double etac = pow(2.0/(kappa+1.0), kappa/(kappa-1.0));
65 const double Cd0 = 0.84;
66 const double Cd1 = 0.66;
70 Cd0 - Cd1*pow(p1/p0, 2.0) + (2*Cd1-Cd0)*pow(p1/p0, 3.0);
76 *(pow(p1/p0, 2.0/kappa) - pow(p1/p0, (kappa+1.0)/kappa))
79 return M_PI*pow(D, 2.0)*Cdg*Phi*sqrt(2.0*rho0*p0);
84 main (
int argc,
char *argv[])
86 const double D = 0.01;
95 const double deltat = 1e-3;
96 const double tend = 5.5;
98 double m0 = p0*V0/287.1/T;
99 double m1 = p1*V1/287.1/T;
103 while(t + deltat < tend + 1e-10)
109 double mdot =
flowRate(D, rho0, p0, p1);
115 double mdot =
flowRate(D, rho0, p1, p0);
124 cout <<
"t = " << t <<
" p0 = " << p0 <<
" p1 = " << p1 << endl;
int main(int argc, char *argv[])
Reads parameters. Creates struts and walls. Saves foam morphology to a file.