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

Sample of Reynolds Stress Normal to Wall

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

Like Tree5Likes
  • 1 Post By alekhine
  • 1 Post By alekhine
  • 1 Post By alekhine
  • 1 Post By alekhine
  • 1 Post By alekhine

Reply
 
LinkBack Thread Tools Display Modes
Old   January 4, 2017, 09:04
Default Sample of Reynolds Stress Normal to Wall
  #1
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
Dear Foamers,

I want to plot the Reynolds stress along the wall normal direction y. The case is turbulent (SA model) and calculated by the simpleFoam solver. After the simulates has converged, I ran the post processing utility of OpenFOAM to calculate the Reynold stress and sample it afterwards.

The velocity and pressure are sampled as expected but it does not work for the Reynold stress. Below are the sampling dictionary and the error when executed.

simpleFoam -postProcess -func 'turbulenceFields(R)' -latestTime
simpleFoam -postProcess -func sampleVel_-6p531 -latestTime

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     3.0                                |
|   \\  /    A nd           | Web:         http://www.extend-project.de       |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      sample;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// file got from CFD course Ulg

libs ("libsampling.so");

setFormat raw;
surfaceFormat raw;

start   (-0.4572 0.07 0);
end     (-0.4572 0.10708 0);
fields  (U p turbulenceProperties:R);

// Sampling and I/O settings
#includeEtc "caseDicts/postProcessing/graphs/sampleDict.cfg"

//  Override settings here, e.g.
setConfig
{
    interpolationScheme cellPoint;
    axis xyz; 
}

// Must be last entry
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"

// ************************************************************ //
Code:
--> FOAM Warning : 
    From function Foam::label Foam::sampledSets::classifyFields()
    in file sampledSet/sampledSets/sampledSetsGrouping.C at line 140
    Cannot find registered field matching turbulenceProperties:R
--> FOAM Warning : 
    From function Foam::label Foam::sampledSets::classifyFields()
    in file sampledSet/sampledSets/sampledSetsGrouping.C at line 140
    Cannot find registered field matching turbulenceProperties:R
From the warning I deduce that it is somehow connected to the libraries I use within the sampling dictionary. But I have no clue how to do it differently

I would highly appreciate your help!
Dimitri
Bashar likes this.
alekhine is offline   Reply With Quote

Old   January 4, 2017, 13:32
Default
  #2
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
Any ideas?
I have tried to use simpleFoam -postProcess -func 'components(turbulenceProperties:R)' -latestTimestep but I get

-> FOAM Warning : functionObject components: Cannot find required field turbulenceProperties:R

I use OpenFOAM version 4.1

Please help!!
Dimitri
alekhine is offline   Reply With Quote

Old   January 4, 2017, 13:52
Default
  #3
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
Ok, problem solved.

If I use

postProcess -func sampleVel_-6p531 -latestTime OR
postProcess -func 'components(turbulenceProperties:R)' -latestTimestep

instead of

simpleFoam -postProcess -func sampleVel_-6p531 -latestTime OR
simpleFoam -postProcess -func 'components(turbulenceProperties:R)'

it works. I don't know the difference at the moment though. However, this thread can be considered closed. :-)

Dimitri
Bashar likes this.
alekhine is offline   Reply With Quote

Old   January 5, 2017, 17:50
Default
  #4
Member
 
Bashar
Join Date: Jul 2015
Posts: 67
Rep Power: 4
Bashar is on a distinguished road
Dimitri,

Hi,
Did you manage to plot your data in paraview? if yes, please can you share the procedure?
Thank you .
Bashar
Bashar is offline   Reply With Quote

Old   January 5, 2017, 17:58
Default
  #5
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
Hi Basher,

I post-process my results in gnuplat and Matlab. You can extract the values as I posted above and load everything in your post-processing tool of choice.

Dimitri
Bashar likes this.
alekhine is offline   Reply With Quote

Old   January 5, 2017, 18:12
Default
  #6
Member
 
Bashar
Join Date: Jul 2015
Posts: 67
Rep Power: 4
Bashar is on a distinguished road
Thank you for the fast response.

