# Constant background pressure

Hey community!

I have a short question about how to implement constant background pressure to a simulation. I am talking about the capital X in the state equation:

Is there an option in the xml where I can set the background pressure to say 1 bar?

Thank you!

## Comments

My two cents. Not primarily about the xml file, but about the equation of state.

I disregard the term -a*rho^2 in your equation.

The equation of state implemented in DSPH invariably associates the user-defined density rho=rho0 with the fixed value P=0. In other words, P is always the total pressure

relativeto that particularreference pressuregiving thereference densityrho=rho0. Importantly, the equation of state knows nothing ofwherethe above reference situation occurs.If you have a free surface I know a

reference locationtoo. As far as I understood it, DualSPHysics attributes the reference density rho0 to the fluid particles on the free surface. (There is a post open at https://forums.dual.sphysics.org/discussion/1900/ touching upon this, you may want to follow it or contribute to it.) There, physically, the total pressure is relative to the atmospheric pressure.So you want to raise the reference pressure from 0 to X. The fluid particles have to be compressed by the pressure difference P-X and their density has to be increased; start off with the thought conditions without background pressure, use the equation of state to determine the density change, and update the value of the reference density rho0 accordingly in the xml file. You should be able to see an increased density at the reference location (free surface) and of course below. This is the material effect of the background pressure.

Recall this background pressure will not be dynamically effective, because it is constant and cancels out in the pressure gradient. But then I should reconsider the extra term -a*\rho^2 in your equation indeed.

This is what I would try (and I haven't, so corrections and suggestions are welcome).

PS It would be so much nicer and handier to have a linear equation of state. The flow is weakly and artificially compressible, and particles with large deviations from the reference density are excluded anyhow.

Thank you for your considerations! I will try out your approach eventually.

I don't expect an effect on the dynamics of the flow. I only expect a constant difference in the pressure level. At the free surface X and increasing hydrostatically below with rho

gz.In addition, a linear equation of state can be used just using gamma=1

We want to have a near incompressible (within the weakly compressible formalism) equation of state and therefore a γ = 7 has been adopted However the user can modify the value of gamma in the XML and the value of speed of sound can be also defined there.

Regards

Good point about tweaking gamma! Thanks