We construct a discrete model of fluid particles according to a two generat
or formalism for nonequilibrium thermodynamics. The model has the form of s
moothed particle hydrodynamics including correct thermal fluctuations. A sl
ight variation of the model reproduces the dissipative particle dynamics mo
del with any desired thermodynamic behavior. The resulting algorithms have
the following properties: mass, momentum, and energy are conserved, entropy
is a nondecreasing function of time, and the thermal fluctuations produce
the correct Einstein distribution function at equilibrium.