CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   No matching function multiplying tensors for BC (http://www.cfd-online.com/Forums/openfoam/60837-no-matching-function-multiplying-tensors-bc.html)

Erik March 19, 2008 11:43

Hi All, Im trying to rewrit
 
Hi All,

Im trying to rewrite a boundary condition used in OpenFOAM 1.2 so that it compiles in OpenFOAM 1.4.1. I get stuck with the following error message:

erik@amigo:~/OpenFOAM/erik-1.4.1/applications/solvers/incompressible/lambdaMicroIcoFoam/BC s> wclean libso
erik@amigo:~/OpenFOAM/erik-1.4.1/applications/solvers/incompressible/lambdaMicroIcoFoam/BC s> wmake libso
/home/erik/OpenFOAM/OpenFOAM-1.4.1/wmake/wmakeLnInclude: linking include files to /home/erik/OpenFOAM/erik-1.4.1/applications/solvers/incompressible/lambdaMicroIc oFoam/BCs/lnInclude

Making dependency list for source file maxwellSlipU/maxwellSlipUFvPatchVectorField.C
Making dependency list for source file mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C
SOURCE=maxwellSlipU/maxwellSlipUFvPatchVectorField.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -IlnInclude -I. -I/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/maxwellSlipUFvPatchVectorField.o
SOURCE=mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -IlnInclude -I. -I/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mixedFixedValueSlipFvPatchFields.o
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/transformField.C: In function 'Foam::tmp<foam::field<type> > Foam::transformFieldMask(const Foam::tmp<foam::field<type2> >&) [with Type1 = Foam::Tensor<double>, Type2 = Foam::SymmTensor<double>]':
mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C:189: instantiated from 'Foam::tmp<foam::field<type> > Foam::mixedFixedValueSlipFvPatchField<type>::snGra dTransformDiag() const [with Type = Foam::Tensor<double>]'
mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C:43: instantiated from here
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/transformField.C:163: error: no matching function for call to 'Foam::tmp<foam::field<foam::tensor<double> > >::tmp(Foam::Field<foam::symmtensor<double> >*)'
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:55: note: candidates are: Foam::tmp<t>::tmp(const Foam::tmp<t>&) [with T = Foam::Field<foam::tensor<double> >]
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:46: note: Foam::tmp<t>::tmp(const T&) [with T = Foam::Field<foam::tensor<double> >]
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:37: note: Foam::tmp<t>::tmp(T*) [with T = Foam::Field<foam::tensor<double> >]
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/transformField.C: In function 'Foam::tmp<foam::field<type> > Foam::transformFieldMask(const Foam::tmp<foam::field<type2> >&) [with Type1 = Foam::SphericalTensor<double>, Type2 = Foam::SymmTensor<double>]':
mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C:189: instantiated from 'Foam::tmp<foam::field<type> > Foam::mixedFixedValueSlipFvPatchField<type>::snGra dTransformDiag() const [with Type = Foam::SphericalTensor<double>]'
mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C:43: instantiated from here
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/transformField.C:163: error: no matching function for call to 'Foam::tmp<foam::field<foam::sphericaltensor<doubl e> > >::tmp(Foam::Field<foam::symmtensor<double> >*)'
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:55: note: candidates are: Foam::tmp<t>::tmp(const Foam::tmp<t>&) [with T = Foam::Field<foam::sphericaltensor<double> >]
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:46: note: Foam::tmp<t>::tmp(const T&) [with T = Foam::Field<foam::sphericaltensor<double> >]
/home/erik/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/tmpI.H:37: note: Foam::tmp<t>::tmp(T*) [with T = Foam::Field<foam::sphericaltensor<double> >]
make: *** [Make/linux64GccDPOpt/mixedFixedValueSlipFvPatchFields.o] Error 1
erik@amigo:~/OpenFOAM/erik-1.4.1/applications/solvers/incompressible/lambdaMicroIcoFoam/BC s>

The lines of complaint concerning mixedFixedValueSlipFvPatchFields.C is listed here:
template<class>
tmp<field<type> > mixedFixedValueSlipFvPatchField<type>::snGradTrans formDiag() const
{
vectorField nHat = this->patch().nf();
vectorField diag(nHat.size());

diag.replace(vector::X, mag(nHat.component(vector::X)));
diag.replace(vector::Y, mag(nHat.component(vector::Y)));
diag.replace(vector::Z, mag(nHat.component(vector::Z)));

return
->THIS LINE
valueFraction_*pTraits<type>::one
+ (1.0 - valueFraction_)*transformFieldMask<type>(pow<vecto r,>::rank>(diag)); <-THIS LINE
}

Can someone please give me a hint what the error message refers to? To me it seems like there is a problem multiplying tensor<double> with a symmetric tensor<double>.

Many Thanks
Erik

hjasak March 19, 2008 11:54

Yes, that would give you a fou
 
Yes, that would give you a fourth-rank tensor, which is not instantiated.

Hrv

hjasak March 19, 2008 20:06

Nope - this line: mixedFixedVa
 
Nope - this line: mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C:189

I take it this is something you wrote yourself as well because I cannot find it in SVN...

Hrv

Erik March 20, 2008 14:05

Yes your right, the BC (maxwel
 
Yes your right, the BC (maxwellSlipUFvPatchVectorField using mixedFixedValueSlipFvPatchField) does not belong the the SVN. It was given to me.

I managed to compile my BC now, but I am interested if it still does what I want it to.

The BC I want to implement seems to be quite similar to partialSlip which is why I changed one of my included files of mixedFixedValueSlipFvPatchField.H from "transformField.H" to "symmTransformField.H", as for partialSlip.H.

Is it possible from just this information to say why I dont get the same tensor multiplication error by using the symmTransformField.H file?

Many Thanks
Erik


All times are GMT -4. The time now is 10:43.