CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   calcFvcGrad (http://www.cfd-online.com/Forums/openfoam-post-processing/117099-calcfvcgrad.html)

Nico A. May 2, 2013 04:46

calcFvcGrad
 
Hello forum users,

I just wanted to use the new FunctionObjects in OF2.2.0. For calculating a gradient field during the simulation, there is the new calcFvcGrad post-Processing FunctionObject. I added it to my controlDict and started the simulation, but I got the following error:
Starting time loop


Code:

--> FOAM FATAL ERROR:
Unknown function type calcFvcGrad

Valid functions are :

18
(
cellSource
faceSource
fieldAverage
fieldCoordinateSystemTransform
fieldMinMax
fieldValueDelta
nearWallFields
patchProbes
probes
processorField
readFields
regionSizeDistribution
sets
streamLine
surfaceInterpolateFields
surfaces
turbulenceFields
wallBoundedStreamLine
)



    From function functionObject::New(const word& name, const Time&, const dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 92.

FOAM exiting

So, does anyone have the solution to run that function? Did I may forgot to load a special lib?

I appreciate any response.

Best regards, Nico

Nico A. May 2, 2013 05:46

not compiled
 
Okay, I think this function is not compiled by default. So I added the string: "wmake $makeType fvTools" to the Allwmake file in the
$WM_PROJECT_DIR/src/postProcessing/functionObjects directory and I ran it once again.
Unfortunately an error occured:
Code:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file calcFvcDiv/calcFvcDiv.C
Making dependency list for source file calcFvcDiv/calcFvcDivFunctionObject.C
Making dependency list for source file calcFvcGrad/calcFvcGrad.C
Making dependency list for source file calcFvcGrad/calcFvcGradFunctionObject.C
Making dependency list for source file calcMag/calcMag.C
Making dependency list for source file calcMag/calcMagFunctionObject.C
SOURCE=calcFvcDiv/calcFvcDiv.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/usrfem/femsys_local/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/usrfem/femsys_local/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/usrfem/femsys_local/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/calcFvcDiv.o
In file included from calcFvcDiv/calcFvcDiv.C:26:
calcFvcDiv/calcFvcDiv.H:158: error: ISO C++ forbids declaration of 'polyMesh' with no type
calcFvcDiv/calcFvcDiv.H:158: error: expected ',' or '...' before '&' token
make: *** [Make/linux64GccDPOpt/calcFvcDiv.o] Error 1

So finally that is the newer problem and I do not see why? Are there any suggestions for that?

Thanks in advance.

Best Regards, Nico

wyldckat May 2, 2013 08:36

Greetings Nico,

All does seem to indicate that the "fvTools" folder wasn't ready for production in OpenFOAM 2.2.0. You can fix this by running the following commands:
Code:

cd "$FOAM_SRC/postProcessing/functionObjects/fvTools"

wget "https://raw.github.com/OpenFOAM/OpenFOAM-2.2.x/master/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H" -O calcFvcDiv/calcFvcDiv.H

wget "https://raw.github.com/OpenFOAM/OpenFOAM-2.2.x/master/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H"  -O calcFvcGrad/calcFvcGrad.H

wget "https://raw.github.com/OpenFOAM/OpenFOAM-2.2.x/master/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H"  -O calcMag/calcMag.H

wclean libso
wmake libso

Here's an example for appending/adding to "system/controDict":
Code:

libs            ("libFVFunctionObjects.so"); //this force-loads the library

functions
{
    myCalc_calcFvcGrad
    {
        type            calcFvcGrad;
        libs            ("libFVFunctionObjects.so");
        fieldName      "U";
        resultName      "Ug";
    }
}

Best regards,
Bruno

Nico A. May 2, 2013 09:32

Hello Bruno,

thanks for your help. So there was just the class declaration for ployMesh missing, I did not recognize that. Now the tool is running, thanks again. :)

Best regards, Nico

JFM August 17, 2013 20:38

Good day Wyldckat and Nico

---------------------------
SOLVED-
I needed to update both the fvTools folder plus the fvTools Allmake from Github and recompile the fvTools. This also resulted in a need to update the fvSchemes file - divSchemes by adding div (U) Gauss Linear;

However I would still appreciate some assistance with extracting the cross momentum values from the model. Please?
----------------------------

I have followed the above post and everything appeared to compile successfully, however when attempting to execute interFoam I received the following error output - the model was going to run but the model would not have generated the desired output.

Code:

Build  : 2.2.0-5be49240882f
Exec  : interFoam
Date  : Aug 18 2013
Time  : 10:12:55
Host  : "Ubuntu"
PID    : 6685
Case  : /home/john/MEng/OpenFOAM/dataExtraction/laminar
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /opt/openfoam220/platforms/linux64GccDPOpt/lib/libFVFunctionObjects.so: undefined symbol: _ZN4Foam10calcFvcDiv7timeSetEv
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libFVFunctionObjects.so"
Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar

Reading g
Calculating field g.h

No finite volume options present

While asking a questions could you point me in the right direction on extracting (sampling or field) the acceleration terms (cross momentum) from model.

Any assistance will be greatly appreciated.

Kind regards
JFM

wyldckat August 18, 2013 07:03

Greetings JFM,

Quote:

Originally Posted by JFM (Post 446366)
However I would still appreciate some assistance with extracting the cross momentum values from the model. Please?

Quote:

Originally Posted by JFM (Post 446366)
While asking a questions could you point me in the right direction on extracting (sampling or field) the acceleration terms (cross momentum) from model.

I'm a bit lost on what exactly you mean by "cross momentum"!?
The only thing that comes to mind if force and momentum values that can be calculated with the function objects "forces" and "forceCoeffs": http://foam.sourceforge.net/docs/cpp/a09472.html
You can find practical example files by running the following command:
Code:

grep -islR "force" $FOAM_TUTORIALS | grep system
Best regards,
Bruno

JFM August 25, 2013 04:40

convected momentum
 
Thank you Wyldckat

I had a look at this post plus some of the tutorials a suggested, however they do not seem to provide a method to extract the particular information I am after. The 'cross momentum' terms I am looking for are the convective derivative (momentum) terms from the LHS of the momentum equations for the conservative form of the continuum:

LHS x-direction components
du/dt + u.du/dx + v.du/dy + w.du/dz

In particular the momentum terms (for all x, y, z)
v.du/dy + w.du/dz, etc

We believe these terms may potentially have a reasonable influence on the model results for my particular geometry. I also need to determine of the nonOrthogonalCorrectors are related to these terms.

Any assistance or reference to similar posts will be greatly appreciated.

Regards JFM.

wyldckat August 25, 2013 06:25

Hi JFM,

Those expressions look familiar to me, but I don't remember if I ever saw them explicitly in OpenFOAM :(

I did a quick search and the source code of the following utility applications might help you create a variant application for calculating what you need:
  • "applications/utilities/postProcessing/velocityField/Q"
    Quote:

    Calculates and writes the second invariant of the velocity gradient tensor.
  • "applications/utilities/postProcessing/stressField/stressComponents"
    Quote:

    Calculates and writes the scalar fields of the six components of the stress tensor sigma for each time.
  • "applications/utilities/postProcessing/velocityField/vorticity"
    Quote:

    Calculates and writes the vorticity of velocity field U.
The SIG Turbomachinery comes to mind: http://openfoamwiki.net/index.php/Sig_Turbomachinery - but after a quick browse through, I couldn't find anything there directly related to this.

edit: You might also some more information in the Programmer's Guide: http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf

Good luck! Best regards,
Bruno


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