/*************************************************************** * adiabatic.h - header file for the ideal adiabatic simulation* * PROGRAMMER: E.Malroy and I.Urieli * * DATE: Sometime in 1996? * * LAST MODIFIED: by I.Urieli 02/02/97 * ***************************************************************/ #ifndef ADIABATIC #define ADIABATIC #define ROWV 22 /* The number of rows in the var matrix */ #define ROWD 16 /* The number of rows in the dvar matrix */ #define COL 37 /* number of columns in the var & dvar matrices */ /* indices of the y, dy, var, dvar matrices denoting the variables */ #define TC 0 /* compression space temperature (K) */ #define TE 1 /* expansion space temperature (K) */ #define QK 2 /* heat transferred to the cooler (J) */ #define QR 3 /* heat transferred to the regenerator (J) */ #define QH 4 /* heat transferred to the heater (J) */ #define WC 5 /* work done by the compression space (J) */ #define WE 6 /* work done by the expansion space (J) */ #define W 7 /* total work done (J) */ #define P 8 /* pressure (Pa) */ #define VC 9 /* compression space volume (cu. m) */ #define VE 10 /* expansion space volume (cu. m) */ #define MC 11 /* mass of gas in the compression space (kg) */ #define MK 12 /* mass of gas in the cooler (kg) */ #define MR 13 /* mass of gas in the regenerator (kg) */ #define MH 14 /* mass of gas in the heater (kg) */ #define ME 15 /* mass of gas in the expansion space (kg) */ #define TCK 16 /* conditional temperature comp.space/cooler (K) */ #define THE 17 /* conditional temperature heater/exp.space (K) */ #define GACK 18 /* conditional mass flow comp.space/cooler (kg/radian) */ #define GAKR 19 /* conditional mass flow cooler/regenerator (kg/radian) */ #define GARH 20 /* conditional mass flow regenerator/heater (kg/radian) */ #define GAHE 21 /* conditional mass flow heater/exp.space (kg/radian) */ /* FUNCTION PROTOTYPES */ /* functions invoked by adiabatic: */ void adiab(double var[][COL], /* variables matrix */ double dvar[][COL]); /* derivatives matrix */ void prntad(double var[][COL], /* variables matrix */ double dvar[][COL]);/* derivatives matrix */ /* functions invoked by adiab: */ void filmat(int i, double y[], /* variable vector */ double dy[], /* derivative vector */ double var[][COL], /* matrix of variables */ double dvar[][COL]); /* matrix of derivatives */ /* filmat: fill a row of var and dvar matrices (each cyclic step) */ void dadiab(double x, /* independent variable (crank angle) */ double y[], /* vector of dependent variables */ double dy[]); /* vector of dependent derivatives */ /* dadiab: Ideal Adiabatic model derivatives */ /* functions invoked by dadiab: */ void volume(double theta, /* crank angle */ double *ptr_vc, /* volume of compression space */ double *ptr_ve, /* volume of expansion space */ double *ptr_dvc, /* derivative of vol in comp. space */ double *ptr_dve); /* derivative of vol in exp. space */ /* functions invoked by volume: */ void sinevl(double theta, /* crank angle */ double *ptr_vc, /* volume of compression space */ double *ptr_ve, /* volume of expansion space */ double *ptr_dvc, /* derivative of vol in comp. space*/ double *ptr_dve); /* derivative of vol in exp. space */ void yokevl(double theta, /* crank angle */ double *ptr_vc, /* volume of compression space */ double *ptr_ve, /* volume of expansion space */ double *ptr_dvc, /* derivative of vol in comp. space*/ double *ptr_dve); /* derivative of vol in exp. space */ #endif