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

Wrong shear rate result with the existing code

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ALBATTROSS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 17, 2018, 23:31
Default Wrong shear rate result with the existing code
  #1
New Member
 
Amir
Join Date: Oct 2018
Posts: 17
Rep Power: 8
ALBATTROSS is on a distinguished road
Hello all,


I'm working on problem in which knowing the magnitude of shear rate tensor is important to me. I added these lines to createFields.H file in solver's folder (buoyantBoussinesqPimpleFoam) and recompiled it in order to have the shear rate magnitude in each time step:
Code:
volScalarField shearRate
    (
    IOobject 
        (
            "shearRate",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        sqrt(2.0f)*mag(symm(fvc::grad(U)))
    );
I used the expression of the shear rate magnitude from the viscosityModel.C in src. and it works I have a file of shear rate in each written time step. the problem is that the output magnitude all over the internal field is zero in every time step and this is wrong, I'm sure about the validity of my results for other parameters though.
is anything wrong with this expression:
shearRate=sqrt(2.0f)*mag(symm(fvc::grad(U)))


or it's a programming problem?


Thank you is advance!
Amir
sourav90 likes this.
ALBATTROSS is offline   Reply With Quote

Old   April 21, 2022, 08:45
Default
  #2
New Member
 
Giancarlo Esposito
Join Date: Mar 2022
Posts: 7
Rep Power: 4
giano is on a distinguished road
I have the same problem, but so far I did not manage to solve it.
giano is offline   Reply With Quote

Old   April 25, 2022, 15:22
Default
  #3
Member
 
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9
Kellis is on a distinguished road
Amir,

The createFields.H file is only called once, at the beginning of the simulation. Assuming you are starting with a zero or otherwise uniform velocity field, the shear rate will be zero. If you are not updating the shear rate somewhere else in the code, the shear rate will be initialized in createFields and then never updated as the simulation progresses.

To fix this, simply add another line of code (perhaps at the end of pEqn.H, once the velocity field for the timestep is finalized) to recalculate the shear rate with the updated velocity field. Then you should be seeing non-zero values as your case progresses.

Hope this helps.

Kellis
Kellis is offline   Reply With Quote

Reply


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
udf error srihari FLUENT 1 October 31, 2016 15:18
Blood and shear strain rate Dave442 CFX 2 July 27, 2012 07:10
Shear rate and Shear stress kakarot9999 FLUENT 0 September 8, 2011 09:28
Turbulent viscosity and shear rate shib FLUENT 0 June 22, 2010 13:44
Total shear rate in a 3 dimensional flow Bo Busk Jensen Main CFD Forum 3 May 23, 2003 16:26


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