Let $P$ be a positive scalar function and $\mathbf{v}(\mathbf{x})$ is an assigned smooth vector field. The quantity $P(t,\mathbf{x})$ evolves according to a transport equation of the kind
$$
\partial_t P(\mathbf{x},t) = -\nabla \cdot [ \mathbf{v}(\mathbf{x}) P(\mathbf{x},t) - \nabla P(\mathbf{x},t) ]
$$
The steady state solution $P(\mathbf{x})$ is given by
$$
\nabla \cdot [ \mathbf{v}(\mathbf{x}) P(\mathbf{x}) - \nabla P(\mathbf{x}) ] = 0
$$
If $\mathbf{v} = -\nabla U $, then the formal solution has the usual Gibbs form
$$
P \propto e^{-U }
$$
Question: assume that the above equation is defined on the 2D (flat) torus $\mathbb{T}^2$.
How to deal with the case in which $\mathbf{v} = -\nabla U + \mathbf{q}$, where $U$ has the periodicity imposed by $\mathbb{T}^2$ and $\mathbf{q} =(q_x,q_y)$ is a constant vector field?
More precisely, I'd like to find the class of solutions of $$ \nabla \cdot [ \mathbf{q} P(x,y) - P(x,y) \nabla U(x,y) - \nabla P(x,y) ] = 0 $$ with the periodic constraints typical of the flat torus $[0,1]\times [0,1]$, i.e.
$P(0,y) = P(1,y)$, $\quad P(x,0) = P(x,1)$, $ \qquad U(0,y) = U(1,y)$, $\quad U(x,0) = U(x,1) \, $.
If $\mathbf{q} = 0$, then the solution $P \propto e^{-U } $ works. My feeling is that the problem with $\mathbf{q} \neq 0 $ is not trivial because of the topology of $\mathbb{T}^2$: the constant field $\mathbf{q}$ is clearly periodic (so it can live on the torus) but has no periodic potential (i.e. the potential should be $-q_x x -q_y y$ that is not periodic).
EDIT: I found this question about divergence-free fields on a torus. In fact, the field $\mathbf{q} P(x,y) - P(x,y) \nabla U(x,y) - \nabla P(x,y)$ is required to be divergence-free. Also these notes are interesting and deal with the diffusion on the flat torus (pag. 80).
In terms of differential forms the problem should be (correct me, I am not an expert):
$$J = q P -P dU - d P \qquad \qquad div(J)=0$$
where $J$ is a current 1-form, $q$ is a constant 1-form, $P$ and $U$ are 0-forms. In particular, we should have that $J = R dg$, where $g$ is a 0-form and $R$ is a 90-degrees rotation (i.e. it is the Hodge dual operator in two dimensions, $J = *dg$). Equivalently, by using a somewhat improper 3D terminology, $J = rot(A)$, where $A=(0,0,g)$. Maybe the language of differential forms helps understanding why it is not so easy to find a solution when the $\mathbf{q}$ term is switched on.
Since this problem is related to systems studied in Physics (transport equations, Fokker-Planck equations), I posted a related question on physics SE.