CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   calcFvcGrad (https://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

f0208secretx August 3, 2015 22:18

Hello,

So after two years, I've been trying to follow this thread because the documentation about calcFvcGrad isn't clear enough for me to figure out how to do this in OF2.4.0. I think in my case the function objects loaded correctly but there is some field pointer seg fault. While I am tracing it down, hope to get some feedback from the community:

controlDict:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    pimpleFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        0.90;//60 periodi

deltaT          0.0001;

writeControl    adjustableRunTime;

writeInterval  0.00018;//St=0.21 ; U=42.12 ;f=154.77Hz ; T=0.0065 ; campiono 10 volte nel periodo//EDO:era 0.0001

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression on;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;

adjustTimeStep  on;

maxCo          0.8;

maxDeltaT      1;

functions
{
    #include "forceCoeffs"
    #include "forces"
    #include "calcFvcGrad"

}

calcFvcGrad:
Code:

MycalcFvcGrad
{
    type            calcFvcGrad;
    functionObjectLibs            ("libFVFunctionObjects.so");
    fieldName      "U";
    resultName      "Ug";
}

log.pimpleFoam:
Code:

Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
    alphaK1        0.85;
    alphaK2        1;
    alphaOmega1    0.5;
    alphaOmega2    0.856;
    gamma1          0.555556;
    gamma2          0.44;
    beta1          0.075;
    beta2          0.0828;
    betaStar        0.09;
    a1              0.31;
    b1              1;
    c1              10;
    F3              false;
}

No finite volume options present


PIMPLE: no residual control data found. Calculations will employ 2 corrector loops


Starting time loop

forceCoeffs forceCoeffs:
    Not including porosity effects

forces forces:
    Not including porosity effects

Courant Number mean: 0.554364 max: 22.31
deltaT = 3.52941e-06
Time = 3.52941e-06

PIMPLE: iteration 1
smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.0236453, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.0421888, No Iterations 1
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.08653, No Iterations 15
time step continuity errors : sum local = 5.60174e-07, global = -9.48512e-08, cumulative = -9.48512e-08
GAMG:  Solving for p, Initial residual = 0.280903, Final residual = 0.0268798, No Iterations 8
time step continuity errors : sum local = 6.5367e-07, global = -6.84472e-08, cumulative = -1.63298e-07
PIMPLE: iteration 2
smoothSolver:  Solving for Ux, Initial residual = 0.00380134, Final residual = 1.16777e-06, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 0.00611923, Final residual = 3.01859e-06, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.0745503, Final residual = 0.00624724, No Iterations 13
time step continuity errors : sum local = 1.62808e-07, global = 2.6053e-08, cumulative = -1.37245e-07
GAMG:  Solving for p, Initial residual = 0.023564, Final residual = 9.83063e-08, No Iterations 125
time step continuity errors : sum local = 2.41377e-12, global = 2.45482e-14, cumulative = -1.37245e-07
smoothSolver:  Solving for omega, Initial residual = 2.40296e-05, Final residual = 2.0622e-07, No Iterations 1
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 8.98325e-06, No Iterations 3
ExecutionTime = 0.47 s  ClockTime = 1 s

forceCoeffs forceCoeffs output:
    Cm    = 0.00647428
    Cd    = 601.426
    Cl    = -0.0306757
    Cl(f) = -0.00886359
    Cl(r) = -0.0218122

forces forces output:
    sum of forces:
        pressure : (3734.49 -0.190466 8.01427e-18)
        viscous  : (0.426175 -3.34092e-05 -3.44755e-20)
        porous  : (0 0 0)
    sum of moments:
        pressure : (0.00952331 186.725 0.0022847)
        viscous  : (1.67046e-06 0.0213087 1.30741e-05)
        porous  : (0 0 0)

calcFvcGrad MycalcFvcGrad output:
    writing field Ug

Courant Number mean: 0.0195176 max: 0.579122
deltaT = 4.0107e-06
Time = 7.54011e-06

