CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Problem with skew and .T()

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2009, 13:06
Default Problem with skew and .T()
  #1
Member
 
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 17
sven is on a distinguished road
Hey FOAMers,

I try to implement a new turbulence model in OpenFOAM. For doing this I slightly want to change the reynolds-stress equation of the LaunderGibsonRSTM-turbulence model. More exactly, I want add a new term to the currently existing terms of the equation. This term is:

Code:
C*k*((R_/(2*k)-1.0/3.0*I)&skew(fvc::grad(U_)) + skew(fvc::grad(U_))&(R_/(2*k)-1.0/3.0*I))
If I add this term and compile the file, I get the following error message:

Code:
YounisWeigandVogler.C: In member function ‘virtual void Foam::incompressible::RASModels::YounisWeigandVogler::correct()’:
YounisWeigandVogler.C:544: error: no match for ‘operator==’ in ‘Foam::operator+(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::tmp<Foam::fvMatrix<Type> >&) [with Type = Foam::SymmTensor<double>](((const Foam::tmp<Foam::fvMatrix<Foam::SymmTensor<double> > >&)((const Foam::tmp<Foam::fvMatrix<Foam::SymmTensor<double> > >*)(& Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::SymmTensor<double>](((Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>&)(&((Foam::incompressible::RASModels::YounisWeigandVogler*)this)->Foam::incompressible::RASModels::YounisWeigandVogler::R_))))))) == Foam::operator+(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = Foam::SymmTensor<double>, Type2 = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::skew(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, PatchField, GeoMesh> >&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]()))))’
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/cellShape.H:158: note: candidates are: bool Foam::operator==(const Foam::cellShape&, const Foam::cellShape&)
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/cellModelI.H:124: note:                 bool Foam::operator==(const Foam::cellModel&, const Foam::cellModel&)
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/cell.H:134: note:                 bool Foam::operator==(const Foam::cell&, const Foam::cell&)
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/faceI.H:138: note:                 bool Foam::operator==(const Foam::face&, const Foam::face&)
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/objectHit.H:110: note:                 bool Foam::operator==(const Foam::objectHit&, const Foam::objectHit&)
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/edgeI.H:171: note:                 bool Foam::operator==(const Foam::edge&, const Foam::edge&)
/home/sven/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/instant.H:140: note:                 bool Foam::operator==(const Foam::instant&, const Foam::instant&)
I thought it is perhaps a problem with the "skew function", so I tried not to use this function, but implementing it by using the definition of this function, that means:

Code:
"skew(fvc::grad(U_))" = 0.5*(fvc::grad(U_)-fvc::grad(U_).T())
Unfortunately this creates the following error message:


Code:
YounisWeigandVogler.C: In member function ‘virtual void Foam::incompressible::RASModels::YounisWeigandVogler::correct()’:
YounisWeigandVogler.C:544: error: ‘class Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >’ has no member named ‘T’
Has anyone encountered similar problems or does anyone know how to solve these problems? Thanks a lot
sven is offline   Reply With Quote

Old   August 15, 2009, 09:33
Default
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Dear Sven,

the precedence of the "&"-operator in C++ is differs from what is should be according to it equivalent in mathematics. I think the guide is mentioning that somewhere.

That means that you should put brackets around each term in involving "&" (a & b).

Please try and see whether the error message changes ...

Henrik
henrik is offline   Reply With Quote

Old   August 17, 2009, 12:40
Default
  #3
Member
 
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 17
sven is on a distinguished road
Thanks for your answer henrik. I tried to put brackets around the expressions with &, but it didn't help. I still get the error message:
Code:
no match for 'operator=='
I think it is a perhaps a problem, because the last term I add to the equation

Code:
+C5_*k_*(b&(skew(fvc::grad(U_)))+(skew(fvc::grad(U_)))&b)
is asymmetric, but the whole equation is defined for symmetric matrices

Code:
tmp<fvSymmTensorMatrix> REqn
    (
        fvm::ddt(R_)
      + fvm::div(phi_, R_)
      //- fvm::laplacian(Cs_*(k_/epsilon_)*R_, R_)
      - fvm::laplacian(DREff(), R_)
      + fvm::Sp(K1_*epsilon_/(2*k_)+K1Star_*G/(2*k_),R_)
      ==
        P
        +(1.0/3.0)*(K1_*epsilon_+K1Star_*G)*I-(2.0/3.0)*epsilon_*I
        +(C3_-C3Star_*(pow(trace_bb,0.5)))*k_*S
        +C4_*k_*((bS+Sb)-2.0/3.0*tr(bS)*I)
        +K2_*epsilon_*(bb-1.0/3.0*trace_bb*I)
       /+C5_*k_*(b&(skew(fvc::grad(U_)))+(skew(fvc::grad(U_)))&b)        
     );
Thus I tried to change fvSymmTensorMatrix to fvTensorMatrix, but that didnt help either!
sven is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 22:48.