sandialabs / Spitfire

Spitfire is a Python/C++ library for constructing tabulated chemistry models and solving differential equations.
Other
37 stars 9 forks source link

Is it possible to do a CEMA analysis of OpenFOAM calculations? #37

Closed scramjetFoam closed 1 month ago

scramjetFoam commented 1 month ago

Dear developer,

I would like to know if it is possible to do a CEMA analysis of openfoam calculations. If it is possible, what do I need to do?

Best regards, Shang

michael-a-hansen commented 1 month ago

Hello,

That sounds entirely possible. You just have to get your hands on the right data. Spitfire's CEMA post processing works on a spitfire.Library object with mass fraction [species-name] (all species) and pressure and temperature fields. You'll have to get this data from your simulation result and pack it into a spitfire.Library with these fields, as well as a load up a chemical mechanism into a spitfire.ChemicalMechanismSpec (if you have a Cantera mech that will work).

You can then follow this demonstration: https://spitfire.readthedocs.io/en/latest/demo/reactors/isothermal_reactors_with_mode_analysis.html

If your dataset is extremely large, any form of parallelism or batch processing that may be necessary is up to you, Spitfire has no concept of parallel datasets.

Mike

scramjetFoam commented 1 month ago

Dear developer,

Thanks for your advice. I think I can use python to read the result of the calculation as the input of spitfire.Library. My calculation model is a 3D combustor, so it should be isobaric and adiabatic, right? My calculation model is quite large, with tens of millions of meshes, and I may indeed need parallelization.

Best regards, Shang

michael-a-hansen commented 1 month ago

Isobaric-adiabatic is probably the most appropriate formulation, yes. O(10M) data points, definitely consider running in parallel.

Best of luck, let me know how I can help.

Mike

scramjetFoam commented 1 month ago

Thanks a lot. I will have a try.

Shang