CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to bring OpenFoam 2.1 viscosityModel to OpenFoam 2.2 (https://www.cfd-online.com/Forums/openfoam-programming-development/128728-how-bring-openfoam-2-1-viscositymodel-openfoam-2-2-a.html)

Marvin_Rauch January 20, 2014 03:37

How to bring OpenFoam 2.1 viscosityModel to OpenFoam 2.2
 
Hello,

I'm trying to bring my viscosityModel from OpenFoam 2.1 to OpenFoam 2.2. I was told it worked with 2.1. So I have two questions.
Can I simply install OF2.1 besides OF2.2 to check if the viscosity Model really works?

The error that comes when typing wmake in OF 2.2 is

marvin@marvin-VirtualBox:~/OpenFOAM/marvin-2.2.1/src/transportModels/viscoelastic$ wmake
SOURCE=viscoelasticLaws/LPTT/LPTT.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam221/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam221/src/OpenFOAM/lnInclude -I/opt/openfoam221/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/LPTT.o
viscoelasticLaws/LPTT/LPTT.C: In member function ‘virtual void Foam::LPTT::correct()’:
viscoelasticLaws/LPTT/LPTT.C:112:66: error: no match for ‘operator-’ in ‘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, typename Foam::typeOfSum<Type, Form>::type = Foam::Tensor<double>]((*(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator*(const Foam::dimensioned<double>&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]((*(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, 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::Tensor<double>, Type2 = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, typename Foam::typeOfSum<Type, Form>::type = Foam::Tensor<double>]((*(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator&(const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&, const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]((*(const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>*)(&((Foam::LPTT*)this)->Foam::LPTT::tau_)))))))))))) - Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::SymmTensor<double>]((*(const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>*)(&((Foam::LPTT*)this)->Foam::LPTT::tau_)))’
viscoelasticLaws/LPTT/LPTT.C:112:66: note: candidates are:

and then there are hundreds of canditates listed

at the end it says:
make: *** [Make/linux64GccDPOpt/LPTT.o] Error 1

I can't find that file LPTT.o. What can I do to debug? I already looked into the LPTT.c file but don't see what I should change in line 112 :66
.................................................. .......................................row 66
.................................................. ..........................................|
.................................................. ..........................................v
line 112: - fvm::Sp( epsilon_ / etaP_ * tr(tau_) + 1/lambda_, tau_ )

Has anyone experience with bringing models from one version to a newer version? Is there any changelog or comparable document?
Thanks a lot for your help

alexeym January 20, 2014 08:55

Hi,

Quote:

Originally Posted by Marvin_Rauch (Post 470826)
Hello,

I'm trying to bring my viscosityModel from OpenFoam 2.1 to OpenFoam 2.2. I was told it worked with 2.1. So I have two questions.
Can I simply install OF2.1 besides OF2.2 to check if the viscosity Model really works?

The error that comes when typing wmake in OF 2.2 is

marvin@marvin-VirtualBox:~/OpenFOAM/marvin-2.2.1/src/transportModels/viscoelastic$ wmake
SOURCE=viscoelasticLaws/LPTT/LPTT.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam221/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam221/src/OpenFOAM/lnInclude -I/opt/openfoam221/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/LPTT.o
viscoelasticLaws/LPTT/LPTT.C: In member function ‘virtual void Foam::LPTT::correct()’:
viscoelasticLaws/LPTT/LPTT.C:112:66: error: no match for ‘operator-’ in ‘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, typename Foam::typeOfSum<Type, Form>::type = Foam::Tensor<double>]((*(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator*(const Foam::dimensioned<double>&, const Foam::tmp<Foam::GeometricField<Type, PatchField, GeoMesh> >&) [with Type = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]((*(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, 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::Tensor<double>, Type2 = Foam::Tensor<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh, typename Foam::typeOfSum<Type, Form>::type = Foam::Tensor<double>]((*(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, Foam::fvPatchField, Foam::volMesh> >*)(& Foam::operator&(const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&, const Foam::GeometricField<Foam::SymmTensor<double>, PatchField, GeoMesh>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]((*(const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>*)(&((Foam::LPTT*)this)->Foam::LPTT::tau_)))))))))))) - Foam::fvm::Sp(const Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = Foam::SymmTensor<double>]((*(const Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>*)(&((Foam::LPTT*)this)->Foam::LPTT::tau_)))’
viscoelasticLaws/LPTT/LPTT.C:112:66: note: candidates are:

and then there are hundreds of canditates listed

at the end it says:
make: *** [Make/linux64GccDPOpt/LPTT.o] Error 1

I can't find that file LPTT.o. What can I do to debug? I already looked into the LPTT.c file but don't see what I should change in line 112 :66
.................................................. .......................................row 66
.................................................. ..........................................|
.................................................. ..........................................v
line 112: - fvm::Sp( epsilon_ / etaP_ * tr(tau_) + 1/lambda_, tau_ )

Has anyone experience with bringing models from one version to a newer version? Is there any changelog or comparable document?
Thanks a lot for your help

Can you post the whole equation you solve in the model? From the output one can deduce that the problem is in minus in front of fvm::Sp(...). But to see the real problem one needs to see the whole equation.

Marvin_Rauch January 24, 2014 13:13

Whole equation
 
Thanks, I haven't been able to reach my OpenFOAM pc. Here is the equation:

// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

tmp<fvVectorMatrix> LPTT::divTau(volVectorField& U) const
{

// dimensionedScalar etaPEff = (1 + 1/epsilon_)*etaP_;
dimensionedScalar etaPEff = etaP_;

return
(
fvc::div(tau_/rho_, "div(tau)")
- fvc::laplacian(etaPEff/rho_, U, "laplacian(etaPEff,U)")
+ fvm::laplacian( (etaPEff + etaS_)/rho_, U, "laplacian(etaPEff+etaS,U)")
);

}


void LPTT::correct()
{
// Velocity gradient tensor
volTensorField L = fvc::grad( U() );

// Convected derivate term
volTensorField C = tau_ & L;

// Twice the rate of deformation tensor
volSymmTensorField twoD = twoSymm( L );


// Stress transport equation
tmp<fvSymmTensorMatrix> tauEqn
(
fvm::ddt(tau_)
+ fvm::div(phi(), tau_)
==
etaP_ / lambda_ * twoD
+ twoSymm( C )
- zeta_ / 2 * ( (tau_ & twoD) + (twoD & tau_) )
- fvm::Sp( epsilon_ / etaP_ * tr(tau_) + 1/lambda_, tau_ )
);

tauEqn().relax();
solve(tauEqn);
}

I hope this helps you to help me with my problems. ;)

Thanks in advance!

alexeym January 25, 2014 07:40

From the error message and code I can suppose that OpenFOAM doesn't know how to subtract Tensor from SymmTensor. In the RHS of the equation all terms are SymmTensors except -fvm::Sp(...).

And answering one of your first questions: yes, you can install 2.1.x along with 2.2.2.


All times are GMT -4. The time now is 11:31.