Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Four-Temperature model (for air5) #73

Open
lkampoli opened this issue May 7, 2019 · 5 comments
Open

Four-Temperature model (for air5) #73

lkampoli opened this issue May 7, 2019 · 5 comments

Comments

@lkampoli
Copy link

lkampoli commented May 7, 2019

Hello,
I'm wondering how to implement a 4-T model for air 5: N O N2 O2 NO.
In principle, it seems quite straightforward but I have some questions. I'd do the following:

  1. Add the temperature vector Tvs[3] in StateModel.h corresponding to Tv_N2, Tv_O2, Tv_NO.
  2. cp ChemNonEqTTvStateModel.cpp ChemNonEqT3TvStateModel.cpp.

Then, I need to modify some functions, like getEnergiesMass, getEnthalpiesMass, getCpsMass, and so on ... they call speciesHOverRT whose signature contains all temperatures associated to all energy modes but only one entry is present for the vibrational one.

So, here is the question: how should I introduce the 3 vibrational temperatures corresponding to the 3 molecular species in air 5 in speciesHOverRT and other functions which make use of them?

Maybe to change double Tv into double * Tv[nenergy] ?

Thank you,
Lorenzo

@grgbellasvki
Copy link
Collaborator

Just quick thoughts:
You have your own RRHO model right? Maybe this should be the first step, create something like RRHO3Tv.

Maybe overload the "enthalpy" function in the thermo_db with an ArrayXd for the associated temperature. In the base class point it to an error.

Then overload the speciesHOverRT exactly as you say. Inside the function, Map the pointer to an ArrayXd. Maybe this is inefficient, but might avoid memory errors.
Considering which other functions you should modify in the thermo, they should mainly be inside the RRHO file.

What I have never worked and might be tricky is which temperatures the state model will return for use to kinetics and transport.

@lkampoli
Copy link
Author

@grgbellasvki Thanks, it helped!
One more question:
I'm writing the function for the production terms in Kinetics.cpp, R_diss_rec. How can I retrieve and use in the new function all the temperatures (T, Tv1, Tv2. Tv3) which I defined in ChemNonEqT3TvStateModel.cpp?
And similarly, how can I retrieve the Arrhenius parameters which are read from file elsewhere?

Thanks,
Lorenzo

@lkampoli
Copy link
Author

lkampoli commented May 14, 2019

Ok, for temperatures, I added a function in Thermodynamics.cpp which points to StateModel.h.

@grgbellasvki
Copy link
Collaborator

@lkampoli We could provide more help if we could see your code.
Could you open a temporary pull request, or point us to a branch?

@lkampoli
Copy link
Author

Hello,

yes I plan to do it within this week. I would like to finish to add diss/rec, VT and VV, so that you can see all processes.

Regards,
Lorenzo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants