CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Visualing Time Avergaed Wall Shear Stress (https://www.cfd-online.com/Forums/paraview/217347-visualing-time-avergaed-wall-shear-stress.html)

laurenj95 May 9, 2019 02:55

Visualing Time Avergaed Wall Shear Stress
 
Hi,

I have run a simulation of a 3D case in openfoam (version foam extend 3.2) using the simpleFoam solver with 5 cardiac cycles as my inlet velocity boundary condition. I am looking to visualise the time averaged wall shear stress in paraview.

I am able to visualise the wall shear stress (by using the post process function “wallShearStress” in OF then opening the model in paraview) but can someone indicate how I can view the time averaged wall shear stress?

Thanks,

Lauren :)

tomf May 10, 2019 03:50

Hi Lauren,

You should calculate the wallShearStress at every time step and than use the averaging functionObject:

Code:

    wallShearStress
    {
        type            wallShearStress;
        libs            ("libfieldFunctionObjects.so");

        executeControl  timeStep;
        writeControl    writeTime;
    } 
    fieldAverage
    {
        type                fieldAverage;
        writeControl        writeTime;
        timeStart          <afterInitialTransient>;
        fields
        (
            wallShearStress
            { 
                mean        on;
                prime2Mean  off;
                base        time;
            }
        );
        libs  ("libfieldFunctionObjects.so");
    }

I think you should only start the averaging after some initial disturbances have vanished from the solution, this is the time <afterInitialTransient> in seconds.

This will give you a wallShearStressMean in every time folder after time <afterInitialTransient>, which you can load into ParaView.

Regards,
Tom

laurenj95 May 20, 2019 08:02

Hi Tom,

Thank you for your reply.

I have tried the method as you said and my solution has converged (1x10-6 criteria) but after reconstructing the model (I ran the simulation in parallel) there is no WSS data in any of the time folders.

Therefore in Paraview I get "wallShearStress(?)" for all time steps.

Regards,

Lauren

tomf May 21, 2019 03:46

Hi Lauren,

I just re-read your original post and found that you run foam-extend 3.2. It looks like that version does not have the wallShearStress functionobject.

I used the set-up I posted in most cases on OpenFOAM 1712 or newer from ESI/OpenCFD, or otherwise version 5, 6 or dev from the OpenFOAM foundation.

If you would like to stick to this version, my suggestion would be to modify the wallShearStress utility to use the averaged velocity and turbulence fields to get the wall shear of the mean fields.

However I would suggest using one of the more recent versions from the foundation or OpenCFD for this application.

Regards,
Tom

laurenj95 May 22, 2019 08:21

Hi Tom,

I have just downloaded OF version 6 - Is there a swak4foam compatible with this OF version? I do not see one here: https://openfoamwiki.net/index.php/Contrib/swak4Foam

I have ran two cases in foam extend 3.2 and want to repeat these in openfoam version 6:
(1) U inlet boundary condition is parabolic using groovy BC

(2) U inlet boundary condition is a time varying waveform using timeVaryingUniformFixedValue

Regards,

Lauren

tomf May 22, 2019 09:02

Hi Lauren,

(1) My suggestion would be to look at this section on that link. The information on the wiki is not updated that much anymore, in particular not about the versions that are supported. The twitter feed of swak4foam usually is your best source of information for staying up to date. You probably already followed this for foam-extend 3.2
(2) timeVaryingUniformFixedValue may have been renamed in version 6, as they have been doing work in this area recently. Please have a look in the various options to match something similar.

Regards,
Tom

laurenj95 May 22, 2019 10:50

Hi Tom,

I was able to download swak4foam version 0.4.2 which is compatible with OF version 6.
I used the download from here: https://github.com/Unofficial-Extend...a09rcqH3vUh6bA

In replace of timeVaryingUniformFixedValue I am testing groovy BC with timelines as per here: https://openfoamwiki.net/index.php/C...s_in_the_patch

Thank you for your help.

Regards,

Lauren

laurenj95 June 5, 2019 06:45

unable to get average WSS
 
2 Attachment(s)
Hi,

I have tried the code outlined above by Tom but nothing happened regarding WSS.

I have since tried the attached code in my controlDict file but I am getting the following error:

[3] --> FOAM FATAL ERROR:
[3]
request for volVectorField wallShearStressMean from objectRegistry region0 failed
available objects of type volVectorField are

3
(
wallShearStress
U
UMean
)


Any help would be much appreciated,

Lauren

(Note: I am using openfoam version 6)

tomf June 5, 2019 08:30

1 Attachment(s)
Hi Lauren,

Please note that I mentioned to change the executeControl to timeStep in my original post. I am not sure if you did that in the file:

$FOAM_ETC/caseDicts/postProcessing/fields/wallShearStress

since that is where #includeFunc would take the information from.

However even if it is not modified, the functions section in your controlDict works for the slightly modified pitzDaily tutorial if I run it on (an earlier version of) OpenFOAM 6 using the attached case.

Still I would suggest to use:

Code:

    wallShearStress
    {
        type            wallShearStress;
        libs            ("libfieldFunctionObjects.so");

        executeControl  timeStep;
        writeControl    writeTime;
    }

instead of
Code:

#includeFunc wallShearStress
.

Hope this helps.
Regards,
Tom

laurenj95 June 6, 2019 05:35

time averaged WSS over 1 cardiac cycle (~ 1 second)
 
Hi Tom,

Thank you very much for your help - I now have the WSS and WSS mean working.

However I would like to obtain the time averaged WSS over a certain period of time (i.e 1 cardiac cycle) rather than the mean WSS at each time step which is what I currently have. (similar aim as this post but using openfoam & paraview https://www.cfd-online.com/Forums/cf...ar-stress.html)

any ideas?

Lauren :)

tomf June 6, 2019 05:46

Hi Lauren,

There are options for selecting averaging windows or periodic restarts and such. In the .H file there is a more descriptive usage message, or you could look at the online documentation.

I am not sure what option would work best, I guess you can try and see if the results make sense.

Regards,
Tom


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