PIMPLE: iteration 1
[0] #0  [2] #0  Foam::error::printStack(Foam::Ostream&)[1] #0  Foam::error::printStack(Foam::Ostream&)[3] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&) at ??:?
[0] #1  Foam::sigSegv::sigHandler(int) at ??:?
[1] #1  Foam::sigSegv::sigHandler(int) at ??:?
[3] #1  Foam::sigSegv::sigHandler(int) at ??:?
[2] #1  Foam::sigSegv::sigHandler(int) at ??:?
[0] #2  ? at ??:?
[1] #2  ? at ??:?
[3] #2  ? at ??:?
[2] #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #3  Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::T<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #3  Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::T<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #3  Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::T<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/lib/x86_64-linux-gnu/libc.so.6"
[2] #3  Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::T<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
[1] #4  Foam::incompressible::RASModels::kOmegaSST::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:?
 at ??:?
[0] #4  Foam::incompressible::RASModels::kOmegaSST::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const[3] #4  Foam::incompressible::RASModels::kOmegaSST::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:?
[2] #4  Foam::incompressible::RASModels::kOmegaSST::divDevReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const at ??:?
[0] #5  at ??:?
[1] #5  ? at ??:?
[3] #5  at ??:?
[2] #5  at ??:?
[0] #6  __libc_start_main??? at ??:?
[2] #6  __libc_start_main at ??:?
[1] #6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[0] #7  at ??:?
[3] #6  __libc_start_main? in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #7  in "/lib/x86_64-linux-gnu/libc.so.6"
[2] #7  at ??:?
[juihsien-Z9PE-D8-WS:06714] *** Process received signal ***
[juihsien-Z9PE-D8-WS:06714] Signal: Segmentation fault (11)
[juihsien-Z9PE-D8-WS:06714] Signal code:  (-6)
[juihsien-Z9PE-D8-WS:06714] Failing at address: 0x3e800001a3a
 in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #7  [juihsien-Z9PE-D8-WS:06714] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7fd036370c30]
[juihsien-Z9PE-D8-WS:06714] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7fd036370bb9]
[juihsien-Z9PE-D8-WS:06714] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7fd036370c30]
[juihsien-Z9PE-D8-WS:06714] [ 3] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so(_ZN4Foam1TINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldINS_6TensorIdEET_T0_EEEERKSA_+0x11c) [0x7fd03a5d3c9c]
[juihsien-Z9PE-D8-WS:06714] [ 4] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so(_ZNK4Foam14incompressible9RASModels9kOmegaSST10divDevReffERNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEE+0x4f) [0x7fd03a1ea6af]
[juihsien-Z9PE-D8-WS:06714] [ 5] pimpleFoam() [0x41cc3d]
[juihsien-Z9PE-D8-WS:06714] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fd03635bec5]
[juihsien-Z9PE-D8-WS:06714] [ 7] pimpleFoam() [0x41ee1e]
[juihsien-Z9PE-D8-WS:06714] *** End of error message ***
??? at ??:?
[juihsien-Z9PE-D8-WS:06715] *** Process received signal ***
[juihsien-Z9PE-D8-WS:06715] Signal: Segmentation fault (11)
[juihsien-Z9PE-D8-WS:06715] Signal code:  (-6)
[juihsien-Z9PE-D8-WS:06715] Failing at address: 0x3e800001a3b
[juihsien-Z9PE-D8-WS:06715] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f80a5901c30]
[juihsien-Z9PE-D8-WS:06715] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f80a5901bb9]
[juihsien-Z9PE-D8-WS:06715] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f80a5901c30]
[juihsien-Z9PE-D8-WS:06715] [ 3] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so(_ZN4Foam1TINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldINS_6TensorIdEET_T0_EEEERKSA_+0x11c) [0x7f80a9b64c9c]
[juihsien-Z9PE-D8-WS:06715] [ 4] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so(_ZNK4Foam14incompressible9RASModels9kOmegaSST10divDevReffERNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEE+0x4f) [0x7f80a977b6af]
[juihsien-Z9PE-D8-WS:06715] [ 5] pimpleFoam() [0x41cc3d]
[juihsien-Z9PE-D8-WS:06715] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f80a58ecec5]
[juihsien-Z9PE-D8-WS:06715] [ 7] pimpleFoam() [0x41ee1e]
[juihsien-Z9PE-D8-WS:06715] *** End of error message ***
 at ??:?
