You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to calculate the entropy production by the progress of each reaction in PeleC. In order to do so I need the forward progress rates. I am using progressRateFR from mechanism.H. My first check is to use progressRateFR and the reaction data from CKINU to verify I get the same rate of production of each species as CKWYR. However, the two routines give very different answers for the production rate of species. I've taken a look, and I do not see any reason that they should be different- is there something I am missing?
Here is what I am using to get the data, at the end prod_rate and prod_rate2 are not the same in value or in trend.
Thank you for your help.
amrex::Real prod_rate[NUM_SPECIES] = {0.0};
amrex::Real prod_rate2[NUM_SPECIES] = {0.0};
// Get rate of production of each species
CKWYR(dat(i,j,k,URHO), tc[1], massfrac, prod_rate);
// Set up reaction data
amrex::Real species_concentration[NUM_SPECIES] = {0.0};
amrex::Real q_f[NUM_REACTIONS] = {0.0};
amrex::Real q_r[NUM_REACTIONS] = {0.0};
amrex::Real wdot[NUM_REACTIONS] = {0.0};
amrex::Real rho = dat(i, j, k, 0);
int nspec = 0;
int& nspecr = nspec;
int* temp;
int* temp2;
// Get maximum species per reaction
CKINU(0, nspecr, temp, temp2);
// Define new variables correctly
int ki[nspec] = {0};
int nu[nspec] = {0};
int* kip = ki;
int* nup = nu;
// get concentration in SI units
for (int i = 0; i < NUM_SPECIES; i++) {
species_concentration[i] =1e6* rho * massfrac[i] * imw[i];
}
// Get reaction progress rates
progressRateFR(q_f, q_r, species_concentration, tc[1]);
// Assemble prod_rate2 out of q_f, q_r, and CKINU data
for (int n = 1; n < NUM_REACTIONS+1; n++) {
CKINU(n, nspecr, kip, nup);
for (int m = 0; m < nspec; m++){
prod_rate2(ki[m]-1) += 1e-6*(q_f[n-1] - q_r[n-1]) * nu[m];
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to calculate the entropy production by the progress of each reaction in PeleC. In order to do so I need the forward progress rates. I am using progressRateFR from mechanism.H. My first check is to use progressRateFR and the reaction data from CKINU to verify I get the same rate of production of each species as CKWYR. However, the two routines give very different answers for the production rate of species. I've taken a look, and I do not see any reason that they should be different- is there something I am missing?
Here is what I am using to get the data, at the end prod_rate and prod_rate2 are not the same in value or in trend.
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions