CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Tensor driven convection (http://www.cfd-online.com/Forums/openfoam-solving/60058-tensor-driven-convection.html)

 petr August 22, 2006 06:26

Hi, I want to distretize im

Hi,

I want to distretize implicitly the terms:

div((C*C) & V)

and div(V*C)

where C is a vector. This is only possible explicitly using the fvc function. I want to solve for the vector V and for stability reason implicitly. Anybody know if this is possible and how?

Petr

 david_h August 22, 2006 09:17

Petr, I don't think you can

Petr,

I don't think you can make the terms fully implicit until a coupled equation capability is introduced into the library.

In the interim, you can modify the method
used for the velocity equations in Reynolds
Stress Transport Models, in which the stress divergence is aranged as an implicit diagonal and an explicit correction.

For the first term:

volScalarField traceCC = (1.0/3.0)*tr(C*C)
or
volScalarField traceCC = C & C;

fvc::div( (C*C) & V)

For the second term (one possiblility might be)
+ fvc::div(V*C)

hope this helps

Dave

 petr August 23, 2006 06:06

Dave, thank you for the kind r

Dave, thank you for the kind reply. I understand what you mean, but have some problems implementing. grad does not exist in the fvm scope, do you mean div:

fvm::div( traceCC, V)
- fvc::div( traceCC, V)
+ fvc::div( (C*C) & V)

then traceCC must somehow be interpolated to surfaceScalarField, I think.

for the second term I think you mean gradC = fvc::grad(C)? For some reason diag() is not recognized, but according the programmers guide it should work.
The compiler says:
error: 'diag' was not declared in this scope

Might the name have changed?

Petr

 david_h August 23, 2006 16:08

Petr, You are correct abou

Petr,

To get traceCC as a surfaceScalarField, you could use fvc::interpolate(traceCC),

The diag() function does not appear to have been implemented for volTensorFields. Further, since fvm::Su and fmv:SuSp only take a volScalarField as a first argument, you wouldn't be able to use a tensor anyway. You could try using: