|
[Sponsors] | |||||
[swak4Foam] Error using patchAverage from swak4Foam |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
Luca
Join Date: Mar 2011
Location: Italy
Posts: 62
Rep Power: 16 ![]() |
Dear all,
I want to write the an average field on two patches, namely inlet and outlet of a duct, using the functionObject patchAverage from swak4Foam. The code I entered in controlDict file is the foloowing: Code:
velAreaWeightAvg
{
type patchAverage;
verbose true;
fields
(
Uz
);
patches
(
inlet
outlet
);
factor 1.0;
outputControlMode outputTime;
outputInterval 1;
allowCoupled true; // because the patches are cyclic coupled
}
Code:
--> FOAM Warning :
From function probes::read()
in file patch/patchFieldFunctionObject/patchFieldFunctionObject.C at line 100
Unknown field Uz when reading dictionary ".patchAverage"
Can only probe registered volScalar, volVector, volSphericalTensor, volSymmTensor and volTensor fields
Time = 17000
Operating in no-flow mode; no models will be loaded. All vol, surface and point fields will be loaded.
Reading volScalarField Uz
Reading volScalarField Uy
Reading volScalarField nut
Reading volScalarField Ux
Reading volScalarField p
Reading volScalarField k
Reading volScalarField epsilon
Reading volVectorField wallShearStress
Reading volVectorField U
Reading surfaceScalarField phi
Thank you in advance, Luca |
|
|
|
|
|
|
|
|
#2 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 52 ![]() ![]() |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
|
||
|
|
|
#3 |
|
Member
Luca
Join Date: Mar 2011
Location: Italy
Posts: 62
Rep Power: 16 ![]() |
Dear Bernhard,
first of all thank you very much for your quick reply. I want to obtain an area weighted average value of some variables and therefore I opted for patchAverage from libSimpleFunctionObjects, as described at the following link: http://openfoamwiki.net/index.php/Co...unctionObjects Now I managed to solve the problem using the following code: Code:
velAvg2
{
type patchExpression;
variables
( "UzAvg{patch'inlet}=sum(Uz*area())/sum(area());" );
accumulations (
min
max
);
patches (
inlet
);
expression "UzAvg";
verbose true;
allowCoupled true;
}
Could you please make an example of how using the replayTransientBC and/or funkyPythonPostproc to "preload" the necessary fields for my problem? Thank you very much in advance. Luca P.S. I forgot to point out that I installed swak4Foam for OF 2.3.0 |
|
|
|
|
|
|
|
|
#4 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 52 ![]() ![]() |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
|
||
|
|
|
#5 |
|
Member
Luca
Join Date: Mar 2011
Location: Italy
Posts: 62
Rep Power: 16 ![]() |
Dear Bernhard,
I am sorry...you're perfectly right...I am using simpleFoam (actually a modified version that includes a constant pressure drop source term). I use cyclic BC at the inlet and outlet patches of the duct. Here follows my controDict entries: Code:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
);
application simplePeriodicP; // based entirely on simpleFoam
startFrom startTime;
startTime 1;
stopAt endTime;
endTime 20000;
deltaT 1;
writeControl timeStep;
writeInterval 5;
purgeWrite 5;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
functions
(
patchAverage
{
type patchAverage;
verbose true;
fields
( Uz );
patches
(
inlet
outlet
);
factor 1.0;
outputControlMode outputTime;
outputInterval 1;
allowCoupled true;
}
);
Luca |
|
|
|
|
|
|
|
|
#6 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 52 ![]() ![]() |
Quote:
1. usual fields are created in createFields.H 2. time-loop starts. The functionObjects are initialized. patchAverage doesn't find Uz in memory and removes it from the list (warning) 3. Uz gets created (or read) 4. Usual time-step calculations 5. patchExpression is evaluated. It finds Uz in memory and therefor produces a result
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| InterDyMFoam+simpleFunctionObject | Elham | OpenFOAM Running, Solving & CFD | 5 | July 10, 2017 12:59 |
| source term in near wall cell | rajcfd | OpenFOAM Pre-Processing | 5 | February 1, 2016 11:31 |
| [swak4Foam] Install swak4Foam on OpenFOAM1.7.1 on Ubuntu 13.04 | kobayashi | OpenFOAM Community Contributions | 2 | January 5, 2014 18:33 |
| [swak4Foam] Unknown function patchAverage in swak4Foam (Control Dict) | franzi_ | OpenFOAM Community Contributions | 17 | December 1, 2013 14:53 |
| [swak4Foam] fails in parallel with -otherTime? | Phicau | OpenFOAM Community Contributions | 3 | June 26, 2013 14:00 |