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

Cannot run yPlus function object via controlDict

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 1 Post By Yann
  • 1 Post By Yann
  • 2 Post By brammekeuh987
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2021, 14:38
Default Cannot run yPlus function object via controlDict
  #1
Member
 
Bram Kerkhofs1
Join Date: Oct 2016
Posts: 30
Rep Power: 9
brammekeuh987 is on a distinguished road
Dear

So I've compiled OF v2106 but during a run of interFoam i cannot get the yPlus function object to work.

the error says while running interFoam:
Code:
Starting time loop

--> FOAM Warning : 
Unknown function type yPlus

Valid function types :

12
(
BilgerMixtureFraction
forceCoeffs
forces
interfaceHeightAndAvgVelocity
patchProbes
probes
psiReactionThermoMoleFractions
psiSpecieReactionRates
rhoReactionThermoMoleFractions
rhoSpecieReactionRates
sets
surfaces
)
The entry i've put in the controldict is:
Code:
functions
{
yPlus1
{
    type            yPlus;
    libs            (fieldFunctionObjects);
    writeControl    timeStep;
}
}
So i tried to find the source of this problem. I searched in the openFoam installation folder for all the valid function objects by:
Code:
grep -r "<valid function object name>" | grep "linux64GccDPInt32Opt/lib"
and found that all the function objects are placed in a '.so'-file in 'platforms/linux64GccDPInt32Opt/lib'

The yPlus function object isn't present in the libfieldFunctionObjects.so , while according to "/home/bram/OpenFOAM/OpenFOAM-v2106/src/functionObjects/field/Make/files" it should be added to "LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects"

yPlus is present in other libs, e.g. the libturbulenceModels.so. So I tried to use
Code:
libs   (turbulenceModels);
in the function object entry in the controlDict, but this didn't work.

For the record: I didn't change anything to any files, so I don't understand why it doesn't work.

Last edited by brammekeuh987; October 9, 2021 at 02:12.
brammekeuh987 is offline   Reply With Quote

Old   October 9, 2021, 17:28
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14
Tobermory will become famous soon enough
Your syntax is wrong. Try:
Code:
functions
{
   yPlus1
   {
       type            yPlus;
       libs            ("fieldFunctionObjects.so");
       writeControl    timeStep;
   }
}
Tobermory is offline   Reply With Quote

Old   October 11, 2021, 04:40
Default
  #3
Member
 
Bram Kerkhofs1
Join Date: Oct 2016
Posts: 30
Rep Power: 9
brammekeuh987 is on a distinguished road
Hi

Thanks for the effort! But the suggested syntax doesn't solve the problem.
The syntax that I use comes from the User Guide and is also used in some tutorials (which also don't work)
user guide: https://www.openfoam.com/documentati...eld-yPlus.html
brammekeuh987 is offline   Reply With Quote

Old   October 11, 2021, 04:44
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14
Tobermory will become famous soon enough
Aaah - apologies, I was talking about the foundation version, where the syntax is different.

What do you get if you type:
Code:
postProcess -list
at a command line? You should get a long list of the available functionObjects - is yPlus listed amongst them?
Tobermory is offline   Reply With Quote

Old   October 11, 2021, 05:00
Default
  #5
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,172
Rep Power: 27
Yann will become famous soon enough
Hi,

Bram, how did you install OpenFOAM? Did you compile it yourself?
Using OpenFOAM-v2106, I just ran the weirOverflow tutorial with the yPlus function using this syntax:

Code:
functions
{
    yPlus1
    {
        type        yPlus;
        libs        (fieldFunctionObjects);
    }
}
It works as expected. If you have trouble to run the tutorials using the yPlus function, it would tend to think something went wrong with your installation.

For the record, here is the output of the command postProcess -list suggested by Tobermory :

Code:
Available configured functionObjects:
64
(
AMIWeights
CourantNo
LambVector
Lambda2
MachNo
ObukhovLength
PecletNo
Q
R
XiReactionRate
add
boundaryCloud
cellMax
cellMin
components
ddt
div
dsmcFields
energySpectrum
enstrophy
faceMax
faceMin
fieldMinMax
flowRateFaceZone
flowRatePatch
flowType
forceCoeffsCompressible
forceCoeffsIncompressible
forcesCompressible
forcesIncompressible
grad
heatTransferCoeff
internalCloud
log
mag
magSqr
minMaxComponents
minMaxMagnitude
patchAverage
patchIntegrate
pressureDifferencePatch
pressureDifferenceSurface
probes
processorField
randomise
scalarTransport
singleGraph
solverInfo
staticPressure
streamFunction
streamlines
subtract
surfaces
totalPressureCompressible
totalPressureIncompressible
turbulenceFields
volFlowRateSurface
vorticity
wallHeatFlux
wallShearStress
writeCellCentres
writeCellVolumes
writeObjects
yPlus
)
Yann
Tobermory likes this.
Yann is offline   Reply With Quote

Old   October 11, 2021, 05:36
Default
  #6
Member
 
Bram Kerkhofs1
Join Date: Oct 2016
Posts: 30
Rep Power: 9
brammekeuh987 is on a distinguished road
Hi

When I run the postProcess -list, I also get the 64 options and yPlus is among them. But when I run it in the controldict, it only shows 12 options (the ones in the earlier post)

I was also guessing that something went wrong during compilation, and Yann's answer also makes it clear that it should work (so it isn't a general bug or so). But I can't figure out what .
Even my custom function objects are available when i run it in the controlDict ( interfaceHeightAndAvgVelocity ); the custom function is not available when i run the "postProcess -list", but that's not an issue.

