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

Reporting turbulence fields

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2017, 01:20
Default Reporting turbulence fields
  #1
Member
 
Join Date: Apr 2017
Posts: 68
Rep Power: 9
kaaja is on a distinguished road
Hi,

I run openFoam 4.1, and have a problem extracting the turbulent stress tensor, R, in my k-eps simulation.

To extract R, I have only modified the controlDict, which looks like the following:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.0                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     simpleFoam;

startTime       0;

stopAt          endTime;

endTime         5000;

deltaT          1;

writeControl    timeStep;

writeInterval   100;

purgeWrite      2;

writeFormat     ascii;

writePrecision  8;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

functions
{
#includeFunc    residuals

    turbulenceFields1
    {
        type            turbulenceFields;
        libs            ("libfieldFunctionObjects.so");
        field           R;
    }
}

// ************************************************************************* //
When I try solving with the above controlDict, I get the following:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 4.1
Exec   : simpleFoam
Date   : May 18 2017
Time   : 07:08:01
Host   : "..."
PID    : 11073
Case   : /home...
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0


SIMPLE: convergence criteria
    field p     tolerance 0.001
    field U     tolerance 0.001
    field "(k|epsilon|omega|f|v2)"     tolerance 0.001

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu             0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
}

No MRF models present

No finite volume options present


Starting time loop

turbulenceFields turbulenceFields1: storing fields:
    turbulenceProperties:R

Time = 1

smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.068919891, No Iterations 6
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.094423261, No Iterations 4
smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 0.065365879, No Iterations 6
GAMG:  Solving for p, Initial residual = 1, Final residual = 0.0086113464, No Iterations 26
time step continuity errors : sum local = 0.51812432, global = -0.07783965, cumulative = -0.07783965
smoothSolver:  Solving for epsilon, Initial residual = 0.59675441, Final residual = 0.051409907, No Iterations 3
smoothSolver:  Solving for k, Initial residual = 1, Final residual = 0.092548244, No Iterations 2
ExecutionTime = 0.81 s  ClockTime = 1 s



--> FOAM FATAL ERROR: 
object of type N4Foam9Function1INS_10SymmTensorIdEEEE is not allocated

    From function T* Foam::autoPtr<T>::operator->() [with T = Foam::Function1<Foam::SymmTensor<double> >]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-4.1/src/OpenFOAM/lnInclude/autoPtrI.H at line 176.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::timeVaryingMappedFixedValueFvPatchField<Foam::SymmTensor<double> >::write(Foam::Ostream&) const at ??:?
#3  Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::Boundary::writeEntry(Foam::word const&, Foam::Ostream&) const at ??:?
#4  Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>::writeData(Foam::Ostream&) const at ??:?
#5  Foam::regIOobject::writeObject(Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const at ??:?
#6  Foam::functionObjects::regionFunctionObject::writeObject(Foam::word const&) at ??:?
#7  Foam::functionObjects::turbulenceFields::write() at ??:?
#8  Foam::functionObjectList::execute() at ??:?
#9  Foam::Time::loop() at ??:?
#10  Foam::simpleControl::loop() at ??:?
#11  ? at ??:?
#12  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#13  ? at ??:?
Aborted (core dumped)
So it seems like that openFoam solves for the first time step, and then something goes wrong. In the the catalog "1" there is now only a file "turbulenceProperties:R", which seams to containt the 6 elements of the stress tensor for each point.

Does anybody know how to fix this?
kaaja is offline   Reply With Quote

Old   May 24, 2017, 02:19
Default
  #2
Member
 
Join Date: Apr 2017
Posts: 68
Rep Power: 9
kaaja is on a distinguished road
I think I found the answer, here.
kaaja is offline   Reply With Quote

Reply

Tags
turbulenceproperties


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 set URANS turbulence model in unsteady flow simulation TimLiu OpenFOAM Pre-Processing 0 April 25, 2017 08:52
Simulation FPEs - turbulence for transient and steady-state? DaveR OpenFOAM Running, Solving & CFD 5 March 5, 2017 15:06
Turbulence postprocessing Mohsin FLUENT 2 October 3, 2016 14:18
Initial pressure and transverse velocity fields to initialize turbulence model nickvinn Main CFD Forum 0 February 29, 2012 10:11
About Turbulence Intensity (Pipe flow assimilated) gRomK13 Main CFD Forum 1 July 10, 2009 03:11


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