CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   fvm::ddt(eigenVectors(S)) ???? (http://www.cfd-online.com/Forums/openfoam-programming-development/104909-fvm-ddt-eigenvectors-s.html)

yuhai July 18, 2012 10:37

fvm::ddt(eigenVectors(S)) ????
 
Dear Foamers,
In my transport equation, I need to calculate "fvm::ddt(eigenVectors(S))",
S here is a 3x3 tensor.
when I compile, system gives error:

---------------------------
no matching function for call to ‘ddt(Foam::tmp<Foam::GeometricField<Foam::Tensor<d ouble>, Foam::fvPatchField, Foam::volMesh> >)’
---------------------------




if I write:
.....................
S = eigenVectors(S);
fvm::ddt(S);
....................
I can compile it. But in the latter way, it seems that I can not include the calculator "eigenVectors()" into the "SEqn.solve()".




Can you give some advice?
Thanks in advance.

H.Y.

ngj July 19, 2012 04:43

Good day,

It looks like eigenVectors(S) returns a tmp format. So can you compile the following:

Code:

fvm::ddt( eigenVectors(S)() )
Please note the additional parentheses in the call. These strip the tmp-state of the return variable and yields a reference to a vol-field (that is instead of a tmp<vol-field>).

Kind regards,

Niels

yuhai July 19, 2012 09:59

thank you for the fast help,
but I got new problems, (sorry, i am a so "new" C++ coder....)
I try to multiply in this way:
-----------------------------

(eigenVectors(S)()) & fvm::ddt(eigenVectors(S)());
.............................

and got error as:
________________
SEqn.H:3: error: no match for ‘operator&’ in ‘Foam::eigenVectors(const Foam::GeometricField<Foam::Tensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]().Foam::tmp<T>::operator() [with T = Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>]() & Foam::fvm::ddt(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::Tensor<double>]()’
________________

and can you give also some advice of it?

Thanks.
H.Y.

ngj July 19, 2012 10:16

Hi,

You are trying to do an inner product of a tensor (?) and the matrix coefficients in your linear set of equations.

That kind of operator is not supported by OpenFoam, at least not if you want to solve the 6 or 9 equations in a segregated approach, because you directly couple all the equations by that approach.

You might be able to address the problem with a block-coupled solver, however, that is far beyond my expertise, or you should formulate you problem as a segregated one.

Good luck,

Niels


All times are GMT -4. The time now is 15:28.