CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Error with flowRatePatch in controlDict

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2022, 16:44
Default Error with flowRatePatch in controlDict
  #1
New Member
 
Andy Somogyi
Join Date: Jul 2017
Posts: 5
Rep Power: 9
Andy Somogyi is on a distinguished road
Hey all, trying to output the flow rate though a patch. It works fine from the command line like:

postProcess -func 'flowRatePatch(name=ex)'

However if I put it in the controlDict in functions block like:


functions
{
#includeFunc flowRatePatch(name=ex)
}



I get the error that it can't find the 'phi' field when using the 'postProcess' command:

Reading fields:

Executing functionObjects
surfaceFieldValue flowRatePatch(name=ex) write:
total faces = 806
total area = 0.0008833

--> FOAM Warning :
From Foam::label Foam::functionObjects::fieldValues::surfaceFieldVa lue::writeAll(const vectorField&, const Foam::Field<Type>&, const pointField&, const faceList&) [with WeightType = double; Foam::label = int; Foam::vectorField = Foam::Field<Foam::Vector<double> >; Foam:ointField = Foam::Field<Foam::Vector<double> >; Foam::faceList = Foam::List<Foam::face>]
in file fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C at line 381
Requested field phi not found in database and not processed



How do I fix the controlDict so that postProcess works right?

thanks
Andy Somogyi is offline   Reply With Quote

Old   October 13, 2022, 01:04
Default
  #2
Member
 
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 14
LongGe is on a distinguished road
Hi

How about doing the following?

$ <using solver name> -postprocess -func 'flowRatePatch(name=ex)'

For example using simpleFoam
$ simpleFoam -postprocess -func 'flowRatePatch(name=ex)'
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/
Powered by Ennova : https://ennova-cfd.com/
Ennova's Channel Partners : http://www.wolfdynamics.com/
LongGe is offline   Reply With Quote

Old   October 13, 2022, 01:40
Default
  #3
New Member
 
Andy Somogyi
Join Date: Jul 2017
Posts: 5
Rep Power: 9
Andy Somogyi is on a distinguished road
Quote:
Originally Posted by LongGe View Post
Hi

How about doing the following?

$ <using solver name> -postprocess -func 'flowRatePatch(name=ex)'

For example using simpleFoam
$ simpleFoam -postprocess -func 'flowRatePatch(name=ex)'
That does work, along with just

"postprocess -func 'flowRatePatch(name=ex)"

But I'd like to add more functions to the controlDict, and I'm trying to figure out why the 'phi' field doesn't seem to be available for controlDict post process functions, when run with the "postProcess" command.
Andy Somogyi is offline   Reply With Quote

Old   October 13, 2022, 02:23
Default
  #4
Member
 
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 14
LongGe is on a distinguished road
Hi



The answer can be found here. "6.2.4 Solver post-processing" as https://doc.cfd.direct/openfoam/user...processing-cli
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/
Powered by Ennova : https://ennova-cfd.com/
Ennova's Channel Partners : http://www.wolfdynamics.com/
LongGe is offline   Reply With Quote

Old   October 15, 2024, 00:56
Default
  #5
chc
New Member
 
Join Date: Nov 2023
Posts: 18
Rep Power: 3
chc is on a distinguished road
What is the difference between using just postProcess -func functionObjectDict as opposed to the longer solverName -postProcess -func functionObjectDict ? For some reason I'm having some processes work with one or the other, and I'm not sure why
chc is offline   Reply With Quote

Old   October 15, 2024, 04:40
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
With solverName -postProcess, the solver starts, loads the required model, and does the post processing operations.

postProcess is an standalone application which will basically read the variables and do the post processing operations.

Some function objects are just doing operations on variables, others require access to data related to models used by the solvers. For the latter, postProcess will fail because the required models are not loaded by postProcess.

For instance, you cannot use the yPlus function object with postProcess because it requires to access to the turbulence model.

AFAIK, everything you can do with postProcess should also work with solverName -postProcess. Or at least I don't really see why it would not.
chc likes this.
Yann is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
InterFoam (PimpleFoam) not obeying DeltaT in ControlDict walakaka OpenFOAM Running, Solving & CFD 2 March 1, 2018 13:57
sampleDict and controlDict musahossein OpenFOAM Post-Processing 39 July 17, 2016 11:00
controlDict and sampleDict giving different results Shenan OpenFOAM Post-Processing 2 November 15, 2014 11:15
Forces not calculated when including a library in controlDict fusij OpenFOAM 2 May 13, 2011 08:25
writing controlDict as otherfields ubaid OpenFOAM 5 September 29, 2010 08:28


All times are GMT -4. The time now is 23:33.