Shear-Rate calculation
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:
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++ -*----------------------------------*\ So it basically performs the computation on the initial velocity field (U=0 everywhere). Can someone help me? Thanks in advance. |
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 |
All times are GMT -4. The time now is 11:23. |