How to generate Pressure in cavity3d example?

Hello Dears,

I am a totally new Palabos user. I did run the cavity3d example that provided with the palabos package, but when I imported the data to ParaView, I only got the velocity, velocityNorm and vorticity.

So, what do I have to do to generate pressure beside the velocity when I rut the cavity3d example ?

Thank you in advance

Hello and welcome,
to get the pressure you must tell Palabos to export it as well. You should add

vtkOut.writeData<float>(*computePressure(lattice), "pressure", util::sqr(dx/dt)*fluidDensity);

Thank you orestis for the respond.

I added it to the cavity3d .cpp file, but when I run the code, it gave me an error saying that

error: ‘computePressure’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
*computeNorm(*computePressure (
~~~~~~~~~~~~~~~~^
*computePressure(lattice) ), slice ),

Hi @orestis,
I tried that, but I got an error saying: **
** error: ‘computePressure’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]

*computeNorm(computePressure (
**~~~~~~~~~~~~~~~~^
*
*computePressure(lattice) ), slice ),

Any suggestion solution for that?

You are right… computePressure does not exist. My bad.

You could build you own compute pressure. Something along the lines of:

*multiply(*add(*computeDensity(lattice), -rho0), DESCRIPTOE<T>::cs2)

Hi Orestis,

An this post How to generate Pressure in cavity3d example?

what do you mean by rho0?

thanks

rho0 would be the vaerage density of whatever offset you need. The pressure is always defined up to an additive constant in fluids.