CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

How to bring OpenFoam 2.1 viscosityModel to OpenFoam 2.2

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 20, 2014, 03:37
Question How to bring OpenFoam 2.1 viscosityModel to OpenFoam 2.2
  #1
New Member
 
Marvin
Join Date: Jan 2014
Posts: 8
Rep Power: 2
Marvin_Rauch is on a distinguished road
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:perator-(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:perator*(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:perator+(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:perator&(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

Last edited by Marvin_Rauch; January 20, 2014 at 05:15.
Marvin_Rauch is offline   Reply With Quote

Old   January 20, 2014, 08:55
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 476
Rep Power: 8
alexeym is on a distinguished road
Hi,

Quote:
Originally Posted by Marvin_Rauch View Post
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:perator-(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:perator*(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:perator+(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:perator&(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.
alexeym is offline   Reply With Quote

Old   January 24, 2014, 13:13
Default Whole equation
  #3
New Member
 
Marvin
Join Date: Jan 2014
Posts: 8
Rep Power: 2
Marvin_Rauch is on a distinguished road
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!
Marvin_Rauch is offline   Reply With Quote

Old   January 25, 2014, 07:40
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 476
Rep Power: 8
alexeym is on a distinguished road
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.
alexeym is offline   Reply With Quote

Reply

Tags
changelog, lptt, models

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 132 April 24, 2014 18:37
openfoam 2.2 force coefficients 0 mihaipruna OpenFOAM Running, Solving & CFD 5 April 2, 2013 05:51
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
Cross-compiling OpenFOAM 1.6 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 7 January 19, 2010 15:39
OpenFOAM Training and Workshop Hrvoje Jasak Main CFD Forum 0 October 7, 2005 07:14


All times are GMT -4. The time now is 15:22.