When I execute the Allwmake file in the /OpenFOAM-v2106/src/functionObjects folder i get this:
Code:
wmake field
wmake forces
wmake initialisation
wmake lagrangian
wmake utilities
wmake solvers
wmake libso (randomProcesses)
no errors.
brammekeuh987 is offline   Reply With Quote

Old   October 12, 2021, 09:38
Default
  #7
Member
 
Bram Kerkhofs1
Join Date: Oct 2016
Posts: 30
Rep Power: 9
brammekeuh987 is on a distinguished road
So I ran the Allwmake script again in the general OpenFOAM-v2106 directory, by:
Code:
./Allwmake -j 6 -s -q -l
In attachment the log-file of the installation. I cannot find any errors.

Now when I run interfoam, I only have 10 options left:
Code:
Valid function types :
10(BilgerMixtureFraction interfaceHeightAndAvgVelocity patchProbes probes psiReactionThermoMoleFractions psiSpecieReactionRates rhoReactionThermoMoleFractions rhoSpecieReactionRates sets surfaces)
the "forces" and "forceCoeffs" are gone. But in this case i didn't load the lib 'forces'.
When I have my libs like this:
Code:
libs         (fieldFunctionObjects, forces);
I got this error:

Code:
--> FOAM Warning : 
    From void* Foam::dlLibraryTable::openLibrary(const Foam::fileName&, bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 188
    Could not load "fieldFunctionObjects,"
libfieldFunctionObjects,.so: cannot open shared object file: No such file or directory
--> FOAM Warning : 
Unknown function type yPlus

Valid function types :
8(forceCoeffs forces patchProbes probes psiReactionThermoMoleFractions rhoReactionThermoMoleFractions sets surfaces)
The comma is not good, the libs should be divided only by a space, like this:
Code:
libs         (fieldFunctionObjects forces);
So I got the "forces" and "forceCoeffs" back. So then I figured out that the fieldFunctionObjects is loaded, and only loads these functions: "BilgerMixtureFraction interfaceHeightAndAvgVelocity", from which the last one is my custom made one.
So the hunt is now on for why only my BilgerMixtureFraction is loaded....

@Yann: any idea why your installation doesn't have the BilgerMixtureFraction available? I've never used it and have no idea what it does....
Attached Files
File Type: zip log_linux64GccDPInt32Opt.zip (70.5 KB, 2 views)
brammekeuh987 is offline   Reply With Quote

Old   October 12, 2021, 10:33
Default
  #8
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,172
Rep Power: 27
Yann will become famous soon enough
Hi Bram,

The BilgerMixtureFraction function object seems to be related to combustion applications. (I never used it, I'm only referring to the documentation)

It doesn't appear in the output of postProcess -list because this function is not available in the postProcess utility (this is stated in the link above)

I tried running the weirOverflow tutorial using the banana trick:

Code:
functions
{
    yPlus1
    {
        // Mandatory entries (unmodifiable)
        type        banana;
        libs        (fieldFunctionObjects);
    }
 }
Here is the warning I get:
Code:
--> FOAM Warning : 
Unknown function type banana

Valid function types :

83
(
AMIWeights
BilgerMixtureFraction
CourantNo
Curle
DESModelRegions
DMD
LambVector
Lambda2
MachNo
PecletNo
Q
XiReactionRate
add
blendingFactor
columnAverage
components
continuityError
ddt
ddt2
derivedFields
div
enstrophy
externalCoupled
extractEulerianParticles
fieldAverage
fieldCoordinateSystemTransform
fieldExtents
fieldMinMax
flowType
flux
fluxSummary
grad
heatTransferCoeff
histogram
interfaceHeight
limitFields
log
mag
magSqr
mapFields
momentum
momentumError
multiFieldValue
multiply
nearWallFields
particleDistribution
patchProbes
pow
pressure
probes
processorField
proudmanAcousticPower
psiReactionThermoMoleFractions
psiReactionsSensitivityAnalysis
psiSpecieReactionRates
randomise
readFields
reference
regionSizeDistribution
rhoReactionThermoMoleFractions
rhoReactionsSensitivityAnalysis
rhoSpecieReactionRates
setFlow
sets
stabilityBlendingFactor
streamFunction
streamLine
subtract
surfaceDistance
surfaceFieldValue
surfaceInterpolate
surfaces
turbulenceFields
valueAverage
volFieldValue
vorticity
wallBoundedStreamLine
wallHeatFlux
wallShearStress
writeCellCentres
writeCellVolumes
yPlus
zeroGradient
)

    From static Foam::autoPtr<Foam::functionObject> Foam::functionObject::New(const Foam::word&, const Foam::Time&, const Foam::dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 117.
--> loading function object 'yPlus1'
It looks like you are missing all the field function objects

Are you loading other libraries in your controlDict or somewhere else in your case?

You mentioned a custom function object. Your problem might be related to your custom code compilation messing up existing libraries.
You may want to download and compile a fresh source code without including any custom code. It could help to find out if there is an issue with the way you compile your custom code.

I hope this helps,
Yann
brammekeuh987 likes this.
Yann is offline   Reply With Quote

Old   October 12, 2021, 10:59
Default
  #9
Member
 
Bram Kerkhofs1
Join Date: Oct 2016
Posts: 30
Rep Power: 9
brammekeuh987 is on a distinguished road
Hi Yann

I found the issue. My custom function object is indeed messing up the installation.
My main mistake was that in the Make/files - file I still had the
Code:
LIB = $(FOAM_LIBBIN)/libfieldFunctionObject
So when I did
Code:
wclean
wmake
for my custom code, my libfieldFunctionObject was removed and replace by the one only carrying the custom code. I have no idea why the BilgerMixtureFraction did came through.

The 'Allwmake.sh" file doesn't preform a 'wclean', so it found the libfieldFunctionObject.so and skipped compiling it I guess.

so my fix was actually preforming a wclean and wmake in the /OpenFOAM/OpenFOAM-v2106/src/functionObjects/field directory

To Yann and Tobermory: Thanks a lot for your help!!
Yann and Tobermory like this.
brammekeuh987 is offline   Reply With Quote

Old   October 14, 2021, 09:55
Default
  #10
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14
Tobermory will become famous soon enough
Well found Bram - and thanks for coming back with the solution at the end; that may help a future reader with the same issue.
Yann likes this.
Tobermory is offline   Reply With Quote

Reply

Tags
compilation, functionobjects

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
How to access force values calculated by the function object. gigili206 OpenFOAM Programming & Development 1 June 27, 2023 11:15
interFoam and scalarTransport function object with fvOptions sources fusij OpenFOAM Running, Solving & CFD 4 April 18, 2022 07:12
error in fireFoam, when running the case wallFireSpread2D zhoubiao1088 OpenFOAM Running, Solving & CFD 9 February 1, 2018 18:45
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23


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