CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Fortran Subroutines (area pressure calculation) (

Olu B March 28, 2000 11:54

Fortran Subroutines (area pressure calculation)
I am trying to locate a subroutine to calculate the total pressure over a set of cells at a givem location. i am running a diffuser test case and i am tring to show the variations in pressure for several axial locations.

Jan Rusås March 28, 2000 17:13

Re: Fortran Subroutines (area pressure calculation)
Dear Olu B,

I assume you are talking about CFX4.2/3, I think in CFX5 there the total pressure is available.

If you are using CFX4.3 I recommend the following procedure.

In your command file define your own user scalar, and then include the usrsrc.f file in where you calculate the total pressure and assign the value to your user scalar.

You can then see the total pressure in any post processor, and calculate it on any plane you which with the use of >>PATCH DATA. Take care when you do this, if you want to calculate an average pressure on a surface it should be mass average, which also is an option in patch data.

There is also another way, if you only want to calculate the total pressure and not seeing it in a post processor, if you have access to userflows.f in the extras library, the file is probably moved from the CFX4.3 library because the facility to calculate variables on any plane/patch is included in the command file. There is also a readme file to explain have you include the patch data when using the userflows.f file.

In the userflows.f file modify the lines with PHI=VAR(…. To PHI=0.5*DEN*(U**2+V**2+W**2) Any variable you define in patch data will now be the total pressure. Again-remember mass average.

Regards Jan

Mamdud Hossain April 4, 2000 03:44

Re: Fortran Subroutines (area pressure calculation)
Dear Jan,

Your answer is of great interest to me. I am new in using CFX4.2. So, I need some help. Basically, I am interested to calculate average pressure at the inlet and outlet patch. Can you please tell how to do that? I could not find >>PATCH DATA command in the manual, so I am not sure how to use that command also?



Jan Rusås April 4, 2000 05:13

Re: Fortran Subroutines (area pressure calculation)
Dear Mamdud,

The reason why you can not find the >>PATCH DATA is because you are using CFX4.2. You should follow the procedure outlined in the last section of my answer. Find the userflows.f in you extras directory, read the readmefile. Modify the userflows.f as explained. If you still have problems fell free to contact me, I'll send you the file. Do remember - mass average if you want to calculate a pressure difference.

Regards Jan

All times are GMT -4. The time now is 09:01.