|
[Sponsors] |
August 14, 2009, 13:06 |
Problem with skew and .T()
|
#1 |
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 17 |
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)) 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&) Code:
"skew(fvc::grad(U_))" = 0.5*(fvc::grad(U_)-fvc::grad(U_).T()) 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’ |
|
August 15, 2009, 09:33 |
|
#2 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
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 |
|
August 17, 2009, 12:40 |
|
#3 |
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 17 |
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==' Code:
+C5_*k_*(b&(skew(fvc::grad(U_)))+(skew(fvc::grad(U_)))&b) 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) ); |
|
|
|