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

trouble running simpleCar case; fails at fieldAverage

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2021, 17:18
Default trouble running simpleCar case; fails at fieldAverage
  #1
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 283
Rep Power: 6
boffin5 is on a distinguished road
Hi, in order to learn how to simulate car heat exchangers, I am trying to run the simpleCar tutorial that I found in v2012, by first converting it to OpenFoam8. I have focused on the latter version, and until now have been able to adapt v2012 cases.
The trouble arises when I run simpleFoam, and get the following error message:
Code:
Create time

Create mesh for time = 0


SIMPLE: Convergence criteria found
        p: tolerance 0.01
        U: tolerance 0.0001
        "(k|epsilon)": tolerance 0.0001

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
RAS
{
    RASModel        kEpsilon;
    turbulence      on;
    printCoeffs     on;
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              0;
    sigmak          1;
    sigmaEps        1.3;
}

No MRF models present

Creating finite volume options from "system/fvOptions"

Selecting finite volume options model type explicitPorositySource
    Source: porosity1
    - selecting cells using cellZone porousZone
    - selected 10 cell(s) with volume 0.002
Porosity region porosity1:
    selecting model: DarcyForchheimer
    creating porous zone: porousZone

Starting time loop


--> FOAM FATAL IO ERROR: 
keyword type is undefined in dictionary "/home/boffin5/cfdaero/simpleCar/system/controlDict/functions/fieldAverage"

file: /home/boffin5/cfdaero/simpleCar/system/controlDict/functions/fieldAverage from line 6 to line 16.

    From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const
     in file db/dictionary/dictionary.C at line 797.
It seems to fail on the term 'fieldAverage'. I have looked in the V8 tutorials for examples, and tried to incorporate them into the controlDict, which here shows my different attempts:
Code:
application     simpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         5000;

deltaT          1;

writeControl    timeStep;

writeInterval   100;

purgeWrite      10;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
    //#include "forceCoeffs"
    
    //#include "fieldAverage"
    
    #includeFunc fieldAverage(U, p, prime2Mean = yes)
    
    //#includeFunc fieldAverage      //(U, p, prime2Mean=yes)
    
    //#include "runTimeControls"
 }
Apparently I have to add a line with #includeFunc, but I can't find the format that will make it work. In addition to the above, I also tried includeFunc with just U & p, but no dice. I would appreciate any ideas on how to resolve this problem.
boffin5 is offline   Reply With Quote

Old   July 18, 2021, 14:12
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
Alan

for details on fieldAverage, check out the Doxygen page: https://cpp.openfoam.org/v8/classFoa...e.html#details. This has an example of its usage.

However, I am confused - fieldAverage is a functionObject for doing time averaging of transient runs ... but you are trying use it in a simpleFoam run, which clearly makes no sense. Are you trying to get a spatial volume average? If so, you probably want something like: https://cpp.openfoam.org/v8/classFoa...e.html#details.
Tobermory is offline   Reply With Quote

Old   July 28, 2021, 14:50
Default found a improved version of simpleCar tutorial
  #3
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 283
Rep Power: 6
boffin5 is on a distinguished road
In the link below, the simpleCar tutorial from v2012 was modified and cleaned up. I was able to run the case.



https://develop.openfoam.com/Develop...4537a65abe171d
boffin5 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
[mesh manipulation] Case diverges after running renumberMesh in parallel sita OpenFOAM Meshing & Mesh Conversion 1 June 26, 2019 08:24
Trouble with parallel runs cfdmarkus OpenFOAM Running, Solving & CFD 9 February 27, 2009 04:59
Statically Compiling OpenFOAM Issues herzfeldd OpenFOAM Installation 21 January 6, 2009 10:38
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
How to save a case running in background us FLUENT 0 July 6, 2005 11:43


All times are GMT -4. The time now is 10:28.