I just want to make sure of something.
So, when I computed the Reynolds Stress, I just type "R" i.e. I used the post-process utility . below are sample of the calculation. Is this is the wright way to do that? I have know in each data file an R file with the matrix inside .


Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 3.0.1-119cac7e8750
Exec : R
Date : Jan 05 2017
Time : 16:05:43
Host : "basharhpc"
PID : 11582
Case : /media/bashar/2E62-CB06/Bashar_Single_1.8mil
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

Time = 0
Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LES
Selecting LES turbulence model WALE
Selecting LES delta type cubeRootVol
WALECoeffs
{
Ce 1.048;
Ck 0.094;
Cw 0.325;
}

Writing R field

Time = 1.000061
Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LES
Selecting LES turbulence model WALE
Selecting LES delta type cubeRootVol
WALECoeffs
{
Ce 1.048;
Ck 0.094;
Cw 0.325;
}

Writing R field

Bashar is offline   Reply With Quote

Old   January 5, 2017, 18:21
Default
  #7
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
It looks right to me. Depending on the version of OpenFOAM you use, the command is a bit different. I believe in the earlier versions (I use V4.1), it is sufficient to simply type 'R' or something similar. The output should be a symmetric tensor <symmTensor> in your write directories.

Afterwards, you can sample this tensor and extract values.

Hope that helps.
Dimitri
Bashar likes this.
alekhine is offline   Reply With Quote

Old   January 5, 2017, 18:31
Default
  #8
Member
 
Bashar
Join Date: Jul 2015
Posts: 67
Rep Power: 4
Bashar is on a distinguished road
Thanks again and sorry to ask you again, I am really still not that good in openfoam.
So, know I need to extract the data using your method? So, basically I need to execute the command in my terminal or you mean different thing? Sorry to ask this basic questions.
Bashar
Bashar is offline   Reply With Quote

Old   January 5, 2017, 18:42
Default
  #9
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
No need for an excuse, I also started using OpenFOAM not long ago and had to learn the hard way.

What you can do is copy my the first code of the first post to your ./system directory and name it yourSample. There you specify the line where you want to extract the values and what quantities.

start (-0.4572 0.07 0);
end (-0.4572 0.10708 0);
fields (U p turbulenceProperties:R);

If needed, you can change the interpolation scheme, type, axis etc. You can look this up in the official OpenFOAM documentation. In my case, I selected

// Override settings here, e.g.
setConfig
{
interpolationScheme cellPoint;
axis xyz;
}

Afterwards you go to your case directory and execute the following in the terminal
postProcess -func yourSample -latestTime

You can replace -latestTime by -time XXX if you want to sample at a specific time or just
postProcess -func yourSample -latestTime

if you want to sample at all types.

Dimitri
body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Liberation Sans"; font-size:x-small } a.comment-indicator:hover + comment { background:#ffd; position:absolute; display:block; border:1px solid black; padding:0.5em; } a.comment-indicator { background:red; display:inline-block; border:1px solid black; width:0.5em; height:0.5em; } comment { display:none; }
Bashar likes this.
alekhine is offline   Reply With Quote

Old   January 5, 2017, 18:47
Default
  #10
Member
 
Bashar
Join Date: Jul 2015
Posts: 67
Rep Power: 4
Bashar is on a distinguished road
Thank you so much , you make it really clear for me.

best wishes to you and happy new year .

Bashar
Bashar is offline   Reply With Quote

Old   January 5, 2017, 18:48
Default
  #11
New Member
 
DimitriF
Join Date: Dec 2016
Location: London
Posts: 19
Rep Power: 2
alekhine is on a distinguished road
Happy to help

Thanks, to you too!
Dimitri
alekhine is offline   Reply With Quote

Reply

Tags
reynolds stress tensor, sampling

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enhanced Wall Treatment paduchev FLUENT 21 August 14, 2017 00:54
Calculation of Wall Shear Stress Dave442 CFX 36 July 12, 2016 04:12
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 12:03
reynolds normal and shear stress components saran Siemens 0 August 28, 2006 00:54


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