/****************************************************************** * FUNCTION operat - determine operating parameters, * * do Schmidt analysis * * FILENAME operat.c * * PROGRAMMER I.Urieli (FORTRAN) * * E. Malroy (C Translation) * * DATE: 03/01/93 (FORTRAN), 02/26/96 (C Translation) * * LAST MODIFICATION: 12/24/97 by I.Urieli * * INCLUDE: , , "define.h" * * GLOBAL VARIABLES: * * FILE *infile - pointer to the input data file * * FILE *outfile - pointer to the output data file * * FILE *printfile - pointer to the print output file * * pmean: nominal mean operating pressure (Pa) * * omega: operating frequency (rads/sec) * * freq: operating frequency (herz) * * tk: cold sink temperature (K) * * th: hot source temperature (K) * * tr: effective regenerator temperature (K) * * SYMBOLIC CONSTANTS: PI 3.14159265359 * * PROTOTYPE: void operat(void); * * PRE: infile, outfile, printfile * * POST: pmean, tk, th, freq, tr, omega have been specified * * Schmidt analysis done, mgas determined. * ******************************************************************/ #include #include #include "define.h" void schmidt(void); /* Schmidt analysis, determine mgas */ void operat(void) { double dqwr; /* regenerator wall heat leakage(Watts) */ printf("\n enter mean pres(Pa), tk, th(K), freq(Hz)\n"); fscanf(infile, "%lf %lf %lf %lf", &pmean,&tk,&th,&freq); fprintf(outfile," %e %.1f %.1f %.1f\n", pmean,tk,th,freq); fprintf(printfile," mean pres(Pa), tk, th(K), freq(Hz):\n"); fprintf(printfile," %e %.1f %.1f %.1f\n", pmean,tk,th,freq); tr = (th - tk)/log(th/tk); printf("effective regenerator temperature (K): %.1f\n",tr); fprintf(printfile,"effective regenerator temperature (K): %.1f\n",tr); omega = 2.0*PI*freq; schmidt(); /* ***regenerator wall heat loss */ dqwr = cqwr*(th - tk); printf(" regen. wall heat leakage(Watts) %.1f\n", dqwr); fprintf(printfile," regen. wall heat leakage(Watts) %.1f\n", dqwr); } /****************************************************************** * FUNCTION schmidt - evaluate total mas of working gas (mgas), * * Schmidt analysis of the system * * FILENAME operat.c * * PROGRAMMER I.Urieli (FORTRAN) * * E. Malroy (C Translation) * * DATE: 03/01/93 (FORTRAN), 02/26/96 (C Translation) * * LAST MODIFICATION: 12/24/97 by I.Urieli * * INCLUDE: , , "define.h" * * GLOBAL VARIABLES: * * FILE *printfile - pointer to the print output file * * vclc: compression clearance volume (cu.m) * * vcle: expansion clearance volume (cu.m) * * vswc: compression swept volume (cu.m) * * vswe: expansion swept volume (cu.m) * * alpha: expansion space phase angle advance (radians) * * vk: cooler void volume (cu.m) * * vr: regenerator void volume (cu.m) * * vh: heater void volume (cu.m) * * rgas: gas constant (Joules/kg.K) * * pmean: nominal mean operating pressure (Pa) * * freq: operating frequency (herz) * * tk: cold sink operating temperatures * * th: hot sink operating temperatures * * tr: effective regenerator temperature (K) * * mgas: mass of working gas in the system (kg) * * SYMBOLIC CONSTANTS: PI 3.14159265359 * * PROTOTYPE: void schmidt(void); * * PRE: vswc, vswe, vclc, vcle, alpha (engine volumes, phase) * * vk, vr, vh (heat exchanger void volumes) * * rgas (working gas constant) * * tk, tr, th, pmean, freq (operational parameters) * * POST: mgas has been determined * * Schmidt analysis results have been output * ******************************************************************/ void schmidt(void) { double c, s, b, sqrtb, bf, beta, /* Schmidt analysis parameters */ w, wc, we, /* work done (Joules/cycle) total, comp, exp */ power, eff; /* power (Watts), thermal efficiency */ c = sqrt(pow((vswe/th),2.0) + pow((vswc/tk),2.0) + 2.0*(vswe/th)*(vswc/tk)*cos(alpha))/2.0; s = (vswc/2.0 + vclc + vk)/tk + vr/tr + (vswe/2.0 + vcle + vh)/th; b = c/s; sqrtb = sqrt(1.0 - b*b); bf = (1.0 - 1.0/sqrtb); beta = atan(vswe*sin(alpha)/th/ (vswe*cos(alpha)/th + vswc/tk)); /***total mass of working gas in machine */ mgas = pmean*s*sqrtb/rgas; printf(" Total mass of gas (gm) %.3f",mgas*1.0e3); fprintf(printfile," Total mass of gas (gm) %.3f",mgas*1.0e3); /***work output */ wc = PI*vswc*mgas*rgas*sin(beta)*bf/c; we = PI*vswe*mgas*rgas*sin(beta - alpha)*bf/c; w = wc + we; power = w*freq; eff = w/we; printf("\n Schmidt analysis\n"); printf(" Work(joules) %.1f, Power(watts) %.1f\n", w,power); printf(" Qexp(joules) %.1f, Qcom(joules) %.1f\n", we,wc); printf(" indicated efficiency %.3f\n", eff); fprintf(printfile,"\nSchmidt analysis\n"); fprintf(printfile," Work(joules) %.1f, Power(watts) %.1f\n", w,power); fprintf(printfile," Qexp(joules) %.1f, Qcom(joules) %.1f\n", we,wc); fprintf(printfile," indicated efficiency %.3f\n", eff); }