The canonical process of determining the pressure, velocity, and density of a fluid under the influence (or not) of external forces is through simultaneously solving conservation of mass, conservation of momentum, and an equation of state for the pressure (or conservation of energy). For an incompressible Navier-Stokes fluid with constant density $\rho_0$, this would look like:
$$p = p(\rho, \vec{v}) = p(\rho_0,\vec{v})$$ $$\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho \vec{v}) = \nabla\cdot \vec{v} =0$$ $$\rho \left(\frac{\partial \vec{v}}{\partial t} + \vec{v}\cdot\nabla \vec{v}\right) = -\nabla p + \mu \nabla^2\vec{v} + \vec{f}$$
Given some external force, all three of the variables can be solved for with this system of equations.
However, when discussing flows in introductory fluid mechanics like pipe flow, we ignore the equation of state; we arbitrarily prescribe a pressure gradient and then use conservation of mass/momentum to obtain the resulting velocity for a fluid with a given density.
How do we not run the risk of prescribing a pressure gradient that violates the equation of state/conservation of energy? Surely the answer lies in the difference between thermodynamic and mechanical pressure, but is the mechanical pressure really just treated as a totally unconstrained variable?