CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problem in recompiling a turbulence model in OpenFoam 2.1.1 (http://www.cfd-online.com/Forums/openfoam-programming-development/107578-problem-recompiling-turbulence-model-openfoam-2-1-1-a.html)

pascool October 1, 2012 17:14

Problem in recompiling a turbulence model in OpenFoam 2.1.1
 
Dear all,

I'am new to OpenFoam and have to compile a turbulence model which was programmed for OpenFoam 1.6 into the current version OpenFoam 2.1.1.
I tried it according to the manual by chalmers, however without any success.

The error log states:

Code:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file example/example.C
SOURCE=example/example.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/meshTools/lnInclude -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/transportModels -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude -IlnInclude -I. -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/example.o
example/example.C: In constructor ‘Foam::incompressible::RASModels::YWV_DY::YWV_DY(const volVectorField&, const surfaceScalarField&, Foam::transportModel&)’:
example/example.C:299:37: error: ‘epsilonSmall_’ was not declared in this scope
example/example.C: In member function ‘virtual void Foam::incompressible::RASModels::YWV_DY::correct()’:
example/example.C:447:21: error: ‘epsilon0_’ was not declared in this scope
example/example.C:482:35: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘Foam::volSymmTensorField {aka Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>}’ requested
example/example.C:490:35: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘Foam::volSymmTensorField {aka Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>}’ requested
example/example.C:492:35: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘Foam::volSymmTensorField {aka Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>}’ requested
example/example.C:540:17: error: ‘k0_’ was not declared in this scope
In file included from example/YWV_DY.H:35:0,
                from example/example.C:29:
/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H: In static member function ‘static Foam::autoPtr<Foam::incompressible::RASModel> Foam::incompressible::RASModel::adddictionaryConstructorToTable<RASModelType>::New(const volVectorField&, const surfaceScalarField&, Foam::transportModel&, const Foam::word&) [with RASModelType = Foam::incompressible::RASModels::YWV_DY, Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>, Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’:
/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:138:1:  instantiated from ‘Foam::incompressible::RASModel::adddictionaryConstructorToTable<RASModelType>::adddictionaryConstructorToTable(const Foam::word&) [with RASModelType = Foam::incompressible::RASModels::YWV_DY]’
example/example.C:48:1:  instantiated from here
/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:126:9: error: no matching function for call to ‘Foam::incompressible::RASModels::YWV_DY::YWV_DY(const volVectorField&, const surfaceScalarField&, Foam::transportModel&, const Foam::word&)’
/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:126:9: note: candidates are:
example/example.C:52:1: note: Foam::incompressible::RASModels::YWV_DY::YWV_DY(const volVectorField&, const surfaceScalarField&, Foam::transportModel&)
example/example.C:52:1: note:  candidate expects 3 arguments, 4 provided
example/YWV_DY.H:51:7: note: Foam::incompressible::RASModels::YWV_DY::YWV_DY(const Foam::incompressible::RASModels::YWV_DY&)
example/YWV_DY.H:51:7: note:  candidate expects 1 argument, 4 provided
/home/pascal/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/incompressible/RAS/lnInclude/RASModel.H:126:9: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [Make/linux64GccDPOpt/example.o] Error 1

Any help to fix that problem appreciated!
Many thanks, Pascal


pascool October 2, 2012 00:38

I hope that I almost fixed it. However, one error is still there:

Code:

example/example.C:482:35: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘Foam::volSymmTensorField {aka Foam::GeometricField<Foam::SymmTensor<double>, Foam::fvPatchField, Foam::volMesh>}’ requested
The corresponding line in the code is:

Code:

volSymmTensorField bb = (b & b);
where b is a volSymmTensorField as well.

Does anybody have an idea how to get it work?

Pascal

treima October 2, 2012 02:35

Hi,

are you sure, that b & b is a symmetric tensor?


regards
treima

pascool October 2, 2012 11:52

I'm not sure but it should since b is just a modification of the Reynoldsstress tensor

Bernhard October 2, 2012 13:22

Counterexample: http://www.wolframalpha.com/input/?i...%7D%7D&x=2&y=6

Edit: Hmm, this is probably not the definition of the dot product of tensorfields?

wyldckat October 2, 2012 16:17

Greetings to all!

Quote:

Originally Posted by treima (Post 384456)
are you sure, that b & b is a symmetric tensor?

This comment of Treima triggered my attention! This was a bug that was fixed in OpenFOAM 2.1.x back in December: The dot-product operator for two SymmTensor's returns a SymmTensor instead of a Tensor
This is also fixed in 1.6-ext since around the same time.

If by any chance you guys do need the result of "b & b" to be symmetric, you can do it with this:
Code:

symm(b & b)
Best regards,
Bruno

pascool October 3, 2012 12:03

Hi,

with the suggestion of Bruno to include

Code:

symm(b & b)
the compilation and the turbulent model runs without any errors.
I think the problem was that in OpenFoam 1.5 for which the model was writeen (b & b) automatically returned a symmetric tensor, since b is symmetric. With the mentioned bugfix this is no longer automatically valid.

The post processing will show whether the model computes reasonable results.

Thanks,

Pascal


All times are GMT -4. The time now is 05:45.