Browse Source

save the change

master
Weiye Wang 2 years ago
parent
commit
38abb36cb6
3 changed files with 8 additions and 12 deletions
  1. +1
    -1
      UserData.cpp
  2. +2
    -2
      macros.h
  3. +5
    -9
      residue.cpp

+ 1
- 1
UserData.cpp View File

@@ -354,7 +354,7 @@ UserData allocateUserData(FILE *input){
//data->ratesOutput=fopen("rates.dat","w");
data->innerMassFractions = new double [data->nsp];
data->HRRdata = new double [data->npts] ;
data->HRRdata = new double [data->npts];
return(data);
}



+ 2
- 2
macros.h View File

@@ -21,9 +21,9 @@
#define Y(i,k) ydata[((i-1)*data->nvar)+data->ny+k-1]
#define R(i) ydata[((i-1)*data->nvar)+data->nr]
#define P(i) ydata[((i-1)*data->nvar)+data->np]
#define HRRdata(i) HRRdata[i-1]
#define HRRdata(i) data->HRRdata[i-1]
#define Hf(i) Hf[i-1]
#define heatRR(i) heatRR[i-1]
//#define heatRR(i) heatRR[i-1]

#define Tdot(i) ydotdata[((i-1)*data->nvar)+data->nt]
#define Ydot(i,k) ydotdata[((i-1)*data->nvar)+data->ny+k-1]


+ 5
- 9
residue.cpp View File

@@ -746,7 +746,7 @@ int residue(double t,
//double Tsp=298.0;
double HRR = 0 ;
double Hf[nsp];
double heatRR[npts];
//double heatRR[npts];

//double Hf = 0 ;

@@ -762,7 +762,7 @@ int residue(double t,

/*Initialize the HRR data*/
for (j=1; j<= npts ; j++) {
heatRR(j) = 0 ;
HRRdata(j) = 0 ;
}

// /*evaluate properties at j=1*************************/
@@ -908,7 +908,7 @@ int residue(double t,
for(size_t k = 1; k <= nsp; k++) {
Hf(k) = data->gas->Hf298SS(k-1);
HRR = - wdot(k) * Hf(k) ;
heatRR(j) = HRR + heatRR(j);
HRRdata(j) = HRR + HRRdata(j);
}

// //energy formulation:
@@ -1035,11 +1035,7 @@ int residue(double t,
// //Tres(j)=Tdot(j);
//}

/**/
for (j=1 ; j<=npts ; j++) {
HRRdata(j) = heatRR(j) ;
}

return(0);

}
@@ -1084,7 +1080,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,"%15.6e\t",data->HRRdata[i]);
fprintf(output, "\n");
}
fprintf(output, "\n\n");


Loading…
Cancel
Save