|
[Sponsors] |
April 21, 2022, 07:53 |
Shear-Rate calculation
|
#1 |
New Member
Giancarlo Esposito
Join Date: Mar 2022
Posts: 7
Rep Power: 4 |
Hi everyone, I am trying to calculate the Shear rate, defined as the square root of the double dot product of the strain-rate tensor with itself. In order to do so I added the following lines of code to the createFields.H of the solver I am currently using:
Code:
Info<< "Reading field strainRate\n" << endl; volScalarField strainRate ( IOobject ( "strainRate", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), 1.41421356237*mag(symm(fvc::grad(U))) ); The solver can be compiled and it run correctly, but the results of the new function are pratically 0 eveyrwhere. If I explore the folders corresponding to the time steps, what I found in the file is: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField; location "0.1"; object strainRate; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type calculated; value uniform 0; } rightWall { type calculated; value uniform 0; } lowerWall { type calculated; value uniform 0; } atmosphere { type calculated; value uniform 0; } defaultFaces { type empty; } } // ************************************************************************* // So it basically performs the computation on the initial velocity field (U=0 everywhere). Can someone help me? Thanks in advance. |
|
May 3, 2022, 13:10 |
|
#2 |
New Member
Konstantinos Missios
Join Date: Mar 2017
Location: Copenhagen, Denmark.
Posts: 12
Rep Power: 9 |
Hi Giano,
createFields is executed once as a result the strainRate is calculated once based on the initial U which is zero everywhere. In the next timesteps you dont recalculate strainRate and thus it remains zero for the rest of your simulation. If I have to suggest something I would say to incorporate this into a coded function object in your controlDict ( https://www.openfoam.com/documentati...ionObject.html). In this way you will have something that is not hardcoded and you will be able to use in other solvers as well. Best K |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wrong shear rate result with the existing code | ALBATTROSS | OpenFOAM Programming & Development | 2 | April 25, 2022 14:22 |
Shear strain rate insertion at Bingham plastic model | Rubel Ahammed | Main CFD Forum | 0 | May 9, 2020 07:00 |
What is wall shear stress and shear strain rate? | warlocklw | Main CFD Forum | 2 | May 21, 2012 06:16 |
shear rate calculation | Stephane bone | Siemens | 2 | January 7, 2005 11:34 |
Shear Strain Rate | Cui | CFX | 0 | August 5, 2003 12:47 |