CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Transformation of volSymmTensorField to volTensorField (http://www.cfd-online.com/Forums/openfoam/67623-transformation-volsymmtensorfield-voltensorfield.html)

svens August 20, 2009 22:20

Transformation of volSymmTensorField to volTensorField
 
Hello together

Is there a way to transform a existing volSymmTensorField to a volTensorField?

I want to implement a new turbulence model which is based on the use of the symmetric part of the mean velocity gradient Sij as well as the skew-symmetric ones Wij.

In my eyes - defining the symmetric part Sij is no big deal:
Code:

volSymmTensorField S = symm(fvc::grad(U_));
but the skew-symmetric part Wij has to be a tensor with all 9 componets (I guess...?). I defined it like this:
Code:

volTensorField W = skew(fvc::grad(U_));
Bringing then all together leads to an error while compiling. The operator '==' in the REqn (in line: 431 - I used the LaunderGibsonRSTM as basis for my new model - switched from tmp<fvSymmTensorMatrix> to tmp<fvTensorMatrix> REqn) couldn't been recognized anymore.
So far I guess it's because of the different number of components I used while defining with volSymmTensorField and volTensorField.

Therefore my quetion: Is there a way to transform a existing volSymmTensorField to a volTensorField?
But maybe there is a better way to deal with my problem? I'm grateful about every input!

Thanks a lot & greetings
Sven

svens September 4, 2009 01:28

Hello together

It doesn't really answer my question but I found a way to solve my problem:

I had a further look at my eqautions and recognized that I'm multiply my new skew-symmetric tensor W with a symmetric ones b. After that I'm summing this product like (bW + Wb) which creates a symmetric tensor again. While implementing it like symm(bW+Wb) to the REqn all my problems with tmp<fvSymmTensorMatrix> dissapeared.

Maybe someone of you can help this.

Cheers - Sven

iyer.arvind November 19, 2009 06:47

Q&D fix
 
A quick and dirty fix.
Just multiply with tensor(1,0,0,0,1,0,0,0,1)

too bad but if performance is not a concern go ahead, kill the CPU ;)


All times are GMT -4. The time now is 11:21.