CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

fvm::ddt(eigenVectors(S)) ????

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 18, 2012, 10:37
Default fvm::ddt(eigenVectors(S)) ????
  #1
Member
 
Hai Yu
Join Date: Mar 2009
Location: OvgU, Magdeburg
Posts: 65
Rep Power: 8
yuhai is on a distinguished road
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.

Last edited by yuhai; July 18, 2012 at 11:59.
yuhai is offline   Reply With Quote

Old   July 19, 2012, 04:43
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   July 19, 2012, 09:59
Default
  #3
Member
 
Hai Yu
Join Date: Mar 2009
Location: OvgU, Magdeburg
Posts: 65
Rep Power: 8
yuhai is on a distinguished road
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>:perator() [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.
yuhai is offline   Reply With Quote

Old   July 19, 2012, 10:16
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 14:20.