modified CrossPowerLaw wmake error
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 CrossPowerLawTemp.C Code:
/*---------------------------------------------------------------------------*\ Anders |
Hi
Hi
I think the problem is in pe defining T i have the same problem, so did you defined T in your CrossPowerLawTemp file? |
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:
|
Hi
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. |
2 Attachment(s)
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. |
Thanks
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 |
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. ;) |
Problem is still
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 |
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 |
Problem is still
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. |
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. |
problem is still
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. |
compiling error
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::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::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::operator+(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::operator*(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::operator&(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::operator-(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::operator*(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 |
HI
Hi
How did you compiled your new Law in the viscosityModels ? |
All times are GMT -4. The time now is 11:40. |