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/)
-   -   Implementation of turbulence model (http://www.cfd-online.com/Forums/openfoam-programming-development/114951-implementation-turbulence-model.html)

idefix March 20, 2013 11:07

Implementation of turbulence model
 
Hello

I am trying to implement a new turbulence model, but it does not work.

Here are the steps I did:

user:~/OpenFOAM> mkdir OpenFOAM-2.1.1-user
user:~/OpenFOAM> cd OpenFOAM-2.1.1
user:~/OpenFOAM/OpenFOAM-2.1.1> cp -r --parents src/turbulenceModels/incompressible/RAS/kEpsilon ../OpenFOAM-2.1.1-user
user:~/OpenFOAM/OpenFOAM-2.1.1> cd ../OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS> mv kEpsilon/ VOFkEpsilon
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS> cd VOFkEpsilon/
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> mv kEpsilon.H VOFkEpsilon.H
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> mv kEpsilon.C VOFkEpsilon.C
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> sed s/kEpsilon/VOFkEpsilon/g VOFkEpsilon.C > temp
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> mv temp VOFkEpsilon.C
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> sed s/kEpsilon/VOFkEpsilon/g VOFkEpsilon.H > temp
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> mv temp VOFkEpsilon.H
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> ll
kEpsilon.dep
VOFkEpsilon.C
VOFkEpsilon.H

user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> cp -r $FOAM_SRC/turbulenceModels/incompressible/RAS/Make .
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> ll
Make
VOFkEpsilon.C
VOFkEpsilon.H
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> vi Make/files
In line 20 add: VOFkEpsilon/VOFkEpsilon.C
Finish with :wq
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> vi Make/options
I added -I$(LIB_SRC)/turbulenceModels/RAS/incompressible/lnInclude
The final file looks like
EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude
LIB_LIBS = \
-lincompressibleTurbulenceModel \
-lfiniteVolume \
-lmeshTools

Finish with :wq
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> vi VOFkEpsilon.C
In line 57 ad: Info << "my VOFkepsilon model" << endl;
Finish with :wq
user:~/OpenFOAM/OpenFOAM-2.1.1-user/src/turbulenceModels/incompressible/RAS/VOFkEpsilon> wmake libso
wmakeLnInclude: linking include files to ./lnInclude
make: *** No rule to make target »RASModel/RASModel.dep«,
needed by »Make/linux64GccDPOpt/dependencies« Stop.

Can any help me what I am doing wrong?

Thanks a lot

glasenapp March 28, 2013 06:43

Hello idefix,

It seems like you followed the instructions "How to implement your own turbulence model" given in the slides of Hakan Nilsson (Chalmers University).
What does your make/files look like? In my opinion, it should contain:

Code:

VOFkEpsilon.C

LIB = $(FOAM_USER_LIBBIN)/libmyincompressibleRASModels

Hope that helps.

Tobias


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