|
[Sponsors] | |||||
execFlowFunctionObjects - unknown field problem |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 18 ![]() |
Hi,
I would like to calculate the patchMassFlowAverage of a scalar at a patch with execFlowFunctionObjects utility. Everything seems to be fine when I run the solver, it calculates and outputs the values as expected. system/contolDict Code:
functions
{
massFlowAverageT
{
type patchMassFlowAverage;
functionObjectLibs ( "libsimpleFunctionObjects.so" );
fields ( T );
patches
(
myBoundaryPatchName
);
factor 1.0;
verbose true;
}
}
Code:
execFlowFunctionObjects -time 0.1
Create time
Create mesh for time = 0.1
Time = 0.1
Reading phi
Reading U
Reading p
The error message: Code:
--> FOAM Warning :
From function probes::read()
in file patch/patchFieldFunctionObject/patchFieldFunctionObject.C at line 91
Unknown field T when reading dictionary "/home/user/OpenFOAM/user-2.0.x/run/projects/case/system/controlDict::functions::massFlowAverageT"
Can only probe registered volScalar, volVector, volSphericalTensor, volSymmTensor and volTensor fields
Thank you! |
|
|
|
|
|
|
|
|
#2 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
Greetings Tibor,
Mmm, I don't have much experience with this utility, but after looking at the source code (available online here), it looks like the T field might be read if your case has RAS or LES properties. If that doesn't work, two other possibilities arise:
Best regards, Bruno
__________________
Last edited by wyldckat; September 17, 2011 at 05:13. Reason: typo |
|
|
|
|
|
|
|
|
#3 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
Hello once again,
I think this deserved another post... I just saw that there was a major revamp of this utility, as shown here and here. Try building the latest OpenFOAM 2.0.x and run execFlowFunctionObjects with the new "-noFlow" option! Best regards, Bruno
__________________
|
|
|
|
|
|
|
|
|
#4 |
|
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 18 ![]() |
Hi Bruno,
thank you for your kind reply. I just got back here and noticed your last message. I have already started to make some modifications to the original utility but failed at some point. Should the new execFlowFunctionObjects fulfill my expectations, this issue can be pointless. However, I would be interested in the correct implement of my idea. I added the new "fields" option to this utility - I checked the reconstructPar util how to do so - but couldn't get it work. Code:
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< "calc Entry Point" << endl;
argList::addOption
(
"fields",
"list",
"specify a list of fields to be reconstructed. Eg, '(T0 T1 T2)' - "
"regular expressions not currently supported"
);
Info<< " Reading phi" << endl;
...
Code:
--> FOAM FATAL ERROR: Wrong number of arguments, expected 0 found 1 Invalid option: -fields I will have a look at the new features of execFlowFunctionObjects as well. Thank you! |
|
|
|
|
|
|
|
|
#5 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Tibor,
Ah, in these cases where things seem to come from thin air, look at the following files on the solver/utility folder in question:
So, if you want to continue developing your own utility:
![]() Best regards, Bruno
__________________
|
|
|
|
|
|
|
|
|
#6 |
|
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 18 ![]() |
Bruno, I really appreciate your comprehensive guide, thanks a lot!
With your help I have managed to assemble the new utility, everything is fine at compilation - so far so good ![]() But my field read falters, something is read in, but cannot be extracted out. For the sake of clarity, I limited the range of variables just to volScalarFields - so I set the fieldClassName to volScalarField :: DimensionedInternalField, and maybe this is the point where I miss something. I have the variable T as volScalarField and this is the variable I'm interested in. Code:
execFlowFunctionObjectsAddFields -fields '(T)' -time 0.1 Code:
// New Code Start
HashSet<word> selectedFields;
if (args.optionFound("fields"))
{
args.optionLookup("fields")() >> selectedFields;
Info<< "fields option found" << endl;
}
const word& fieldClassName = DimensionedField<scalar, volMesh>::typeName;
Info<< fieldClassName << endl;
IOobjectList objects(mesh, runTime.timeName());
IOobjectList fields = objects.lookupClass(fieldClassName);
if (fields.size())
{
Info<< " Reading additional " << fieldClassName << "s\n" << endl;
}
else
{
Info<< "fields.size() = 0" << endl;
}
forAllConstIter(IOobjectList, fields, fieldIter)
{
if
(
selectedFields.found(fieldIter()->name())
)
{
Info<< " " << fieldIter()->name() << endl;
}
}
// New Code End
About the new execFlowFunctionObjects - it works like a charm with the -noFlow option. A quick question: how to update OF correctly? I made a git pull @ $WM_PROJECT_DIR folder, and if I remember correctly the bin and tutorial folder was gone amongst others and the Allwmake script was missing as well. So I deleted the whole stuff and made a fresh git clone and compiled it from the ground up. |
|
|
|
|
|
|
|
|
#7 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Tibor,
Sadly, I don't know enough yet about OpenFOAM's code to help you any further on the new utility My best suggestion would be to examine the new version of the utility and compare it with the old one, in order to figure out how things are really done or should be done. Here's the online commit difference log that shows what was changed: https://github.com/OpenFOAM/OpenFOAM...dc66aa85930451As for updating from the git repository, "git pull" should do the trick, but you stumbled upon something that was done back in the 15-17th of August when the OpenFOAM Foundation was initiated. In a nutshell: all files were removed in the last commits (only in the last commits), remaining only modified versions of README.{html,org} for people to read and figure out what to do... For more, you can read it here: https://github.com/OpenCFD/OpenFOAM-2.0.x/ As someone said: when in doubt, check the source ![]() Best regards, Bruno
__________________
|
|
|
|
|
|
|
|
|
#8 |
|
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 18 ![]() |
Bruno, thank you for all your help, hats off!
![]() The -noFlow option works just great + I have a better understanding of the underlying structure of the code and the compilation procedure. Thx again! |
|
|
|
|
|
|
|
|
#9 |
|
Member
Join Date: May 2014
Posts: 40
Rep Power: 13 ![]() |
Hi,
I'm experiencing the same problem as Toorop when postprocessing a case using function objects, except the -noFlow flag does not help. This occurs with OF2.3.1. The function object definition in system/controlDict looks like: Code:
libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
"libgroovyBC.so"
);
functions
(
massFlowAveragePtot
{
type patchMassFlowAverage;
functionObjectLibs
(
"libsimpleFunctionObjects.so"
);
outputControlMode timeStep;
outputInterval 1;
fields
(
ptot
);
patches
(
inlet
outlet
);
factor 1.0;
verbose true;
}
);
Code:
Create time
Create mesh for time = 1000
--> FOAM Warning :
From function SolverInfo::SolverInfo(const dictionary& dict,const objectRegistry &obr)
in file SolverInfo/SolverInfo.C at line 70
Can't find phi-field with name phi
Assumin incompressible solver
phi: phi
Compressible: 0
Turbulent: 0
LES: 0
--> FOAM Warning :
From function probes::read()
in file patch/patchFieldFunctionObject/patchFieldFunctionObject.C at line 100
Unknown field ptot when reading dictionary ".massFlowAveragePtot"
Can only probe registered volScalar, volVector, volSphericalTensor, volSymmTensor and volTensor fields
Time = 1000
Operating in no-flow mode; no models will be loaded. All vol, surface and point fields will be loaded.
Reading volScalarField ptot
Reading volScalarField p
Reading volVectorField U
Reading surfaceScalarField phi
End
Best regards, Philip |
|
|
|
|
|
|
|
|
#10 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
Greetings Philip,
I finally managed to take a look into this and I've now realized that I only mentioned the solution for that problem in the example case I have at https://github.com/wyldckat/execFunctionObjects/ - the solution for loading fields that aren't loaded automatically with the "-noFlow" option, can be loaded with another function object, for example: Code:
readFields
{
functionObjectLibs ( "libfieldFunctionObjects.so" );
type readFields;
fields (p U phi);
}
Bruno
__________________
|
|
|
|
|
|
|
|
|
#11 |
|
Member
Join Date: May 2014
Posts: 40
Rep Power: 13 ![]() |
Hi Bruno,
thank you for your help. I already found out by myself but forgot to post the answer, sorry about that ![]() Instead of libfieldFunctionObjects.so I'm using the libsimpleFunctionObjects.so: Code:
readExistingFields
{
functionObjectLibs
(
"libsimpleFunctionObjects.so"
);
type readAndUpdateFields;
fields (ptot);
}
Philip |
|
|
|
|
|
|
|
|
#12 |
|
New Member
gned
Join Date: Oct 2012
Posts: 18
Rep Power: 15 ![]() |
Hi Phil_ and wyldckat !
followed your precious posts and now, testing them on pitzdaily for instance, I can arrive to have > execFlowFunctionObjects to work , once added readExistingFields { functionObjectLibs ( "libsimpleFunctionObjects.so" ); type readAndUpdateFields; fields (p); }in the controlDict file . BUT if I leave this, the execution of the solver > simpleFoam on the contrary complains : --> FOAM FATAL ERROR: Field p does not exist SO how to save both the options to have the function objects to work ? Thanks |
|
|
|
|
|
|
|
|
#13 |
|
Member
Join Date: May 2014
Posts: 40
Rep Power: 13 ![]() |
Hi gned,
I'm using the functionObject only for post processing. This works via a dictionary and does not affect the solver: Code:
execFlowFunctionObjects -dict system/functionObjectsDict Best regards, Philip |
|
|
|
|
|
|
|
|
#14 |
|
New Member
gned
Join Date: Oct 2012
Posts: 18
Rep Power: 15 ![]() |
Yes ! the problem can be circumvented leaving the default dictionary of the functionObjects (controDict) clean and putting aside another user-created dictionary
functionObjectsDict like this one : Code:
functions
{
readExistingFields
{
functionObjectLibs
(
"libsimpleFunctionObjects.so"
);
type readAndUpdateFields;
fields ( p );
}
staticPressureNew
{
type staticPressureNew;
functionObjectLibs//start a new line here :
(
"libmyWork.so"// my own created lib
);
pName p;
rho 1.205;
outputControl outputTime;
}
}
and then execute the command >>execFlowFunctionObjects -dict system/functionObjectsDict Thank you ! i |
|
|
|
|
|
|
|
|
#15 |
|
Member
hannes
Join Date: Mar 2013
Posts: 47
Rep Power: 14 ![]() |
Hi,
unfortunately I ran into a similar Problem and so far have not been able to solve it with the Information posted here. I'm using chtMultiRegionFoam from OF3.0.1 to simulate a simple pipe flow (regions fluid="water" and solid="pipe"). When running Code:
execFlowFunctionObjects -region water -latestTime -dict system/postProcessingFunctionDict Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object postProcessingFunctionDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // functions { PatchMassFlowAverage { type patchMassFlowAverage; region water; // functionObjectLibs ( "libsimpleSwakFunctionObjects.so" ); patches ( INLET OUTLET ); fields ( T ); outputControlMode timeStep; outputInterval 1; verbose true; } } // ************************************************************************* // Code:
Create time
Create mesh water for time = 50000
Reading T
--> FOAM Warning :
From function SolverInfo::SolverInfo(const dictionary& dict,const objectRegistry &obr)
in file SolverInfo/SolverInfo.C at line 70
Can't find phi-field with name phi
Assumin incompressible solver
phi: phi
Compressible: 0
Turbulent: 0
LES: 0
Time = 50000
Reading phi
Reading U
Reading p
No finite volume options present
Selecting thermodynamics package
{
type heRhoThermo;
mixture pureMixture;
transport polynomial;
thermo hPolynomial;
equationOfState icoPolynomial;
specie specie;
energy sensibleEnthalpy;
}
Selecting turbulence model type RAS
Selecting RAS turbulence model kOmegaSST
Selecting patchDistMethod meshWave
kOmegaSSTCoeffs
{
...}
--> FOAM FATAL ERROR:
request for polyMesh pipe from objectRegistry pipe failed
available objects of type polyMesh are
1(salt)
From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/openfoam/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 198.
FOAM aborting
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::polyMesh const& Foam::objectRegistry::lookupObject<Foam::polyMesh>(Foam::word const&) const at ??:?
#3 Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() at ??:?
#4 Foam::mixedFvPatchField<double>::evaluate(Foam::UPstream::commsTypes) at ??:?
#5 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() at ??:?
#6 Foam::readAndUpdateFields::execute() at ??:?
#7 Foam::OutputFilterFunctionObject<Foam::readAndUpdateFields>::execute(bool) at ??:?
#8 Foam::functionObjectList::execute(bool) at ??:?
#9 ? at ??:?
#10 ? at ??:?
#11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12 ? at ??:?
Aborted (core dumped)
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
Create mesh water for time = 50000
--> FOAM Warning :
From function SolverInfo::SolverInfo(const dictionary& dict,const objectRegistry &obr)
in file SolverInfo/SolverInfo.C at line 70
Can't find phi-field with name phi
Assumin incompressible solver
phi: phi
Compressible: 0
Turbulent: 0
LES: 0
--> FOAM Warning :
From function probes::read()
in file patch/patchFieldFunctionObject/patchFieldFunctionObject.C at line 100
Unknown field T when reading dictionary "/home/hs/OpenFOAM/hs-3.0.0/run/Dynasalt/pipe/system/postProcessingFunctionDict.functions.PatchMassFlowAverage"
Can only probe registered volScalar, volVector, volSphericalTensor, volSymmTensor and volTensor fields
Time = 50000
Operating in no-flow mode; no models will be loaded. All vol, surface and point fields will be loaded.
Reading volScalarField kappa
Reading volScalarField rho
Reading volScalarField k
Reading volScalarField omega
Reading volScalarField alphat
Reading volScalarField nut
Reading volScalarField Cp
Reading volScalarField mu
Reading volScalarField p_rgh
Reading volScalarField alpha
Reading volScalarField p
Reading volScalarField T
Reading volScalarField h
Reading volVectorField U
Reading surfaceScalarField phi
Reading uniformDimensionedVectorField g
End
Code:
// readExistingFields
// {
// region water;
// type readAndUpdateFields;
// fields (T);
// }
readFields
{
functionObjectLibs ( "libfieldFunctionObjects.so" );
region water;
type readFields;
fields (T );
}
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
Create mesh water for time = 50000
Reading T
--> FOAM Warning :
From function SolverInfo::SolverInfo(const dictionary& dict,const objectRegistry &obr)
in file SolverInfo/SolverInfo.C at line 70
Can't find phi-field with name phi
Assumin incompressible solver
phi: phi
Compressible: 0
Turbulent: 0
LES: 0
Time = 50000
Operating in no-flow mode; no models will be loaded. All vol, surface and point fields will be loaded.
Reading volScalarField kappa
Reading volScalarField rho
Reading volScalarField k
Reading volScalarField omega
Reading volScalarField alphat
Reading volScalarField nut
Reading volScalarField Cp
Reading volScalarField mu
Reading volScalarField p_rgh
Reading volScalarField alpha
Reading volScalarField p
Reading volScalarField T
Reading volScalarField h
Reading volVectorField U
Reading surfaceScalarField phi
Reading uniformDimensionedVectorField g
--> FOAM FATAL ERROR:
request for polyMesh pipe from objectRegistry pipe failed
available objects of type polyMesh are
1(salt)
From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/openfoam/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 198.
FOAM aborting
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::polyMesh const& Foam::objectRegistry::lookupObject<Foam::polyMesh>(Foam::word const&) const at ??:?
#3 Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() at ??:?
#4 Foam::mixedFvPatchField<double>::evaluate(Foam::UPstream::commsTypes) at ??:?
#5 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() at ??:?
#6 Foam::readAndUpdateFields::execute() at ??:?
#7 Foam::OutputFilterFunctionObject<Foam::readAndUpdateFields>::execute(bool) at ??:?
#8 Foam::functionObjectList::execute(bool) at ??:?
#9 ? at ??:?
#10 ? at ??:?
#11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#12 ? at ??:?
Sorry for the lengthy post, anybody any idea? Tanks a lot! |
|
|
|
|
|
|
|
|
#16 |
|
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 130 ![]() ![]() ![]() ![]() ![]() ![]() |
Quick answer @hanness: I've spent over an hour trying to figure this out, without adding new code and I'm already too tired today to solve this one
![]() As far as I can figure out, the correct way to do this is with funkyDoCalc. But I only figured this out after about an hour and I'm in no the mood to continue hunting for the solution Please search for examples on how to use funkyDoCalc.
__________________
|
|
|
|
|
|
|
|
|
#17 |
|
Member
hannes
Join Date: Mar 2013
Posts: 47
Rep Power: 14 ![]() |
Thank you Bruno for your neverending efforts to help!
Eventually, I ended up doing the entire postprocessing with pvpython since there is a little more to do than only calculate the mass flow weighted average of the temperature. It took me some time to get the syntax right, but once you got it it's a really powerful tool. Nevertheless, there should be a simpler way to "just" get a mass flow averaged value. Next time I'll try with funkyDoCalc. Best regards, Hannes |
|
|
|
|
|
![]() |
| Tags |
| execflowfunctionobjects, patchmassflowaverage, unknown field |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 05:49 |
| [OpenFOAM] Xwindows crash with paraview save | srinath | ParaView | 1 | October 15, 2008 10:37 |
| IcoLagrangianFoam problem in contiuation run amp field reading from input stream | gschaider | OpenFOAM Running, Solving & CFD | 2 | May 27, 2008 04:45 |
| pressure field problem. | michal | FLUENT | 1 | March 18, 2004 15:45 |
| Aeroacustic problem in Automotive field | Gabriele Velenich | Main CFD Forum | 5 | December 11, 2001 04:43 |