CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Implementing v2f turbulence model in 2.1.x - GName not declared error (https://www.cfd-online.com/Forums/openfoam-solving/128430-implementing-v2f-turbulence-model-2-1-x-gname-not-declared-error.html)

Thangam January 12, 2014 06:06

Implementing v2f turbulence model in 2.1.x - GName not declared error
 
hi,

Im trying to implement the v2f model in version 2.1.x but without any success.

steps followed:

1) Downloaded the v2f.C and v2f.H files from https://github.com/OpenFOAM/OpenFOAM-2.2.x

2) created a new folder in my /src/turbulenceModels/incompressible/RAS/v2f

3) created a Make folder with files & options:

Files:
Code:

v2f.C
LIB = $(FOAM_USER_LIBBIN)/libmyincompressibleRASModels

options:
Code:

EXE_INC = \
    -I$(LIB_SRC)/turbulenceModels \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/transportModels \
    -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude
LIB_LIBS =

4) used the command 'wmake libso'

but resulted in the following error:

Code:

wmakeLnInclude: linking include files to ./lnInclude
SOURCE=v2f.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 
-DNoRepository -ftemplate-depth-100 -I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/turbulenceModels
-I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude
-I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/transportModels -I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/turbulenceModels/incompressible/RAS/lnInclude -IlnInclude -I.
 -I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/thangam/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude
  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/v2f.o
v2f.C: In member function ‘virtual void Foam::incompressible::RASModels::v2f::correct()’:
v2f.C:367:34: error: ‘GName’ was not declared in this scope
make: *** [Make/linux64GccDPOpt/v2f.o] Error 1

‘GName’ was not declared in this scope is the error. Any ideas where im going wrong?


Thanks.

alexeym January 12, 2014 07:28

From 2.2.2's $FOAM_SRC/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H:

Code:

inline word GName() const
{
    return word(type() + ":G");
}

also IIRC in 2.1.x it should be type() + ".G"

Thangam January 12, 2014 21:13

Quote:

Originally Posted by alexeym (Post 469672)
From 2.2.2's $FOAM_SRC/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H:

Code:

inline word GName() const
{
    return word(type() + ":G");
}

also IIRC in 2.1.x it should be type() + ".G"

Hi Alexey,

Thanks for the suggestion. Do you suggest to include the code you have mentioned in my 2.1.x ~/turbulenceModel.H as it is in 2.2.x ? (because you have replaced :G to .G) ? Any idea why this function is included in the 2.2.x and not the 2.1.x?

alexeym January 13, 2014 01:49

Quote:

Originally Posted by Thangam (Post 469710)
Hi Alexey,

Thanks for the suggestion. Do you suggest to include the code you have mentioned in my 2.1.x ~/turbulenceModel.H as it is in 2.2.x ? (because you have replaced :G to .G) ? Any idea why this function is included in the 2.2.x and not the 2.1.x?

Hi,

You've got several options, two of them are:

1. Replace call to GName() with "RASModel::G" (I've just checked the naming in 2.1.0's kEpsilon.C).

2. Add GName method into turbulenceModel class (turbulenceModel.H) like
Code:

inline word GName() const
{
  return word("RASModel::G");
}

I think string "RASModel::G" was changed to call to GName() for the ease of future renaming of G field.


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