CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   How to represents terms (

titio July 2, 2009 11:58

How to represents terms
Hi Foamers,

I have a question concerning C++ programing, when considering OpenFoam. In my modelling I have to consider
a term in the form grad(U)+Transpose(Grad(U)), that corresponds to the deformation rate. What I do is:

volTensorField DU = fvc::grad(U)
volTensorField DUT = DU.T()

I think in this way that when I do fvc::grad(U) for DU, the second expressions is equivalent to write
DUT = fvc::grad(U.T()). The first form works without problems, the second gives me a compilation error.

Am I doing something wrong? If so, somebody has some idea on how I should made the calculation of this term?



henrik July 3, 2009 03:38

Hi Titio,


volTensorField DU = fvc::grad(U)
 volTensorField DUT = DU.T()

Here you are missing ";". Please post the complete code if this is not the problem.


All times are GMT -4. The time now is 01:29.