[juihsien-Z9PE-D8-WS:06716] *** Process received signal ***
[juihsien-Z9PE-D8-WS:06716] Signal: Segmentation fault (11)
[juihsien-Z9PE-D8-WS:06716] Signal code:  (-6)
[juihsien-Z9PE-D8-WS:06716] Failing at address: 0x3e800001a3c
[juihsien-Z9PE-D8-WS:06716] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f8d58017c30]
[juihsien-Z9PE-D8-WS:06716] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f8d58017bb9]
[juihsien-Z9PE-D8-WS:06716] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f8d58017c30]
[juihsien-Z9PE-D8-WS:06716] [ 3] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so(_ZN4Foam1TINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldINS_6TensorIdEET_T0_EEEERKSA_+0x11c) [0x7f8d5c27ac9c]
[juihsien-Z9PE-D8-WS:06716] [ 4] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so(_ZNK4Foam14incompressible9RASModels9kOmegaSST10divDevReffERNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEE+0x4f) [0x7f8d5be916af]
[juihsien-Z9PE-D8-WS:06716] [ 5] pimpleFoam() [0x41cc3d]
[juihsien-Z9PE-D8-WS:06716] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f8d58002ec5]
[juihsien-Z9PE-D8-WS:06716] [ 7] pimpleFoam() [0x41ee1e]
[juihsien-Z9PE-D8-WS:06716] *** End of error message ***
 at ??:?
[juihsien-Z9PE-D8-WS:06717] *** Process received signal ***
[juihsien-Z9PE-D8-WS:06717] Signal: Segmentation fault (11)
[juihsien-Z9PE-D8-WS:06717] Signal code:  (-6)
[juihsien-Z9PE-D8-WS:06717] Failing at address: 0x3e800001a3d
[juihsien-Z9PE-D8-WS:06717] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f2c209a8c30]
[juihsien-Z9PE-D8-WS:06717] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f2c209a8bb9]
[juihsien-Z9PE-D8-WS:06717] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x36c30) [0x7f2c209a8c30]
[juihsien-Z9PE-D8-WS:06717] [ 3] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so(_ZN4Foam1TINS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldINS_6TensorIdEET_T0_EEEERKSA_+0x11c) [0x7f2c24c0bc9c]
[juihsien-Z9PE-D8-WS:06717] [ 4] /opt/openfoam240/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so(_ZNK4Foam14incompressible9RASModels9kOmegaSST10divDevReffERNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEE+0x4f) [0x7f2c248226af]
[juihsien-Z9PE-D8-WS:06717] [ 5] pimpleFoam() [0x41cc3d]
[juihsien-Z9PE-D8-WS:06717] [ 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f2c20993ec5]
[juihsien-Z9PE-D8-WS:06717] [ 7] pimpleFoam() [0x41ee1e]
[juihsien-Z9PE-D8-WS:06717] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 6715 on node juihsien-Z9PE-D8-WS exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------


wyldckat August 4, 2015 17:38

@f0208secretx: Two quick questions:
  1. Are you able to reproduce the same error with one of OpenFOAM's own pimpleFoam tutorial cases?
  2. Does the crash only occur when you include your "MycalcFvcGrad" function object?

f0208secretx August 4, 2015 21:34

Quote:

Originally Posted by wyldckat (Post 558361)
@f0208secretx: Two quick questions:
  1. Are you able to reproduce the same error with one of OpenFOAM's own pimpleFoam tutorial cases?
  2. Does the crash only occur when you include your "MycalcFvcGrad" function object?

1. no. I ran the tutorial "pitzDaily" and it went smoothly.
2. yes. crash only occurred when I include the function object "calcFvcGrad".

It seems to be a bug in the kOmegaSST model in the function "divDevReff" (roughly line 345 in kOmegaSST.C). It failed on this call " - fvc::div(nuEff()*dev(T(fvc::grad(U))))".

The weird thing is, at the first time step the solver behaves correctly and gives me the velocity gradient but then the second time step it produces segfault. Still tracking the bug but would appreciate any help...

f0208secretx August 4, 2015 22:24

Quote:

Originally Posted by f0208secretx (Post 558370)
1. no. I ran the tutorial "pitzDaily" and it went smoothly.
2. yes. crash only occurred when I include the function object "calcFvcGrad".

It seems to be a bug in the kOmegaSST model in the function "divDevReff" (roughly line 345 in kOmegaSST.C). It failed on this call " - fvc::div(nuEff()*dev(T(fvc::grad(U))))".

The weird thing is, at the first time step the solver behaves correctly and gives me the velocity gradient but then the second time step it produces segfault. Still tracking the bug but would appreciate any help...


