|
[Sponsors] |
April 22, 2010, 05:04 |
modified CrossPowerLaw wmake error
|
#1 |
New Member
Anders Bøje
Join Date: Apr 2010
Posts: 7
Rep Power: 16 |
Solution no longer needed.
Thread can be deleted. Hi I have modified the crossPowerLaw viscosity model to include temperature, but when I run wmake I get some errors referring to operator*. It might just be some syntax error with the exp() function, but I am not familiar enough with neither C++ or OpenFoam to see exactly what the problem might be. Problem area Code:
return (nu0_)/(scalar(1) + pow(m_*strainRate(), n_))*exp(C_*T); Message from running wmake Code:
anders@Anders-laptop:~/OpenFOAM/OpenFOAM-1.6/src/transportModels/incompressible$ wmake Making dependency list for source file /home/anders/svn/Simulering/Viscosity/CrossPowerLawTemp.C SOURCE=/home/anders/svn/Simulering/Viscosity/CrossPowerLawTemp.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I.. -I/home/anders/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/anders/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/CrossPowerLawTemp.o /home/anders/svn/Simulering/Viscosity/CrossPowerLawTemp.C: In member function ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::viscosityModels::CrossPowerLawTemp::calcNu() const’: /home/anders/svn/Simulering/Viscosity/CrossPowerLawTemp.C:53: error: no match for ‘operator*’ in ‘((const Foam::viscosityModels::CrossPowerLawTemp*)this)->Foam::viscosityModels::CrossPowerLawTemp::C_ * Foam::T’ /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionSet.H:266: note: candidates are: Foam::dimensionSet Foam::operator*(const Foam::dimensionSet&, const Foam::dimensionSet&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedScalar.H:56: note: Foam::dimensionedScalar Foam::operator*(const Foam::dimensionedScalar&, Foam::scalar) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedSymmTensor.H:69: note: Foam::dimensionedVector Foam::operator*(const Foam::dimensionedSymmTensor&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedTensor.H:75: note: Foam::dimensionedVector Foam::operator*(const Foam::dimensionedTensor&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/dimensionedTensor.H:78: note: Foam::dimensionedTensor Foam::operator*(const Foam::dimensionedVector&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::UList<double>&, const Foam::UList<double>&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::UList<double>&, const Foam::tmp<Foam::Field<double> >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::tmp<Foam::Field<double> >&, const Foam::UList<double>&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/scalarField.H:81: note: Foam::tmp<Foam::Field<double> > Foam::operator*(const Foam::tmp<Foam::Field<double> >&, const Foam::tmp<Foam::Field<double> >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/symmTensorField.H:71: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::UList<Foam::SymmTensor<double> >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/symmTensorField.H:71: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::tmp<Foam::Field<Foam::SymmTensor<double> > >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:76: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::UList<Foam::Tensor<double> >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:76: note: Foam::tmp<Foam::Field<Foam::Vector<double> > > Foam::operator*(const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:77: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator*(const Foam::UList<Foam::Vector<double> >&) /home/anders/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/tensorField.H:77: note: Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator*(const Foam::tmp<Foam::Field<Foam::Vector<double> > >&) make: *** [Make/linuxGccDPOpt/CrossPowerLawTemp.o] Error 1 CrossPowerLawTemp.C Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ #include "CrossPowerLawTemp.H" #include "addToRunTimeSelectionTable.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace viscosityModels { defineTypeNameAndDebug(CrossPowerLawTemp, 0); addToRunTimeSelectionTable ( viscosityModel, CrossPowerLawTemp, dictionary ); } } // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> Foam::viscosityModels::CrossPowerLawTemp::calcNu() const { // return (nu0_ - nuInf_)/(scalar(1) + pow(m_*strainRate(), n_)) + nuInf_; //Original Cross model return (nu0_)/(scalar(1) + pow(m_*strainRate(), n_))*exp(C_*T); //Modified Viscosity model with temperature } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::viscosityModels::CrossPowerLawTemp::CrossPowerLawTemp ( const word& name, const dictionary& viscosityProperties, const volVectorField& U, const surfaceScalarField& phi ) : viscosityModel(name, viscosityProperties, U, phi), CrossPowerLawTempCoeffs_(viscosityProperties.subDict(typeName + "Coeffs")), nu0_(CrossPowerLawTempCoeffs_.lookup("nu0")), nuInf_(CrossPowerLawTempCoeffs_.lookup("nuInf")), m_(CrossPowerLawTempCoeffs_.lookup("m")), n_(CrossPowerLawTempCoeffs_.lookup("n")), C_(CrossPowerLawTempCoeffs_.lookup("C")),//Cross time constant nu_ ( IOobject ( name, U_.time().timeName(), U_.db(), IOobject::NO_READ, IOobject::AUTO_WRITE ), calcNu() ) {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::viscosityModels::CrossPowerLawTemp::read ( const dictionary& viscosityProperties ) { viscosityModel::read(viscosityProperties); CrossPowerLawTempCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs"); CrossPowerLawTempCoeffs_.lookup("nu0") >> nu0_; CrossPowerLawTempCoeffs_.lookup("nuInf") >> nuInf_; CrossPowerLawTempCoeffs_.lookup("m") >> m_; CrossPowerLawTempCoeffs_.lookup("n") >> n_; CrossPowerLawTempCoeffs_.lookup("C") >> C_;//Cross time constant return true; } // ************************************************************************* // Anders Last edited by andboje; May 9, 2010 at 12:56. |
|
September 24, 2010, 11:47 |
Hi
|
#2 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi
I think the problem is in pe defining T i have the same problem, so did you defined T in your CrossPowerLawTemp file? |
|
September 24, 2010, 12:11 |
|
#3 | |
New Member
Anders Bøje
Join Date: Apr 2010
Posts: 7
Rep Power: 16 |
Hi
You are absolutely right, it needs to be declared. This work was done as part of a 4 month group project on my University and I am no longer working on it. However, the problem in this thread did get resolved. Here is a small section of our report, which describes the issue, I hope it helps a bit. Quote:
|
||
September 24, 2010, 12:42 |
Hi
|
#4 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi
ok so i need only to define T like a volScalarField but where? in the viscositymodel.C file before multiplying by C_ ?? or in the viscositymodel.H file? i have a problem in wmake? i got these error: error: no matching function for call to 'Foam::GeometricField<double, Foam::fvPatcheField, Foam::volMesh>::GeometricField()' Can you tell me how exactly to do the wmake for a new viscosityLaw in the viscosityModels folder? what about the option file and InInclude folder? knowing i copied all to the $WM_USER_DIR/OpenFoam/...etc Thanks a lot T.D. |
|
September 24, 2010, 13:14 |
|
#5 |
New Member
Anders Bøje
Join Date: Apr 2010
Posts: 7
Rep Power: 16 |
I cannot remember the specifics about this, much of it I did not work on personally. However, I do remember how frustrating it was working with this.
I have attached a folder, maybe you can make some sense out of this. The files in question should be in there I think. I had to split it in two because of the size limit on this forum. The transportModels just goes inside interTempFoamv1.3. |
|
September 24, 2010, 13:50 |
Thanks
|
#6 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Thanks yes indeed i found it inside
thank you so much I have a last question concerning boundary conditions If i need to apply a bc to the Field T et a certain patch, but this bc is a function of another term used in calculation which is different from T For example: if i have a flux J=shearRate*Q+etc..... and i need to apply at a certain BC on the patch of T field which is J=0; knowing that i don't know anything about T BC at that patch. i hope you understood me? help pease? thank you so much |
|
September 24, 2010, 17:01 |
|
#7 |
New Member
Anders Bøje
Join Date: Apr 2010
Posts: 7
Rep Power: 16 |
I am going to have to dissapoint you, but I really do not know about the boundary conditions.
Hopefully someone else can help you out with that. But good luck with your work, trying to figure out the inner workings of OpenFOAM is a big task. |
|
September 28, 2010, 10:58 |
Problem is still
|
#8 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi andboje, how are you?
I made the same as your files, but always i still have this error even if i took for example your CrossPowerLawTemp and then i do the wmake i get this error: error: 'T_' was not declared in this scope help please thanks a lot |
|
September 28, 2010, 11:13 |
|
#9 |
New Member
Anders Bøje
Join Date: Apr 2010
Posts: 7
Rep Power: 16 |
Hi again
When do you get this error, when typing wmake or when running a case? Try this: In the terminal you navigate to the incompressible folder and type Code:
wmake libso Code:
wmake |
|
September 28, 2010, 11:17 |
Problem is still
|
#10 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi
but already indeed i am doing from /incompressible folder wmake libso and always the same error: 'T_' was not declared in this scope help please T.D. |
|
September 28, 2010, 11:27 |
|
#11 |
New Member
Anders Bøje
Join Date: Apr 2010
Posts: 7
Rep Power: 16 |
What version of OpenFOAM are you using, I can see there is a version 1.7 on their website. We were working with 1.6 and I remember code not being easily adopted from previous versions to that one.
I don't know if this is the issue, but it might be. |
|
September 28, 2010, 11:30 |
problem is still
|
#12 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi
i am using 1.7.1 help me please i think the problem is in defining T_ however even in the code it does not give any error for other fields, just only for T_, that says, T_ was not declared in this scope !!! ? and i don't think there might be a huge difference between versions 1.6 and 1.7, i don't know, i am confused what to do help me please thanks alot T.D. |
|
October 12, 2010, 09:32 |
compiling error
|
#13 |
Member
mohsen kh
Join Date: Nov 2009
Posts: 41
Rep Power: 16 |
Hi every body,
I have a problem when I want to compile a model. the error is: ************************************************** ********************* ************************************************** ********************* viscoelasticLaws/mohsen/mohsen.C:159: error: no match for ‘operator==’ in ‘Foam:perator+(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::div(const Foam::surfaceScalarField&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::SymmTensor<double>](((Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>&)(&((Foam::mohsen*)this)->Foam::mohsen::a_))))))) == Foam:perator+(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = Foam::Tensor<double>, Type2 = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam:perator*(const Foam::dimensioned<double>&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam:perator&(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Type1 = Foam::SymmTensor<double>, Type2 = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam:perator-(const Foam::dimensioned<Type>&, const Foam::tmp<Foam::GeometricField<Type1, PatchField, GeoMesh> >&) [with Form = Foam::SymmTensor<double>, Type = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >&)((const Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >*)(& Foam:perator*(const Foam::scalar&, const Foam::GeometricField<Type, PatchField, GeoMesh>&) [with Type = Foam::SymmTensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>&)((const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>*)(&((Foam::mohsen*)this)->Foam::mohsen::a_))))))))))))))))))))’ ************************************************** ************ ************************************************** ************ and the model is : // Velocity gradient tensor volTensorField L = fvc::grad( U() ); // Convected derivate term // volTensorField C = tau_ & L; // vorticity term volTensorField Vor = L - L.T(); // Twice the rate of deformation tensor volSymmTensorField twoD = twoSymm( L ); // fc scalar fc = 0.5; //1 - 27 * det( a_ ); //double dot term // volSymmTensorField mk = -( (2 / 35) * ( 1 - fc ) * twoD - (2 / 7) * ( a_ & twoD + twoD & a_ + (1 / 2) * tr( twoD & a_ ) * I_ ) - fc * tr( twoD & a_ ) * a_ ); // Stress transport equation tmp<fvSymmTensorMatrix> aEqn ( fvm::ddt(a_) + fvm::div(phi(), a_) == ( 1 / 2 ) * ( Vor & a_ - a_ & Vor ) + ( 1 / 2 ) * keisi_ * ( twoD & a_ + a_ & twoD + 2 * ( ( (2 / 35) * ( 1 - fc ) * twoD - (2 / 7) * ( 1 - fc ) * ( a_ & twoD + twoD & a_ + (1 / 2) * tr( twoD & a_ ) * I_ ) - fc * tr( twoD & a_ ) * a_ ) ) + 2 * ci_ * twoD & ( I_ - 3 * a_ ) //+ twoSymm( C ) //- zeta_ / 2 * ( (tau_ & twoD) + (twoD & tau_) ) //- fvm::Sp( epsilon_ / etaP_ * tr(tau_) + 1/lambda_, tau_ ) ); aEqn().relax(); solve(aEqn); // Viscoelastic stress tau_ = (etaP_ / keisi_) * (a_ - I_); } ************************************************** **************** ************************************************** **************** where "a" , "tau" and "I" are symmetric tensors and "Vor" is asymmetric tensor. and the others are constant parameters. best |
|
October 12, 2010, 14:07 |
HI
|
#14 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi
How did you compiled your new Law in the viscosityModels ? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
erros when compiling simpleSRFFoam | examosty | OpenFOAM Installation | 12 | April 26, 2010 19:53 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
Regarding FoamX running Kindly help out | hariya03 | OpenFOAM Pre-Processing | 0 | April 18, 2008 05:26 |
[Netgen] Compiling Netgen on Fedora Core is driving me crazy | jango | OpenFOAM Meshing & Mesh Conversion | 3 | November 9, 2007 14:29 |