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

How to bring OpenFoam 2.1 viscosityModel to OpenFoam 2.2

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: 11
Rep Power: 12
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: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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: 11
Rep Power: 12
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: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 17:25
openfoam 2.2 force coefficients 0 mihaipruna OpenFOAM Running, Solving & CFD 9 February 19, 2017 08:32
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 22:07.