CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   curvature correction term, material derivative of a tensor (

volker April 1, 2010 11:08

curvature correction term, material derivative of a tensor

I'm planning to implement a curvature correction term to an explicit algebraic reynolds stress model based on the existing k-e-model of Launder and Sharma in order to sensitize the Launder-Sharma-model to streamline curvature.
The curvature correction term is to be implemented according to P.E. Smirnov and F.R. Menter "Sensitization of the SST Turbulence Model to Rotation and Curvature by Applying the Spalart-Shur Correction Term".
I ran into problems quite fast. There is a term, which is the material derivative of the shear strain tensor. The implementation is not straight-forward, especially in tensor notation. Either one has somehow to implement a summing over all faces of a control volume or to evaluate the gradient of the shear strain tensor, which leads to a tensor of third order. And right now, I do not see a way to get rid of this problem.
Does anyone has already tried to implement a curvature correction or has any experience on that? Or even know how to implement a material derivative of a tensor?

I'm glad for any hint.

Greets, volker

waynezw0618 April 1, 2010 11:46

I have try RC correction as you mentioned in ref paper. you can send me a mail. if interesting.

my email address:

theory37 May 6, 2010 16:55

Gradient of a second order tensor
I am attempting to add a term to a Reynolds stress transport model which involves taking the gradient of the Reynolds stress tensor, which should result in a tensor of rank three.

Even a simple attempt fails:


volTensorField test = fvc::grad(R);
(If I attempt to take the gradient of a non-symmetric tensor, I still cannot compile.) In both cases, the result is the same:


error: no type named ‘type’ in ‘class Foam::typeOfRank<double, 3>’
error: no matching function for call to 'grad(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>&)’

Is it possible to take the gradient of a second order tensor in FOAM?

Any ideas or help would be appreciated!

volker May 6, 2010 17:55

hi michael,

I had exactly the same problem, though I found it kind of surprising because OpenFOAM is supposed to handle tensors of rank three.
But the gradient seems to be restricted to tensors of rank one. I hope that there might be a workaround.

hope someone can help us.

cheers, volker

theory37 May 6, 2010 18:03

Hi Volker. I have discussed this problem with some of my colleagues here and we agree that this would be non-trivial to implement. I am going to try, and I'll keep you posted on my progress. Feel free to contact me through if you'd like.

FYI, I have tried not assigning the gradient to a particular type by simple putting


to see if I could figure out what type FOAM was looking for. No luck.



volker May 7, 2010 08:29

would be great, if you would come up with something new.

keep me posted!

volker May 27, 2010 04:50

hi michael,

did you manage to implement the gradient of a tensor?

cheers, volker

theory37 June 3, 2010 09:08

1 Attachment(s)
Hi Volker,

I managed to do what I needed "by hand" but it is sloppy and not generic. I'll attach the source for it. It has no external dependencies (you can ignore the inclusion of OEC.H) and it doesn't need to be cast in the incompressible or RASModels name space - I simply took it right from my existing code.

In my case, I needed something like fvc::grad(kINT) & fvc::grad(RINT) with kINT being a volScalarField and RINT being a volSymmTensorField. Note that this inner product (of grad(kINT), a vector, and grad(RINT), a rank 3 tensor) results in a rank 2 symmetric tensor. I know this isn't exactly what you were looking for, but the structure is there.

Let me know if you need any help :)


All times are GMT -4. The time now is 19:55.