The function accounts for the chemical potential has been finished. But it seems there is a potential bug with the function TDBtoCplusplus.