|
|
@@ -741,6 +741,11 @@ int residue(double t, |
|
|
|
double cendfm, cendfc, cendfp; |
|
|
|
/*Aliases for various grid spacings:*/ |
|
|
|
double dpsip, dpsiav, dpsipm, dpsim, dpsimm; |
|
|
|
/*define the heat release rate related parameters*/ |
|
|
|
double Tsp=298.0; |
|
|
|
double HRR = 0 ; |
|
|
|
double Hf = 0 ; |
|
|
|
|
|
|
|
dpsip=dpsiav=dpsipm=dpsim=dpsimm=ONE; |
|
|
|
double mass, mdotIn; |
|
|
|
double sum, sum1, sum2, sum3; |
|
|
@@ -751,6 +756,11 @@ int residue(double t, |
|
|
|
mass=data->mass; //Units: kg |
|
|
|
mdotIn=data->mdot*calc_area(R(npts),&m); //Units: kg/s |
|
|
|
|
|
|
|
/*Initialize the HRR data*/ |
|
|
|
for (j=1; j<= npts ; j++) { |
|
|
|
HRRdata(j) = 0 ; |
|
|
|
} |
|
|
|
|
|
|
|
// /*evaluate properties at j=1*************************/ |
|
|
|
setGas(data,ydata,1); |
|
|
|
rhom=data->gas->density(); |
|
|
@@ -888,6 +898,14 @@ int residue(double t, |
|
|
|
+advTerm |
|
|
|
-diffTerm |
|
|
|
+srcTerm; |
|
|
|
|
|
|
|
|
|
|
|
/*Calculate the Heat Release Rate */ |
|
|
|
for (k = 1; k <=nsp; k++) { |
|
|
|
Hf = enthalpy(k) - Cp(k) * (T(j)-Tsp) ; |
|
|
|
HRR = wdot(k) * Hf ; |
|
|
|
HRRdata(j) = HRR ; |
|
|
|
} |
|
|
|
|
|
|
|
// //energy formulation: |
|
|
|
// tranTerm = Tdot(j); |
|
|
@@ -1030,7 +1048,9 @@ void printSpaceTimeHeader(UserData data) |
|
|
|
for (size_t k = 1; k <=data->nsp; k++) { |
|
|
|
fprintf((data->output), "%15s\t",data->gas->speciesName(k-1).c_str()); |
|
|
|
} |
|
|
|
fprintf((data->output), "%15s\t","HRR()"); |
|
|
|
fprintf((data->output), "%15s\n","Pressure(Pa)"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void printSpaceTimeOutput(double t, N_Vector* y, FILE* output, UserData data) |
|
|
@@ -1055,6 +1075,7 @@ void printSpaceTimeOutput(double t, N_Vector* y, FILE* output, UserData data) |
|
|
|
for (size_t j = 0; j < data->nvar; j++) { |
|
|
|
fprintf(output, "%15.9e\t",ydata[j+i*data->nvar]); |
|
|
|
} |
|
|
|
fprintf(output,"%15.6e\t",HRRdata(i+1)); |
|
|
|
fprintf(output, "\n"); |
|
|
|
} |
|
|
|
fprintf(output, "\n\n"); |
|
|
|