Cube root in OpenFOAM
Hello everyone,
Does anyone knows how to put cube root in OpenFOAM? |
Yes, this is quite straightforward. Knowing that we can calculate the square root of something e.g. x with :
Code:
sqrtX = sqrt(x) Code:
cbrtX = cbrt(x) Code:
cbrtX = pow(x,1.0/3.0) |
Thanks a lot!
|
For a more safe result (including negative numbers) you can use the following:
Code:
// calculate the cube root of abs(x) |
Thanks for the suggestion!
|
All times are GMT -4. The time now is 07:03. |