|
[Sponsors] |
flowRatePatch for multiple patches simultaneously |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 29, 2017, 00:51 |
flowRatePatch for multiple patches simultaneously
|
#1 |
New Member
Kaushik Mallick
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
I am trying to process data during run time of an OF model. I can successfully output volume flow rate through a specific patch (say outlet) per instructions here:
https://cfd.direct/openfoam/user-gui...rocessing-cli/ However, I would like to output flow rates for more than one patch, say for both inlet and outlet. Specifically I would like to dump the data like this in two columns: _________ Inlet______Outlet time______x.xx_______y.yy What changes do I need to make to my flowRatePatch file? This is my current one: HTML Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Calculates the flow rate through a specified patch by summing the flux on patch faces. For solvers where the flux is volumetric, the flow rate is volumetric; where flux is mass flux, the flow rate is mass flow rate. \*---------------------------------------------------------------------------*/ name outlet; #includeEtc "caseDicts/postProcessing/flowRate/flowRatePatch.cfg" // ************************************************************************* // |
|
December 29, 2017, 03:27 |
Swak4Foam
|
#2 |
New Member
Felix S
Join Date: Jun 2017
Posts: 11
Rep Power: 8 |
swak4foam is used to do runtime outputs/calculations/...
You need this in your controlDict Code:
functions{ massFlow { type patchMassFlow; outputControl timeStep; verbose true; patches ( inlet outlet ); factor 1; outputInterval 1; } } in case you only need the finished solution try: https://www.cfd-online.com/Forums/op...lculation.html |
|
December 29, 2017, 14:19 |
|
#3 |
New Member
Kaushik Mallick
Join Date: Jan 2017
Posts: 10
Rep Power: 9 |
Thanks for your help and suggestion. I tried your method and I got:
HTML Code:
[5] --> FOAM FATAL ERROR: [5] Unknown function type patchMassFlow I would also prefer to use OF's built-in function of flowRatePatch. Its working perfectly for one defined surface (outlet). I thought that it may be simple to add another surface to the output column. I tried this in flowRatePatch, but OF didn't like that ether HTML Code:
name (inlet outlet); #includeEtc "caseDicts/postProcessing/flowRate/flowRatePatch.cfg" |
|
January 2, 2018, 02:39 |
libs included?
|
#4 |
New Member
Felix S
Join Date: Jun 2017
Posts: 11
Rep Power: 8 |
If you have swak compiled and working I guess you also have the libs in the controlDict ?
I use Code:
"libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" Then you could define your own expression for massFlow, but I believe I cannot help you with rewriting the flowRatePatch function from OF. |
|
March 31, 2018, 00:50 |
flowRatePatch for multiple patches simultaneously
|
#5 |
New Member
Ali Mohammadi
Join Date: Oct 2017
Posts: 15
Rep Power: 8 |
i finally became able of solving this issue.
By writing a bash file it is possible to calculate flow rate patch on different boundaries. Here i leave the linux command: sed -i "s/name inlet;/name outlet;/g" system/flowRatePatch |
|
May 9, 2019, 13:38 |
|
#6 | |
Member
Join Date: Mar 2019
Posts: 81
Rep Power: 7 |
Quote:
Hi Felix, Seems like OpenFOAM 18 users cannot use swak4foam. I also cannot get flowRatePatch running due to the following warning (simulation continues without patch calculation): Starting time loop --> FOAM Warning : From function bool Foam::functionObjectList::read() in file db/functionObjects/functionObjectList/functionObjectList.C at line 738 Reading "/home/mm/OpenFOAM/OpenFOAM-v1812/20190509/system/controlDict" Entry name is not a dictionary Any thoughts on this are most appreciate |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 91 | December 21, 2022 04:50 |
Possible bug with stitchMesh and cyclics in OpenFoam | Jack001 | OpenFOAM Pre-Processing | 0 | May 21, 2016 08:00 |
[mesh manipulation] mirrorMesh and undoing the joining of patches | chegdan | OpenFOAM Meshing & Mesh Conversion | 3 | October 21, 2015 08:09 |
Cyclic boundaries in OF 21x | morard | OpenFOAM | 25 | May 13, 2013 22:35 |
Regarding periodic BC in ICEM generated grid | Tarak | OpenFOAM | 32 | April 30, 2013 14:46 |