I would like to model wind flow over a terrain using a log-law velocity profile for my inlet. I have modelled a rectangular prism and assigned one of the faces to be my inlet. Unfortunately I'm not very good with the syntax used in expressions, so I am continuously facing error messages, which I'm not sure how to fix.

The main error is "Argument dimensions resolve to 'm'; expected '<dimensionless>" when I using the "Uz" expression for the inlet velocity:

Yep, loge (or ln) wont accept an argument with dimensions, see cfx_ref.pdf at page 168 (for version 14). Just normalize it with /1[m] or make z0 = 0.0001 [m] and you should be fine. If you want your inlet expression to go all the way to the top (assuming z= 0 at the bottom) then you dont need to set any min/max values.

Yes, when z = 0 it will result in loge(0) which is undefined, thats why you get an error. One thing you could try is loge((hz+eps)/z0[m]) where eps is a very small number. But be aware that it might give you the wrong solution close to the wall.

I understand that there is likely to be an error, but I assume it will be pretty small if you choose the added value to be very small.
In fact, I used the same value as for z0 because then at z=0, log(1)=0, which would correspond to reality where wind velocity is zero at the ground.
Perhaps this is still an acceptable method for a large domain.