I am currently creating a 2D ideal gas simulator whereby the user can determine three of the four variables (P, V, n, T) and the gas would adjust accordingly.

I was wondering how I could calculate the pressure within this simulation. I was struggling with how to approach this problem considering how I am attempting to model a 3d scenario in 2d.

  • $\begingroup$ I think how you would approach this is a bit dependent on the problem you want to translate into 2D. Do you have a specific geometry and density/temperature structure in the third dimension in mind? Because usually 2D-pressure is a quantity that is proportional to column density instead of volume density, garnered with numerical prefactors that come from integrating the density/temperature profile in the third direction. $\endgroup$ Jul 31, 2019 at 15:34
  • $\begingroup$ Well, I'm trying to make this relatively simple. I'm going to make the all of the particles equal mass, and temperature equal to the square of the particle speed... I hope this answers your question. $\endgroup$
    – nomnom123
    Aug 1, 2019 at 0:02
  • 1
    $\begingroup$ So do you have particles or a continuum? I'm confused. Pressure and temperature are only evolvable in a continuum theory. $\endgroup$ Aug 1, 2019 at 19:24
  • $\begingroup$ @AtmosphericPrisonEscape he has particles. However, you can extract pressure. He is trying to make a "molecular dynamics" simulation with classical particles (see the animation here en.wikipedia.org/wiki/Kinetic_theory_of_gases) and he is asking how to extract the pressure from such a kinetic simulation. See e.g. link.springer.com/article/10.1007/BF01014270 $\endgroup$
    – Quillo
    Jun 4, 2022 at 6:38

1 Answer 1


since the gas is a 2D one, you most start using pA=Nm*(mean square velocity)/2

A=area (which is the 2D-volume, indicated in your question as V) N= # of molecules enclosed in A ( 2D- volume) hence n=N/A

then, the temperature can be estimated using pA=NkT where k is Boltzmann constant


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.