Access to diffusion and reaction terms for Unsteady Premixed Flame Solver #6
Replies: 1 comment 2 replies
-
|
Hi Sandeep, Sorry for the late reply. You found the correct locations for the species diffusion and chemical source terms. If you want to apply a multiplier to the chemical source terms, for example, you can simply modifiy the rhs_chem array right after the call to GetTimeDerivativeLimiter. Similarly, if you want to change the species diffusion terms, you can modify the species_mass_flux_ array after the call to GetSpeciesMassFlux. For the temperature diffusion, you may also want to modify the term containing thermal_conductivity, or simply modify the thermal_conductivity array. If you need to do more extensive changes to how the diffusion or chemical terms are calculated, the diffusion fluxes are computed in src/transport/constant_lewis.cpp (or mix_avg.cpp, mix_avg_soret.cpp) and the chemical source terms are computed in src/reactor/const_pressure_reactor.cpp. Hope this helps, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm working on developing a 1-D turbulent flame model to examine how large chemical mechanisms respond to enhanced transport - this is mainly to test out quick scenarios and delay the use of full blown DNS.
Could you let me know where to look for the diffusion and reaction terms for the Unsteady premixed flame solver? I would like to add multipliers/functions to these terms coming from another code.
My wading through the source files led me to applications/premixedUnsteady/cvode_functions.cpp where it seems like
For modifying species diffusion, Line 273-275 seems promising
rhs_diff[j*num_states+k] -= relative_volume_j*inv_dzm[jext]* ( params->species_mass_flux_[num_species*(j+1)+k] -params->species_mass_flux_[num_species*j+k]);For modifying temperature diffusion, Line 294-300
rhs_diff[(j+1)*num_states-1] -= relative_volume_j* cp_flux_sum/params->mixture_specific_heat_[j]* (a*params->y_ext_[(jext+3)*num_states-1] + b*params->y_ext_[(jext+2)*num_states-1] + c*params->y_ext_[(jext+1)*num_states-1] + d*params->y_ext_[jext*num_states-1] + e*params->y_ext_[(jext-1)*num_states-1]);For modifying the chemical source, I see
// compute the constant pressure reactor source term // using Zero-RK for(int j=0; j<num_local_points; ++j) { params->reactor_->GetTimeDerivativeLimiter(t, &y_ptr[j*num_states], ¶ms->step_limiter_[0], &rhs_chem[j*num_states]); }For the chemical source, I think more searching is needed on my part but wanted to check with you if I am on the right path at all.
If I work this out, am happy to contribute my code. Often turbulent combustion models benefit from much a smaller ecosystem for testing purposes - maybe someone else might benefit.
Many thanks for your advice,
Sandeep.
Beta Was this translation helpful? Give feedback.
All reactions