|
[Sponsors] |
March 4, 2007, 20:14 |
Calculating principle stresses (Difficult)
|
#1 |
Guest
Posts: n/a
|
I would like to calculate the principle normal and shear stresses for the effective stress tensor. Calculating the components of this tensor is trivial.
However, in order to calculate the principle stresses you need to solve a cubic equation. While exact analytical solutions for cubic equations are available they all seem (AFAIK) to require imaginary numbers even if the final roots are strictly real (as in my case). This is a problem as CFX Post does not support imaginary numbers. The other option is to find the roots numerically. However, this cannot (AFAIK) be implemented in an expression for a CFX Post variable. Ergo, Im stuck ... Any suggestions? I could extract the tensor field from CFX Post and do the calcs in a third party app but that would break the optimisation loop I need CFX Post to function in. Suggestions? |
|
March 5, 2007, 06:21 |
Re: Calculating principle stresses (Difficult)
|
#2 |
Guest
Posts: n/a
|
Joe,
you could write a perl subroutine that performs this task, and call it from within a Post session file, or even a macro. There should be examples of how to do this using 'power syntax' in the Post documentation. Regards, Johnson |
|
March 5, 2007, 07:06 |
Re: Calculating principle stresses (Difficult)
|
#3 |
Guest
Posts: n/a
|
I thought of that but I need to calculate the principle stresses for the entire domain. You cant incorporate perl expressions into Posts expression definitions AFAIK.
|
|
March 5, 2007, 07:41 |
Re: Calculating principle stresses (Difficult)
|
#4 |
Guest
Posts: n/a
|
To elaborate, as I understand it, expressions used to define new variables in CFX post (e.g. varNew = Velocity u + Velocity v)are executed in a vector manner. Or is the expression provided executed with a separate function call for each point in the domain sequentially?
If the second case applies then I would be in business ... |
|
March 5, 2007, 10:40 |
Re: Calculating principle stresses (Difficult)
|
#5 |
Guest
Posts: n/a
|
Found a solution. If you can calculate one root without imaginary numbers (which is always possible) you can calculate the other two roots by solving a quadratic equation without the use of imaginary numbers.
|
|
March 7, 2007, 12:55 |
Re: Calculating principle stresses (Difficult)
|
#6 |
Guest
Posts: n/a
|
If you ever do need to use Perl in CFX Post as part of an optimisation loop, you can! I know, because I do it. You can run a User Defined macro which allows the inclusion of Perl. This macro can be called from a session file and hence can be run in batch mode with no user intervention. I haven't used imaginary numbers (because what I'm doing doesn't need it), but I see no reason why you couldn't.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Scaling the Reynolds stresses via UDF | Markus | FLUENT | 1 | November 11, 2022 13:44 |
Problems in calculating the fluid traction on the current structure frame in 3D models | fw407 | OpenFOAM Running, Solving & CFD | 0 | August 6, 2008 13:04 |
Reynolds stresses without velocity correlations? | Phil | Main CFD Forum | 1 | October 2, 2006 05:29 |
How to update polyPatchbs localPoints | liu | OpenFOAM Running, Solving & CFD | 6 | December 30, 2005 18:27 |
Calculating Sub-grid Stresses | Craig Johansen | CFX | 0 | November 15, 2004 08:54 |