|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Join Date: Oct 2018
Posts: 32
Rep Power: 9 ![]() |
Hi guys,
I have an issue regarding the real time plot of static pressure rise across the fan I'm running. I explain. I already got average static pressure on inlet and outlet patches by use of: patchAverage_inlet_inletdom { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 1; patch inlet_inletdom; select patch; fields (p); operation areaAverage; writeFields false; log true; } patchAverage_outlet_outletdom { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); writeControl timeStep; writeInterval 1; patch outlet_outletdom; select patch; fields (p); operation areaAverage; writeFields false; log true; } At this point two .dat files are created inside postProcessing/ folder and I can plot them by use of gnuplot, using the following script: gnuplot -persist <<EOF2 & set title "Static Pressure" set xlabel "Iterations" set ylabel "Static pressure [Pag]" set grid do for [i=1:100000] { plot \ "postProcessing/patchAverage_inlet_inletdom/0/surfaceFieldValue.dat" using 1:2 with lines title "psin", \ "postProcessing/patchAverage_outlet_outletdom/0/surfaceFieldValue.dat" using 1:2 with lines title "psout" pause 1 } EOF2 My question is: how can I calculate inside OF (I’m using OpenFOAM 13 Foundation) the difference of previous two average values, write it inside a .dat file and plot it using gnuplot inside the same plot of psin and psout? Thanks in advance. elia |
|
|
|
|
|
|
|
|
#2 |
|
New Member
Michael Häckel
Join Date: Nov 2025
Posts: 16
Rep Power: 2 ![]() |
You can use the ddt postprocessing function to calculate the time derivative of the pressure field. Then you can calculate the average of the derivative. The result is not exactly the same as with your proposed calculation method, but almost.
https://doc.cfd.direct/openfoam/user...-functionality There is no documentation but the usage is like for most other postprocessing functions. Instead of your gnuplot script you can also use foamMonitor. That is a bit more comfortable. |
|
|
|
|
|
|
|
|
#3 |
|
Member
Join Date: Oct 2018
Posts: 32
Rep Power: 9 ![]() |
Thank you michael for the reply. Finally I solved the issue in this way:
dps { type fieldValueDelta; libs ("libfieldFunctionObjects.so"); operation subtract; writeControl timeStep; writeInterval 1; log true; region1 { #includeEtc "caseDicts/functions/surfaceFieldValue/surfaceValue.cfg" patch outlet_outletdom; operation areaAverage; fields (static(p)); } region2 { #includeEtc "caseDicts/functions/surfaceFieldValue/surfaceValue.cfg" patch inlet_inletdom; operation areaAverage; fields (static(p)); } } dfr { type fieldValueDelta; libs ("libfieldFunctionObjects.so"); operation add; writeControl timeStep; writeInterval 1; log true; region1 { #includeEtc "caseDicts/functions/surfaceFieldValue/surfaceValue.cfg" patch outlet_outletdom; operation sum; fields (phi); } region2 { #includeEtc "caseDicts/functions/surfaceFieldValue/surfaceValue.cfg" patch inlet_inletdom; operation sum; fields (phi); } } |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tolerance in solver VS tolerance in residualControl | FluidKo | OpenFOAM Running, Solving & CFD | 13 | January 30, 2024 11:59 |
| pimpleFoam residual increase in final iteration | AhmedHafez | OpenFOAM Running, Solving & CFD | 0 | December 1, 2022 04:03 |
| Change foamLog for Pimple iteration and new variables | Magistrane | OpenFOAM Post-Processing | 1 | April 26, 2019 05:26 |
| contour plot: mass flow difference | jai | CFX | 3 | December 16, 2017 07:20 |
| difference plot: turbulent kinetic energy (URANS) vs. Reynolds Stresses (LES) | fabfi | CFX | 2 | November 21, 2017 11:29 |