I found the direct cause of the crash. It is the last section in my fvSolution, which I modified from other people:
Code:

cache
{
    grad(U);
}

The whole thing:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance        1e-7;
        relTol          0.01;
        smoother        DICGaussSeidel;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels      1;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    "(U|k|omega)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance        1e-8;
        relTol          0.1;
        nSweeps          1;
    }

    "(U|k|epsilon|omega)Final"
    {
        $U;
        tolerance      1e-05;
        relTol          0;
    }
}

PIMPLE
{
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
}

cache
{
    grad(U);
}

Once I took out this segment it worked. Any idea why? Should I submit a bug report?

wyldckat August 15, 2015 17:49

Hi f0208secretx,

I was intrigued by this crash and I've finally managed to take the time to diagnose and find a fix for this problem. The bug and fix has been reported here: http://www.openfoam.org/mantisbt/view.php?id=1828

Best regards,
Bruno

f0208secretx August 16, 2015 09:39

Thanks for taking your time and look into the case. I am curious about two things:

1) the operator "==" is obviously overloaded. Can you point me to a source so I can learn more?

2) does the cache block increase the computation time? by what amounts?


Thanks!

wyldckat August 16, 2015 14:05

Quote:

Originally Posted by f0208secretx (Post 559726)
1) the operator "==" is obviously overloaded. Can you point me to a source so I can learn more?

Run this command:
Code:

find $FOAM_SRC/OpenFOAM -name "*.H" -type f | xargs grep "operator=="
The breadcrumbs start in the class "GeometricField".

Quote:

Originally Posted by f0208secretx (Post 559726)
2) does the cache block increase the computation time? by what amounts?

Caching is meant to reduce computation time, because this way the calculation is only done once per time step. How faster does it get? I don't know, but you can time it yourself ;)

f0208secretx August 17, 2015 22:24

Thanks. I was referring to a more complete API reference but one can always read the source code ...

Another problem I ran across that's loosely related to gradient computation/IO:

I have velocity gradient output at every time step in binary, compressed format using calcFvcGrad library. I now want to write a custom binary reader to port this data for each time step to other solvers I wrote. I can't seem to find the descriptions of how this binary is formatted anywhere. I need to know precision, order of array (NCell*9 matrix), corresponding vertex/cell position etc. Will appreciate for any help. Thanks.



Quote:

Originally Posted by wyldckat (Post 559756)
Run this command:
Code:

find $FOAM_SRC/OpenFOAM -name "*.H" -type f | xargs grep "operator=="
The breadcrumbs start in the class "GeometricField".


Caching is meant to reduce computation time, because this way the calculation is only done once per time step. How faster does it get? I don't know, but you can time it yourself ;)


wyldckat August 18, 2015 12:01

Quick answers:
Quote:

Originally Posted by f0208secretx (Post 559946)
Thanks. I was referring to a more complete API reference but one can always read the source code ...

You weren't specific enough in the previous post... anyway:
Quote:

Originally Posted by f0208secretx (Post 559946)
I have velocity gradient output at every time step in binary, compressed format using calcFvcGrad library. I now want to write a custom binary reader to port this data for each time step to other solvers I wrote. I can't seem to find the descriptions of how this binary is formatted anywhere. I need to know precision, order of array (NCell*9 matrix), corresponding vertex/cell position etc. Will appreciate for any help. Thanks.

Already asked in another thread: http://www.cfd-online.com/Forums/ope...sor-field.html - where, if time permitting, someone will answer there.

angelmonsalve November 11, 2015 20:04

Thank you so much, it really helped me!

Elham March 9, 2016 03:15

coresponding coordination of gradient filed
 
Hello everybody,

I am wondering if I can have the location of each U gradient as well? I mean like the Ug that is written during the simulation can I have the (x,y,z) data for the corresponding gradient filed?

Thanks.

wyldckat March 13, 2016 13:03

Quote:

Originally Posted by Elham (Post 588770)
I am wondering if I can have the location of each U gradient as well? I mean like the Ug that is written during the simulation can I have the (x,y,z) data for the corresponding gradient filed?

Quick question: What are you talking about exactly?
There are several topics/strategies discussed on this thread. Can you please be more specific about which utility or function object that you thinking about?


All times are GMT -4. The time now is 09:08.