Solvent polarity and chain length effects in thermotropic mesophase formation process: Comparative quantum and thermodynamic analysis