quinnreynolds / minplascalc

minplascalc - LTE plasma calculations
GNU General Public License v3.0
6 stars 0 forks source link

Implement calculation of plasma enthalpy rather than Cp #17

Closed quinnreynolds closed 7 years ago

quinnreynolds commented 7 years ago

Original report by Quinn Reynolds (Bitbucket: kittychunk, GitHub: kittychunk).


The direct calculation of heat capacity from composition at a single temperature and pressure requires knowledge of the reaction paths between species, which we want to try to avoid as much as possible - even though any consistent set of reaction paths should give the same result, choosing one implies an assumed reaction mechanism which is open to debate in many cases.

It's cleaner to offer a function in the compositionGFE class to calculate the plasma enthalpy H instead. Cp may then be obtained by numerical derivative given a list or array of H at a range of temperatures.

quinnreynolds commented 7 years ago

Original comment by Quinn Reynolds (Bitbucket: kittychunk, GitHub: kittychunk).


I backtracked a bit on this because it's perfectly reasonable that users might want to do a Cp calculation at a single temperature rather than over a range.

979a192 implements code in the calculate_heat_capacity function to do so by calculating a numerical derivative around the target temperature, with the caveat that it is quite a compute-intensive process; should one be thinking about running a lot of simulations at different temperatures, it will be vastly faster to do numerical derivatives on the resulting list of enthalpies as described above.

Closing for now.

quinnreynolds commented 7 years ago

Original comment by Quinn Reynolds (Bitbucket: kittychunk, GitHub: kittychunk).


The enthalpy calculation is implemented. I'm marking as on hold rather than resolved because we still need to decide what to do with the existing calculateHeatCapacity function placeholder in compositionGFE (my preference would be to remove it completely).