Application of the thermodynamic extremal principle to modeling of thermodynamic processes in material sciences