patchAverage on totalPressure (both functionObjects)
Hey all,
we all know that we can use the patchAverage to calculate an averaged field that is stored in the registry of the OpenFOAM such as p, U, k, etc. However, I am more interested in the total-pressure (contribution from the velocity). Hence, I am wondering if we can simply calculate the patch average value of an function object such as the totalPressure? I don't want to save the totalPressure field on my hard disk and I want to calculate the data each iteration. Any idea? Code:
pressureField |
Hi Tobi,
I have used this in the past for a total pressure difference. It did not write total(p) every timestep, but it did write the delta. Both use executeControl timeStep as default. For your case you may need to adapt it a bit, but I hope the general idea is clear. Code:
totalPressure |
Hi guys, I tried the code but it doesn't work. I don't know where is the problem. This is the dictionary I called FOdeltaP
HTML Code:
totalPressure HTML Code:
postProcess The result is this error message: HTML Code:
ime = 0 |
Hi,
Maybe you can specify which fields to load when running postProcess: Code:
postProcess -fields '(U p)' Code:
simpleFoam -postProcess Hope this helps, Tom |
Hi, thank you for the fast response. It works!
Now I am trying to apply the same function object to a different field, "p_rgh". Every time I try calling this field: HTML Code:
totalPressure I am passing p_rgh in the calling command, but the error is the same. |
Hi,
Not sure if the new variable would still be called total(p) or now total(p_rgh). You may be able to give another name by using: Code:
totalPressure |
Good point using the keyword result. This name is used to construct the object inside the calc() function in the FO. However, the resultName_ by default is constructed by the resultName() function.
Code:
Foam::word Foam::functionObjects::pressure::resultName() const
So I guess with Tom's hint, you should be ready to go. |
All times are GMT -4. The time now is 05:57. |