A new interface for the computation of thermal expansion

A new class (thermal_expansion_class) has been defined which is an interface to the calculation of thermal expansion by using three different methods.

Let's see how it works. As usual, run an instance of the bm3_thermal_2 module (the example concerns the mineral pyrope):

Make some preliminary calculation of the equation of state; for instance

Set suitable parameters for the calculation of numerical derivatives of the pressure with respect to the temperature. This can be done by using the adaptive scheme defined in the delta_ctrl driver:

Print a summary of the current parameters and conditions adopted for the calculations:

Now let's calculate the thermal expansion. The method thermal_expansion.info provides some details concerning the different algorithms:

The function to be used is thermal_expansion.compute:

At T=298.15 and P=0 GPa, the thermal expansion of pyrope is estimated (default method k_alpha_dir) to be:

By the method k_alpha_eos, the computation provides:

Note that with method k_alpha_dir, the computation of bulk modulus in done by the bulk_modulus_p function, with the argument noeos set to True, and the equilibrium volume is from the volume_dir function.

On the contrary, with the method k_alpha_eos, bulk modulus and equilibrium volume come from an EoS fit at the select temperature. Pressures at constant volume are computed from the refined EoS at the different temperature in an interval centered on the selected temperature.

The third method alpha_dir is the least efficient in term of computing time, but it does not require the estimation of the bulk modulus by whatever method: it computes $\alpha$ as

$$\alpha = \frac{1}{V} \left(\frac{\partial V}{\partial T}\right)_P$$

The volume at each temperature in an interval centered on the wanted temperature, is compute by the volume_dir function. In this case, the algorithm provides:

Thermal expansion can also be computed in a range of temperatures, and optionally fitted by a power series whose parameters can be uploaded in the internal thermodynamic database if a phase label is provided. This can be done by using the compute_serie method:

Here the example for pyrope (default method 'k_alpha_dir')

Note that, in this case, all of the thermodynamic parameters for pyrope are read from an external database and only the thermal expansion data are upgraded to the new computed values.

By writing a few lines of python code, it is for instance possible to compare the thermal expansion computed through two different algorithms like k_alpha_dir and k_alpha_eos. The following lines computes the coefficients of the power series from the two methods:

The coefficients of the power series optimized for the two cases are then used to compute $\alpha$ by using the alpha_fun function that accepts a list of temperature (t_list) and the list of coefficients as arguments:

The two $\alpha$ curves are then plotted together by using the plot.multi method:

Use the help function to get the: documentation concerning the plotting facilities: