Digital twins for secure thermal energy storage in building