|
[Sponsors] |
how to calculate the volume averaged values in version 4.1 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 20, 2017, 13:04 |
how to calculate the volume averaged values in version 4.1
|
#1 |
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12 |
Dear all,
I have used the commands below to calculate the volume averaged values for version 3.0.1 and it works fine for me. Code:
functions ( functionObjects_all_volAverage { type cellSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl timeStep; outputInterval 2000; log false; valueOutput false; source all; sourceName none; operation volAverage; fields ( p U ); } probes { // Where to load it from functionObjectLibs ( "libsampling.so" ); type probes; // Name of the directory for probe data name probes; // Write at same frequency as fields outputControl timeStep; //outputInterval 1; // Fields to be probed fields ( U ); probeLocations ( ( 0 0.5 0 ) ( 1 0.5 0 ) ( 0.5 0 0 ) ); } ); and modified as Code:
functions { cellObj1 { type volRegion; libs ("libfieldFunctionObjects.so"); enabled true; writeControl timeStep; writeInterval 2000; log false; writeFields false; regionType cellZone; name 0(); operation volAverage; fields ( p U ); } probes { // Where to load it from libs ( "libsampling.so" ); type probes; // Name of the directory for probe data name probes; // Write at same frequency as fields writeControl timeStep; //outputInterval 1; // Fields to be probed fields ( U ); probeLocations ( ( 0 0.5 0 ) ( 1 0.5 0 ) ( 0.5 0 0 ) ); } } Code:
[11] --> FOAM FATAL IO ERROR: [11] wrong token type - expected word, found on line 0 the label 0 [11] [11] file: IOstream.functions.cellObj1.name at line 0. [11] [11] From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&) [11] in file primitives/strings/word/wordIO.C at line 74. [11] FOAM parallel run exiting [11] Best Regards, Bill Last edited by 6863523; February 20, 2017 at 14:02. Reason: wrong info |
|
February 21, 2017, 04:50 |
fieldAverage function in controlDict
|
#2 |
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12 |
BTW: I have found the fieldAverage function. I wonder what is the difference between the fieldAverage and the volume average.
Code:
fieldAverage1 { type fieldAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); enabled true; outputControl outputTime; outputInterval 100; fields ( U { mean on; prime2Mean on; base time; } p { mean on; prime2Mean on; base time; } ); } Any suggestion is appreciated. Best Regards, Bill |
|
February 21, 2017, 05:33 |
|
#3 |
New Member
Join Date: Apr 2013
Posts: 20
Rep Power: 13 |
Hi,
I am working with 1612+ version. Here is a minimal working example to calculate volume averaged value. I tested it over pitzdaily. I works like a charm. Code:
functions { volumeAverage { type volFieldValue; libs ("libfieldFunctionObjects.so"); log true; writeControl writeTime; writeFields true; regionType all; operation volAverage; fields ( p U ); } } Nathanaël. |
|
February 21, 2017, 05:45 |
failed
|
#4 | |
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12 |
Quote:
Thank you for the reply. I have tested the code, but got an error. Code:
[11] --> FOAM FATAL ERROR: [11] Unknown function type volFieldValue Thank you. Best Regards, Bill |
||
February 21, 2017, 05:53 |
|
#5 |
New Member
Join Date: Apr 2013
Posts: 20
Rep Power: 13 |
Hi,
Nice to hear that you found a solution. The discrepancy may arise from the differences between our OpenFOAM versions. Best regards, Nathanaël. |
|
February 21, 2017, 06:09 |
|
#6 | |
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12 |
Quote:
Thank you very much for your professional reply. It is really helpful and saved me a lot of time. I wonder if you have experience with the bash script execution to start the case running. I have posted the problem here #13-#18 error when compile a new solver on version 4.1 Forget about the "functions" problem, because you just solved it. Thank you for your time and kind help. Best Regards, Bill |
||
December 9, 2017, 05:22 |
How to calculate the volume averaged values only in a part of the domain
|
#7 |
Senior Member
Bill Wang
Join Date: Aug 2014
Posts: 109
Rep Power: 12 |
Dear Nathanaël,
I wonder if you have any experience of calculating the volume averaged values only in a part of the domain, say, the values averaged in a 1/3 of the fluid domain? Thank you in advance. Best Regards, Bill |
|
January 5, 2018, 12:43 |
volRegion in chtMultiRegionSimpleFoam
|
#8 |
Member
Join Date: Sep 2016
Posts: 63
Rep Power: 10 |
Dear Foamers,
I cannot excute volRegion in chtMultiRegionSimpleFoam, although this functionObject works fine for pimpleDyMFoam. In the controlDict I wrote almost the same, except field "p" for pimpleDyMFoam and field "T" for chtMultiRegionSimpleFoam. Code:
functions { volRegion1 { type volRegion; libs ("libfieldFunctionObjects.so"); writeFields true; regionType cellZone; name heater; operation volAverage; fields ( T ); } } Thank you very much in advance! Best regards, sitajeje |
|
November 9, 2020, 12:14 |
|
#9 | |
Member
Bineet Mehra
Join Date: Aug 2013
Posts: 61
Rep Power: 13 |
Quote:
|
||
November 15, 2020, 11:40 |
|
#10 |
Senior Member
Join Date: Oct 2017
Posts: 133
Rep Power: 9 |
This is working in OpenFOAM 8:
Code:
volAverage { libs ("libfieldFunctionObjects.so"); type volFieldValue; operation volAverage; region fluid; fields (T); writeFields false; } |
|
February 4, 2021, 21:03 |
|
#11 |
New Member
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
||
April 14, 2021, 07:30 |
|
#12 | |
New Member
Carlo Cintolesi
Join Date: Jan 2013
Posts: 1
Rep Power: 0 |
Quote:
I'm trying to use the same function but it does not work for me in OpenFOAM 8. I have added the lines you report in my controlDict, like this: Code:
functions { volAverage { libs ("libfieldFunctionObjects.so"); type volFieldValue; operation volAverage; //region fluid; fields (T); writeFields false; } } Code:
--> FOAM FATAL IO ERROR: keyword type is undefined in dictionary "controlDict/functions/volFieldValue" file: controlDict/functions/volFieldValue from line 6 to line 15. From function const Foam::entry& Foam::dictionary::lookupEntry(const Foam::word&, bool, bool) const in file db/dictionary/dictionary.C at line 797. Do you have any suggestion? How do you make it work? Thank you in advance, Best Carlo |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reporting volume averaged temperature | dsfakianakis | FLUENT | 5 | March 30, 2021 08:20 |
How to calculate Statistical values (Mean, Mode, Median, Standard Deviation, etc..) | Mukkarum | Tecplot | 1 | February 1, 2017 20:50 |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
Calculate averaged value (mass- or area-weighted) on type:interior boundary conditio | jorbuiga | Fluent UDF and Scheme Programming | 0 | June 25, 2012 10:36 |
calculate values for eps and k from Re or u????? | sbar | OpenFOAM Pre-Processing | 5 | August 16, 2010 05:10 |