|
[Sponsors] |
August 15, 2016, 03:46 |
postProcess functionality in openFOAM 4
|
#1 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Hi All
I am switching to openFOAM 4 from 2.3.1 Currently working on the postProcess utility. I have run the motorbike tutorial to get a understanding on the new syntax. I then disabled the #inlcude files in the controlDict. I did this to try and run those files through the postProcess utility. I had sucess with "streamlines" - Code:
postProcess -func streamLines "cuttingPlane" - Code:
postProcess -func cuttingPlane "forceCoeffs" - Code:
postProcess -func forceCoeffs "wallBoundedStreamLines" - Code:
postProcess -func wallBoundedStreamLines so this is a two part question. Can anyone explain why these files wont work through this utility? In the case of the the forceCoeffs file i get the following error: Code:
--> FOAM FATAL ERROR: Could not find U, p Code:
--> FOAM FATAL ERROR: Cannot find field UNear Valid scalar fields are: 2 ( k p ) Valid vector fields are:1(U) So i then tried to run the nearWallField section of the file alone. I have not altered the file in anyway, i cut the one dictionary out form the original wallBoundedStreamLines file, and ran the code attached and got the following error Code:
--> FOAM FATAL IO ERROR: wrong token type - expected word, found on line 19 the punctuation token '(' file: /home/erfort/OpenFOAM/erfort-4.0/tutorials/incompressible/simpleFoam/motorBike/system/near.near.fields at line 19. From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&) in file primitives/strings/word/wordIO.C at line 74. FOAM exiting Code:
--> FOAM FATAL IO ERROR: Expected a '(' while reading Tuple2, found on line 19 the word 'U' file: /home/erfort/OpenFOAM/erfort-4.0/tutorials/incompressible/simpleFoam/motorBike/system/near.near.fields at line 19. From function Foam::Istream& Foam::Istream::readBegin(const char*) in file db/IOstreams/IOstreams/Istream.C at line 92. I look forward to the replies Regards |
|
August 18, 2016, 08:14 |
|
#2 |
New Member
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 10 |
Hello
Take a look here: http://cfd.direct/openfoam/user-guid...#x31-2270006.2 For the first function, try this : postProcess -fields "(p U)" -func forceCoeffs About that second one i'm not sure, but i will take a look at it later. Regards, Igor Carvalho |
|
August 18, 2016, 08:36 |
|
#3 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Hi Igor
Thanks for the reply, I tried using the line you suggested, it now reads the fields , but got the following reply Code:
--> FOAM FATAL ERROR: No valid model for viscous stress calculation From function Foam::tmp<Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::functionObjects::forces::devRhoReff() const I then ran the following line Code:
postProcess -func 'forcesIncompressible('bladeBot',p,U)' Full output in attachment Regards |
|
August 18, 2016, 09:12 |
|
#4 |
New Member
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 10 |
Hello
Well i'm not quite sure my friend. I never had to use that function before so i can't say for sure, but i think that is correct, try that. Let us know if it works. Regards |
|
September 4, 2016, 13:45 |
|
#5 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
solution... READ THE USER GUIDE.
So while i have read the user guide more than once, they tend to update along with the openFOAM versions. The solution to my problem was to add the solver info. Code:
simpleFoam -postProcess -func 'forces' -latestTime Had i read the book... i would see said answer. Thanks Igor for the help though. Each step counts! Hope this helps someone eventually |
|
September 4, 2016, 13:56 |
|
#6 |
New Member
Igor Leonardo
Join Date: Jul 2016
Location: Brazil - SP - SJC
Posts: 20
Rep Power: 10 |
Yeah nice.
Now that i look at the error you were getting i realize that the solver info was needed, it is good habit perhaps, to also use the solver info on all functions for postprocessing. Best regards, Igor |
|
September 21, 2016, 03:42 |
How to specify patch name
|
#7 |
New Member
Dan Nielsen
Join Date: Mar 2014
Posts: 4
Rep Power: 12 |
Hey All
I am trying to use the postProcess utility to calculate a patch average by using: postProcess -func 'patchAverage' it tells me that it needs a patch name: surfaceRegion patchAverage: patch(<patchName>): Unknown patch name: <patchName>. Valid patch names are: 3 ( movingWall fixedWalls frontAndBack ) But it seems that i cant finde a way to specify that patch name, can anyone help me? |
|
September 21, 2016, 03:54 |
|
#8 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Hi Dan
After you specify the function you also need to tell it where to look. try the following Code:
postProcess -func "patchAverage(field,name=fixedWalls)" |
|
September 21, 2016, 07:57 |
|
#9 |
New Member
Dan Nielsen
Join Date: Mar 2014
Posts: 4
Rep Power: 12 |
Hi bullmut
Thanks it works. Dan. |
|
November 24, 2016, 11:26 |
how to calculate grad(rho)&grad(U)
|
#10 |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 11 |
Hey all
I want to calculate the gradient of density and velocity. Here is what I type: postProcess -fields '(rho U)' -func 'grad' Returns: Reading fields: volScalarFields: rho volVectorFields: U Executing funtionObjects -->FOAM Warning : fuctionObject grad: Cannot find require field <fieldName> anyone know how to fix it? Thanks |
|
November 24, 2016, 12:04 |
|
#11 |
Member
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 16 |
Hi Harvee
Try the line Code:
postProcess -func "grad(U)" |
|
November 24, 2016, 12:16 |
|
#12 |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 11 |
Hi bullmut
thanks for the quick reply. I tried your code get I get this: Executing functionObjects --> FOAM Warning : From function bool Foam::functionObjects::regionFunctionObject::store (Foam::word&, const Foam::tmp<T>&, bool) [with ObjectType = Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>] in file home/OpenFOAM/OpenFOAM-4.0/src/OpenFOAM/lnInclude/regionFunctionObjectTemplates.C at line 61 Cannot store cache-able field with the named used in the cache. Either choose a different name or cache the field and use the 'writeObjects' functionObject. --> FOAM Warning : functionObject grad: Cannot find required field U I tried a lot of combination of fields and func ,none of them worked. and when I try to get grad(rho), the rho file doesn't exist in my 0 folder since I'm using rhoCentralFoam, I thought that maybe affect the searching of rho, do you know how to calculate rho for 0 folder btw? |
|
November 27, 2016, 23:48 |
Lift Coeff error
|
#13 |
New Member
H salem
Join Date: Nov 2016
Posts: 4
Rep Power: 9 |
Hi Dear friends,
I have problem with using post processing tool. When I want to use the Force coefficient tool to find out about Cl, Cd, Cm there is problem with this type: --> FOAM FATAL ERROR: Could not find rho From function void Foam::functionObjects::forces::initialise() in file forces/forces.C at line 197. FOAM exiting Any idea? this is my Code: /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Web: www.OpenFOAM.org \\/ M anipulation | ------------------------------------------------------------------------------- Description Calculates lift, drag and moment coefficients by summing forces on specified patches for a case where the solver is incompressible (pressure is kinematic, e.g. m^2/s^2). \*---------------------------------------------------------------------------*/ forces { type forces; functionObjectLibs ("libforces.so"); writeControl timeStep; writeInterval 10; patches ( "airfoil.*" ); pName p; UName U; rhoName rhoInf; log true; CofR (0.25 0 0); rhoInf 1.284; } forceCoeffs { type forceCoeffs; functionObjectLibs ( "libforces.so" ); writeControl timeStep; writeInterval 10; patches ( "airfoil.*" ); pName p; UName U; rhoName rhoInf; log true; liftDir (0 1 0); dragDir (1 0 0); CofR (0.25 0 0); pitchAxis (0 0 1); magUInf 6.69; rhoInf 1.284; lRef 1; Aref 1; } |
|
November 28, 2016, 01:40 |
Calculate grad(U) & MachNo
|
#14 |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 11 |
Hey there!
grad(U) func seems can only deal one time directory once a time. Until the bug is resolved, you can only calculate grad(U) for one time directory. You can add one of the time options, e.g -time <timeDir> or -latestTime, to select a specific time directory. For all time directories, the following will work in the meantime,make a script and put this in: for d in $(foamListTimes) ; do postProcess -time $d -func "grad(U)" ; done Additional info: for machNo solvername -postProcess -func MachNo many command seems need to specify the solvername. The point about Mach number is you cannot do "pure" post-processing using data in time directories, because it also requires thermophysical models. |
|
November 28, 2016, 01:44 |
|
#15 |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 11 |
try this:
<solvername> -postProcess -func "forceCoeffsCompressible" |
|
November 28, 2016, 11:23 |
|
#16 |
New Member
H salem
Join Date: Nov 2016
Posts: 4
Rep Power: 9 |
Thank you harvee for your time.
your suggestion will work after the simulation is done. but I this problem doesn't let the simulation start. am I right? if not, where should I include your suggestion? |
|
November 28, 2016, 11:34 |
|
#17 | |
New Member
Join Date: May 2015
Posts: 9
Rep Power: 11 |
Quote:
Maybe I misunderstood your problem. you're right,my case is doing some post-process after the simulation is done. I've never used Run-time data processing.sorry I can't help you. the only thing I can find related is on this page:http://cfd.direct/openfoam/user-guid...#x31-2270006.2 let me know if you figure it out. |
||
November 28, 2016, 11:39 |
|
#18 |
New Member
H salem
Join Date: Nov 2016
Posts: 4
Rep Power: 9 |
Dear Harvee,
Thank you. Yes I have found the solution. it seems that I was using the old method of finding the force coefficients. in openfooam 4, there is a package that let you use it more easily. all you need is to see the user guide section 6.2.2. |
|
January 1, 2017, 17:29 |
Gradient of Field - Gradient of Velocity in OpenFoam
|
#19 |
New Member
Vijaya Kumar. G
Join Date: Jun 2016
Location: Chennai, India & Aachen, Germany
Posts: 20
Rep Power: 10 |
Dolution
After lots of trouble this works I used in pimpleFoam solver. In OF4.0 it is necessary to specify the solver name pimpleFoam -postProcess -func "grad(U)" |
|
January 17, 2017, 10:14 |
|
#20 |
New Member
Join Date: Sep 2012
Posts: 13
Rep Power: 15 |
Helly everyone,
I am trying to calculate the rho field from a sonicFoam case. In previous versions of OpenFOAM this was apparently possible using Code:
execFlowFunctionObjects https://www.cfd-online.com/Forums/op...tml#post254920 In OF4 however, this doesn't seem to work anymore and the following message appears: Code:
execFlowFunctionObjects has been superceded by the '-postProcess' solver command-line option I still can't figure out how to calculate the rho field by either using the postProcess utility or the former solution above. Any help is highly appreciated, thank you very much! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 15:54 |
OpenFOAM Training Beijing 22-26 Aug 2016 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | May 3, 2016 04:57 |
OpenFOAM Foundation releases OpenFOAMŪ 3.0.0 | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 1 | November 7, 2015 15:16 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 06:55 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 18:07 |