CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   pressure drop using chtMultiRegionFoam (https://www.cfd-online.com/Forums/openfoam-post-processing/212368-pressure-drop-using-chtmultiregionfoam.html)

amdk136 November 30, 2018 05:12

pressure drop using chtMultiRegionFoam
 
1 Attachment(s)
Hi,


I am trying to get the pressure drop between 2 different patches (inlet and outlet). In my controlDict I have included "#includeFunc patchAverage", and I have tried to use the postProcess -func patchAverage tool, however it tells me that I don't have a pressure field.

Code:

Reading fields:

Executing functionObjects
surfaceFieldValue patchAverage write:
--> FOAM Warning :
    From function virtual bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
    in file fieldValues/surfaceFieldValue/surfaceFieldValue.C at line 807
    Requested field p not found in database and not processed


Time = 39.75

Within my simulations, I have a pressure difference as I have a pressure gradient (around 5 or 6). When I run the patchAverage on the outlet, I get the attached result (surfaceFieldData attached below).


I am using OpenFOAM 6, and I am unsure why it is not working. Is there a way to do this for specific patches within paraView instead of just OF? Can anyone help? Any help is appreciated!


Thank you,
Arthur

simrego December 2, 2018 13:29

Hi!
In chtMultiRegionFoam you have regions. So you have to add the "-region regionName" switch to your command, where regionName is the name of the region where you have that patch.

amdk136 December 3, 2018 09:22

Quote:

Originally Posted by simrego (Post 717653)
Hi!
In chtMultiRegionFoam you have regions. So you have to add the "-region regionName" switch to your command, where regionName is the name of the region where you have that patch.

Hi Simrego,

thank you for your reply! I have also tried with the "-region <region>", but when i do that I don't get a data file generated. After I posted this I tried just about every possible combination I could to no avail haha.

I'll assume it's a deeper rooted problem. Thanks for the help though!

Arthur

simrego December 3, 2018 09:38

Ooo sorry. Maybe I know your problem.
You just ran "postProcess -func patchAverage", right?
Try with "chtMultiRegionSimpleFoam -postProcess -func patchAverage -region <regionName>",
or you can use directly like:
chtMultiRegionSimpleFoam -postProcess -func "patchAverage(name=<patchName>, p)" -region <regionName>


I've just tried. This is working perfectly for me:
chtMultiRegionSimpleFoam -postProcess -func "patchAverage(name=inlet, p)" -region fluid -latestTime

amdk136 December 4, 2018 07:01

Simrego,

Thank you again for your reply! I have tried that exactly how you have stated it, including the 'chtMultiRegionFoam' & also the 'region <region>' [as well as both with the "(name=patchName, field)" and without too], however no field data file is being created still.

Seems to be a very odd situation. I don't even get a post processing folder when I include the 'chtMultiRegionFoam' part.

Would it be possible for you to upload your case directory, please? So that I can see how you have it organised etc. And to see what I'm missing! (I understand if you'd rather not as well)

Thank you again,
Arthur

simrego December 4, 2018 14:41

Sorry, I can't share that case with you, but you can try it on any tutorial case. If it's not working I think the problem will be in your OF.
Maybe you are using an old version with a bug? Or had you any problems during the compilation? Or just a typo in the command? Or try with a different function, ie. patchIntegrate (just for a try).

amdk136 December 5, 2018 06:09

Quote:

Originally Posted by simrego (Post 717954)
Sorry, I can't share that case with you, but you can try it on any tutorial case. If it's not working I think the problem will be in your OF.
Maybe you are using an old version with a bug? Or had you any problems during the compilation? Or just a typo in the command? Or try with a different function, ie. patchIntegrate (just for a try).


Simrego,



I have just run my case again and used the command you gave above (adapted for my case):
Code:

chtMultiRegionFoam -postProcess -func "patchAverage(name=cyclicFluidInlet, p_rgh)" -region water -latestTime

I was running the postProcess tool without "-latestTime" which was my problem as I didn't notice it on my phone. Posting again incase anyone else has the same problem as me



Thank you very much for your help again,
Arthur


All times are GMT -4. The time now is 12:24.