Ab initio prediction of thermomagnetic and thermoelectric transport phenomena in 3d and 2d materials