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/)
-   -   calculate and sample wallGradU & wallShearStress every output time (https://www.cfd-online.com/Forums/openfoam-post-processing/126136-calculate-sample-wallgradu-wallshearstress-every-output-time.html)

ArathoN November 8, 2013 12:00

Sample wallShearStress every output time for all wall points
 
Hello,
I'm a beginner user of OpenFoam, and after days of research i decided to ask your help dear community.

I need to calculate the velocity gradient and the wall shear stress at every output time, and i don't know how I can do it. I tried to modify the solver but my knowledge of C code isn't enough to make me understand what i have to do.

Another question is how can i output afterwards these data? I thought about using the sampledict but what should i choose between surface, sets and all other options?

Finally i saw some output file from the sample function and i didn't understand the meaning of the column, what they represent if i choose for example the variable velocity U and i want to sample in the "x" direction starting from point P1 and ending on point P2?

I thought on making something similar to the post-processing (it is written in the controldict and not in a separate file sampledict) present in the case "pitzDaily" where it outputs the fiels "P U K" every output time, but I don't know how I can do it.

I hope some kind soul could help me :D and sorry for my bad English (not my native language).

ArathoN November 12, 2013 09:26

I'm using this function in the control dict to calculate wallshearstress at every output time, but it gives me only the min and max value of the variable:
Code:

wallShearStress1
    {
        type        wallShearStress;
        functionObjectLibs ("libutilityFunctionObjects.so");
        outputControl  outputTime;
        setFormat      gnuplot;

        patches    ("lowerWall");
    }


what should i add to give me the valu of the stress in the lowerwall and the distance too?

ArathoN November 12, 2013 11:32

I tried to use also the sample function like this:

Code:

interpolationScheme cellPoint;
fields
(
    "wallShearStress"
);
sets
(   
lineX1
    {
        type        uniform;
        axis        distance;

        start      (0 0 0);
        end        (2.5 0 0);
        nPoints    10;
    }
);

where the lowerwall in which i'm interested to evaluate the wallshearstress begins from (0 0 0) and ends at (2.5 0 0).

But it will give me a null wallstressshear for every position. can you please tell me what am i doing wrong?

ArathoN November 17, 2013 12:59

finally now i coult sample the wallshearstress. I want now to use the "libutilityfunctionobjects.so" with wallShearStress1 function in controldict. The only problem is that it will give me only the min and max value for every timeset, how can i specify that it should give me all the values on the lowerwall, i need to evaluate the separation point of the flow in a backward facing step.


Code:

wallShearStress1
    {
        type        wallShearStress;
        functionObjectLibs ("libutilityFunctionObjects.so");
        outputControl  outputTime;
        setFormat      gnuplot;

        patches    ("lowerWall");
    }

Please Can someone help me??I reached a dead end here and searched all the forum and the source documentation e found nothing.

ArathoN November 17, 2013 13:18

I created the sample file so i can have the values of the wall shear stress with this code:

Code:

setFormat gnuplot;

surfaceFormat raw;

interpolationScheme cellPoint;
fields
(
    "wallShearStress"
);

sets
(
   
lineX1
    {
        type        face;
        axis        x;

        start      (0 -0.1 0);
        end        (2.5 -0.1 0);
        nPoints    400;
    }

);

surfaces
(
   
 walls_interpolated
    {
        type            patch;
        patches        ( "lowerWall" );
        interpolate    true;
    }

);

i sampled the same patch in two different modes, wanted to try the capability of the sample function.

I saw that i can add the libsampling.so to the controldict file and by this i can sample too while running the solver i tried modifying the file but with no success, any of you have a hint?

canopus August 8, 2016 07:50

calculate and sample wallGradU & wallShearStress every output time
 
Is it possible now to calculate wallGradU & wallShearStress every output time by using the controldict?

canopus August 8, 2016 08:21

I found its possible to write in runtime with
Code:

wallShearStress1
    {
        type        wallShearStress;
        functionObjectLibs ("libutilityFunctionObjects.so");
        patches    ("wallbot");
//        outputControl  timeStep;
        outputControl  runTime;
        writeInterval  0.005;
    }

But problem is
Quote:

This function object evaluates and outputs the shear stress at wall patches. The result is written as a volVectorField to time folders as field 'wallShearStress'.
How can I make it write in postProcessing directory as the results of probe appear?

srv537 February 18, 2017 02:05

Hi
i used
Quote:

pimpleFoam -postProcess -func wallShearStress
to calculate wallShearStress but it gives me only for saved data file but my case is unsteady so after some time i have to take average of all and to do this i want to calculate wallShearStress at each time step and its temporal average.
how to do it, please tell me. is there any method or code available in controlDict file to do this?

Thank you

randolph July 11, 2018 12:14

Quote:

Originally Posted by canopus (Post 613161)
I found its possible to write in runtime with
Code:

wallShearStress1
    {
        type        wallShearStress;
        functionObjectLibs ("libutilityFunctionObjects.so");
        patches    ("wallbot");
//        outputControl  timeStep;
        outputControl  runTime;
        writeInterval  0.005;
    }

But problem is
How can I make it write in postProcessing directory as the results of probe appear?


I do not see how this will work. How will the solver pass the turbulence model information to the function object?


All times are GMT -4. The time now is 00:17.