real gas model implementation for thermophysicalModels library
Hi everyone!
I would like to share the OpenFOAM-based real-fluid thermophysicalModels library that we developed for reacting flow simulation at high-pressure. The detail development is described in here https://doi.org/10.1016/j.cpc.2021.108264 You can freely download the source code here: https://github.com/danhnam11/realFlu...ysicalModels-6 Should you find bugs or have suggestions on how to make the code better, please post on this thread. Greetings, Danh Nam (This thread is posted on the Programming& Development topic but I realize that it's the wrong place. So that I post this thread again here :) ). |
3D and high velocity
is it good for 3D runs and high velocity applications?
|
Quote:
I think you should give it a try. Our library provides only calculations of real-fluid thermophysical properties. It doesn't depend on high or low velocity. Danh Nam! |
EOS - Peng Robinson
Good morning,
I found that, in PengRobinson equationOfState model, the M term, present in both Cp and CpMCv functions, is the same as in the soaveRedlichKwong model when actually it is not so (as you can see in the original PengRobinsonGas formulation). This fact leads to negative Cp (I’m dealing with nitrogen at cryogenic conditions). If you substitute back the original formulation for the M term everything works fine. Nicola |
Quote:
Thank you so much for your bug finding. I will check it and update in our source code again. have a nice day :) Danh Nam. |
Hi danhnam:
Your work is outstanding. I have a question, can it be used to calculate trans-/supercritical spray? eg ECN Spray A (Tinj=363K, Pamb=6MPa) |
Quote:
Yes, the implemented real-gas models can be used for a wide range of T and p. We already tested from 1 to 300 atm against NIST data, covering your conditions. If you get any problems with this library, we can discuss it together. Danh Nam. |
Quote:
|
I think your problem belongs to the solver problem. Our work only focus on the library which means the calculations of thermophysical properties. The solver named realFluidReactingFoam used in our work is only for laminar flame. Your problem may come from the nature of the solver you are using, for instance psi- or rho-based, or the algorithm you are using.
Which solver you are using now? |
Quote:
|
I have not run spray A problem before. But I think we could have a further discussion. You can email me via danhnam11@gmail.com. I will reply you tomorrow because it is quite late now.
Hopefully I can help you to solve your problem. |
Quote:
|
Dear danhnam:
When I use this library, I found a error when utilizing nitrogen as working fluid in the temperature range 120-300 under the pressure of 5MPa FOAM FATAL ERROR: Maximum number of iterations exceeded: 100, in file /home/user/OpenFOAM/realfluids/realFluidThermophysicalModels-6/src//thermophysicalModels/specie/lnInclude/thermoI.H at line 73. I guess there are some issues when solving temperature. |
Dear xubonnan!
Thank you for letting me know that error. Could you provide more information such as which solver you are using, which real-gas models you are using, etc., . And it would be better if you can include the whole error message. It can help me understand your problem more. Danh Nam, |
Quote:
I just change the tutorial case to pure nitrogen, and the pressure is 5MPa, initial internal temperature is 300K, the temperature of two inlet is 130 and 300K respectively. I think its not due to the bugs of code, its because of the effect of quickly change and nonlinearity of thermodynamic properties of fluids. |
Quote:
I think so. The error would come from the nature of your problem (not a bug of code). Hopefully, you can use our library for your work. Danh Nam, |
Quote:
|
Quote:
To overcome that problem, we already implemented Newton+bisection method to retrieve T from enthalpy. But that code has not been published yet. However, to run the simulations with real-gas models at near the critical point, you not only need to overcome that problem but also you need to apply a modified PIMPLE algorithm for your system of the governing equations. We already finished all of them and the source code would be available for everyone soon after our paper is being accepted. Danh Nam, |
Thanks for your reply, I see, I did not realize there would be a problem with the pimple loop itself, I hope that you can share you findings soon!
I had another question, in your paper, you define the strain rate for the counterflow non-premixed flame with a multiplying factor of 2. In the textbooks I've read this 2 is not included in the definition. Is this due to a lack of standardization for the definition, or some other reason? Thank you for your time! |
Real Gas Jacobian
In reference to the following file:
src/thermophysicalModels/specie/thermo/rfJanaf/rfJanafThermoI.H (Lines 286-295) The dcpdT term is ideal. Since we are dealing with real gas combustion we need to solve for real gas Jacobian. So the temperature derivative will also include the derivative of departure function apart from the ideal gas part. Please let me know if you have time to discuss this. |
All times are GMT -4. The time now is 08:43. |