# Apply pressure to the simulation box

**URL:** <https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440>\
**Category:** User discussions\
**Created:** [January 14, 2021, 1:37pm UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440 "2021-01-14T13:37:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maryam.sn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/maryam.sn/32/69_2.png) [@maryam.sn](https://gromacs.bioexcel.eu/u/maryam.sn)\
**Post date:** [January 14, 2021, 1:37pm UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440/1 "2021-01-14T13:37:51Z")

</div>

Hi,  
How can the pressure be applied to the simulation box along the z direction?

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 15, 2021, 1:04pm UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440/2 "2021-01-15T13:04:25Z")

</div>

Hi maryam,

Have a look at the `semiisotropic` option here:  
[https://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#pressure-coupling](https://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#pressure-coupling)

If you use that type of pressure coupling, you have to set two refernce pressure values and two compressibilities - one in the xy direction and one for z.

Then you can fix the compressibility in the xy-direction to a zero and only give a compressiblity in the z-direction (the second compressilbity value to enter), effectively allowing scaling of the box only in z-direction.

---

<div class="post-metadata">

**Author:** ![maryam.sn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/maryam.sn/32/69_2.png) [@maryam.sn](https://gromacs.bioexcel.eu/u/maryam.sn)\
**Post date:** [January 15, 2021, 1:28pm UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440/3 "2021-01-15T13:28:18Z")

</div>

Hi “cblau”  
thanks for your guidance.

---

<div class="post-metadata">

**Author:** ![maryam.sn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/maryam.sn/32/69_2.png) [@maryam.sn](https://gromacs.bioexcel.eu/u/maryam.sn)\
**Post date:** [January 15, 2021, 1:36pm UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440/4 "2021-01-15T13:36:42Z")

</div>

I read part of an article on this subject : “The simulations were performed under a given  
constant hydrostatic pressure in the NVT ensemble, it can be obtained by an additional acceleration to every molecule along the z direction”.Do you think, it is a different strategy?

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 15, 2021, 1:44pm UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440/5 "2021-01-15T13:44:34Z")

</div>

Hi Maryam,

Yes, this is a different strategy. With the strategy that I outlined above, there is no sense of up or down, the system is “squeezed” to keep the pressure from both sides, wheres in the case that you describe, particles get a constant force “upwards” or “downwards”

---

<div class="post-metadata">

**Author:** ![maryam.sn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/maryam.sn/32/69_2.png) [@maryam.sn](https://gromacs.bioexcel.eu/u/maryam.sn)\
**Post date:** [January 20, 2021, 3:54am UTC](https://gromacs.bioexcel.eu/t/apply-pressure-to-the-simulation-box/1440/6 "2021-01-20T03:54:08Z")

</div>

thanks
