Xu introduced a family of root-tree-diagram nilpotent Lie algebras of differential operators, in connection with evolution partial differential equations. We generalized his notion to more general oriented tree diagrams. These algebras are natural analogues of the maximal nilpotent Lie subalgebras of finite-dimensional simple Lie algebras. In this paper, we use Hodge Laplacian to study the cohomology of these Lie algebras. The total rank conjecture and $b_2$-conjecture for the algebras are proved. Moreover, we find the generating functions of the Betti numbers by means of Young tableaux for the Lie algebras associated with certain tree diagrams of single branch point. By these functions and Euler-Poincare principle, we obtain analogues of the denominator identity for finite-dimensional simple Lie algebras. The result is a natural generalization of the Botts classical result in the case of special linear Lie algebras.