CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   New turbulence model in OF 3 and no proper make file? (https://www.cfd-online.com/Forums/openfoam-programming-development/167840-new-turbulence-model-3-no-proper-make-file.html)

Mojtaba.a March 10, 2016 03:01

New turbulence model in OF 3 and no proper make file?
 
Hi,
I was trying to add a new turbulence model of my own into OpenFOAM but I found out that the make files corresponding to turbulence models doesn't even contain .C files of the turbulence models.
I am making an alternative turbulence model from kEpsilon. so I have copied kEpsilon from
Code:

$SRC/TurbulenceModels/turbulenceModels/RAS/kEpsilon
And the corresponding make files which are located in here:
Code:

$SRC/TurbulenceModels/turbulenceModels/Make
But actually there is no kEpsilon.C (or any other .C file of all other turbulence models) included in it. There is no such a thing with OpenFOAM 2.x.

What am I doing wrong?
Thanks all.

alexeym March 10, 2016 03:23

Hi,

Assuming you need incompressible version of k-epsilon, there is

Code:

$FOAM_SRC/TurbulenceModels/incompressible/Make
inside files file there is turbulentTransportModels/turbulentTransportModels.C, and if you look inside $FOAM_SRC/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C, you find:

Code:

#define makeRASModel(Type)                                                    \
    makeTemplatedTurbulenceModel                                              \
    (transportModelIncompressibleTurbulenceModel, RAS, Type)
...
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
...
#include "kEpsilon.H"
makeRASModel(kEpsilon);

Not quite sure it fits into the definition of "proper make file".

Mojtaba.a March 10, 2016 03:37

Quote:

Originally Posted by alexeym (Post 588951)
Hi,

Assuming you need incompressible version of k-epsilon, there is

Code:

$FOAM_SRC/TurbulenceModels/incompressible/Make
inside files file there is turbulentTransportModels/turbulentTransportModels.C, and if you look inside $FOAM_SRC/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C, you find:

Code:

#define makeRASModel(Type)                                                    \
    makeTemplatedTurbulenceModel                                              \
    (transportModelIncompressibleTurbulenceModel, RAS, Type)
...
// -------------------------------------------------------------------------- //
// RAS models
// -------------------------------------------------------------------------- //
...
#include "kEpsilon.H"
makeRASModel(kEpsilon);

Not quite sure it fits into the definition of "proper make file".

Thanks Alexey, I got it.
But I truly wonder why the previous straightforward structure is changed into this.

Mojtaba.a March 10, 2016 03:52

Another question,
I copied and renamed the kEpsilon model in:

Code:

$SRC/TurbulenceModels/turbulenceModels/RAS
And then I added the following lines:

Code:

#include "kEpsilonTest.H"
makeRASModel(kEpsilonTest);

Into:

Code:

$SRC/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C
But when I use wmake libso, I get:

Code:

could not open file kEpsilonTest.H for source file turbulentTransportModels/turbulentTransportModels.C due to No such file or directory
What are the steps I am missing here?
Thanks.

Mojtaba.a March 10, 2016 04:06

I manually added links for .C and .H files into:

Code:

$SRC/TurbulenceModels/turbulenceModels/lnInclude
And it solved the problem.

wolfindark March 19, 2016 22:37

1 Attachment(s)
I try to implement a new LaunderSharmeKE model for compressible spray application in Openfoam-plus

I think this form of implementation a little better for clarity compared to copying all Turbulence directory..... But I have a problem.

You can see the files from the attached zip folder.

My implementation seems working fine but when I run the case (using sprayFoam acheenBomb tutorial) I got the following "Dublicate entry" warning. But the case continue to run.

do you have an idea?

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : plus-992902758787
Exec  : sprayFoam
Date  : Mar 20 2016
Time  : 12:26:35
Host  : "dynabook"
PID    : 5219
Case  : /home/neo/OpenFOAM/neo-plus/run/aachenBomb
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Duplicate entry laminar in runtime selection table TurbulenceModel
#0        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x27) [0x7ff7f42c2fc9]
#1        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libcompressibleTurbulenceModels.so(_ZN4Foam15TurbulenceModelINS_17geometricOneFieldENS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEENS_27compressibleTurbulenceModelENS_11fluidThermoEE31adddictionaryConstructorToTableINS_7laminarINS_18ThermalDiffusivityINS_27CompressibleTurbulenceModelIS7_EEEEEEEC1ERKNS_4wordE+0xa9) [0x7ff7fcd5d267]
#2        /home/neo/OpenFOAM/neo-plus/platforms/linux64GccDPInt32Debug/lib/MYlibRASModels.so(+0xac78e) [0x7ff7ed7a578e]
#3        /home/neo/OpenFOAM/neo-plus/platforms/linux64GccDPInt32Debug/lib/MYlibRASModels.so(+0xaca1e) [0x7ff7ed7a5a1e]
#4        /lib64/ld-linux-x86-64.so.2(+0x1013a) [0x7ff7fd67d13a]
#5        /lib64/ld-linux-x86-64.so.2(+0x10223) [0x7ff7fd67d223]
#6        /lib64/ld-linux-x86-64.so.2(+0x14c70) [0x7ff7fd681c70]
#7        /lib64/ld-linux-x86-64.so.2(+0xfff4) [0x7ff7fd67cff4]
#8        /lib64/ld-linux-x86-64.so.2(+0x143bb) [0x7ff7fd6813bb]
#9        /lib/x86_64-linux-gnu/libdl.so.2(+0x102b) [0x7ff7f38ba02b]
#10        /lib64/ld-linux-x86-64.so.2(+0xfff4) [0x7ff7fd67cff4]
#11        /lib/x86_64-linux-gnu/libdl.so.2(+0x162d) [0x7ff7f38ba62d]
#12        /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x31) [0x7ff7f38ba0c1]
#13        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam6dlOpenERKNS_8fileNameEb+0x7e) [0x7ff7f42c0b38]
#14        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_8fileNameEb+0x42) [0x7ff7f400404e]
#15        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_10dictionaryERKNS_4wordE+0xa6) [0x7ff7f400446e]
#16        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam4TimeC1ERKNS_4wordERKNS_7argListES3_S3_+0x551) [0x7ff7f401634f]
#17        sprayFoam() [0x48ccfa]
#18        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ff7f2cf5ec5]
#19        sprayFoam() [0x48cb29]
Duplicate entry RAS in runtime selection table TurbulenceModel
#0        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x27) [0x7ff7f42c2fc9]
#1        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libcompressibleTurbulenceModels.so(_ZN4Foam15TurbulenceModelINS_17geometricOneFieldENS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEENS_27compressibleTurbulenceModelENS_11fluidThermoEE31adddictionaryConstructorToTableINS_8RASModelINS_15EddyDiffusivityINS_18ThermalDiffusivityINS_27CompressibleTurbulenceModelIS7_EEEEEEEEEC2ERKNS_4wordE+0xa9) [0x7ff7fcd5d461]
#2        /home/neo/OpenFOAM/neo-plus/platforms/linux64GccDPInt32Debug/lib/MYlibRASModels.so(+0xac857) [0x7ff7ed7a5857]
#3        /home/neo/OpenFOAM/neo-plus/platforms/linux64GccDPInt32Debug/lib/MYlibRASModels.so(+0xaca1e) [0x7ff7ed7a5a1e]
#4        /lib64/ld-linux-x86-64.so.2(+0x1013a) [0x7ff7fd67d13a]
#5        /lib64/ld-linux-x86-64.so.2(+0x10223) [0x7ff7fd67d223]
#6        /lib64/ld-linux-x86-64.so.2(+0x14c70) [0x7ff7fd681c70]
#7        /lib64/ld-linux-x86-64.so.2(+0xfff4) [0x7ff7fd67cff4]
#8        /lib64/ld-linux-x86-64.so.2(+0x143bb) [0x7ff7fd6813bb]
#9        /lib/x86_64-linux-gnu/libdl.so.2(+0x102b) [0x7ff7f38ba02b]
#10        /lib64/ld-linux-x86-64.so.2(+0xfff4) [0x7ff7fd67cff4]
#11        /lib/x86_64-linux-gnu/libdl.so.2(+0x162d) [0x7ff7f38ba62d]
#12        /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x31) [0x7ff7f38ba0c1]
#13        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam6dlOpenERKNS_8fileNameEb+0x7e) [0x7ff7f42c0b38]
#14        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_8fileNameEb+0x42) [0x7ff7f400404e]
#15        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_10dictionaryERKNS_4wordE+0xa6) [0x7ff7f400446e]
#16        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam4TimeC1ERKNS_4wordERKNS_7argListES3_S3_+0x551) [0x7ff7f401634f]
#17        sprayFoam() [0x48ccfa]
#18        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ff7f2cf5ec5]
#19        sprayFoam() [0x48cb29]
Duplicate entry LES in runtime selection table TurbulenceModel
#0        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam5error14safePrintStackERSo+0x27) [0x7ff7f42c2fc9]
#1        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libcompressibleTurbulenceModels.so(_ZN4Foam15TurbulenceModelINS_17geometricOneFieldENS_14GeometricFieldIdNS_12fvPatchFieldENS_7volMeshEEENS_27compressibleTurbulenceModelENS_11fluidThermoEE31adddictionaryConstructorToTableINS_8LESModelINS_15EddyDiffusivityINS_18ThermalDiffusivityINS_27CompressibleTurbulenceModelIS7_EEEEEEEEEC1ERKNS_4wordE+0xa9) [0x7ff7fcd5d65b]
#2        /home/neo/OpenFOAM/neo-plus/platforms/linux64GccDPInt32Debug/lib/MYlibRASModels.so(+0xac920) [0x7ff7ed7a5920]
#3        /home/neo/OpenFOAM/neo-plus/platforms/linux64GccDPInt32Debug/lib/MYlibRASModels.so(+0xaca1e) [0x7ff7ed7a5a1e]
#4        /lib64/ld-linux-x86-64.so.2(+0x1013a) [0x7ff7fd67d13a]
#5        /lib64/ld-linux-x86-64.so.2(+0x10223) [0x7ff7fd67d223]
#6        /lib64/ld-linux-x86-64.so.2(+0x14c70) [0x7ff7fd681c70]
#7        /lib64/ld-linux-x86-64.so.2(+0xfff4) [0x7ff7fd67cff4]
#8        /lib64/ld-linux-x86-64.so.2(+0x143bb) [0x7ff7fd6813bb]
#9        /lib/x86_64-linux-gnu/libdl.so.2(+0x102b) [0x7ff7f38ba02b]
#10        /lib64/ld-linux-x86-64.so.2(+0xfff4) [0x7ff7fd67cff4]
#11        /lib/x86_64-linux-gnu/libdl.so.2(+0x162d) [0x7ff7f38ba62d]
#12        /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x31) [0x7ff7f38ba0c1]
#13        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam6dlOpenERKNS_8fileNameEb+0x7e) [0x7ff7f42c0b38]
#14        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_8fileNameEb+0x42) [0x7ff7f400404e]
#15        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam14dlLibraryTable4openERKNS_10dictionaryERKNS_4wordE+0xa6) [0x7ff7f400446e]
#16        /home/neo/OpenFOAM/OpenFOAM-plus/platforms/linux64GccDPInt32Debug/lib/libOpenFOAM.so(_ZN4Foam4TimeC1ERKNS_4wordERKNS_7argListES3_S3_+0x551) [0x7ff7f401634f]
#17        sprayFoam() [0x48ccfa]
#18        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ff7f2cf5ec5]
#19        sprayFoam() [0x48cb29]
Create mesh for time = 0
PIMPLE: Operating solver in PISO mode


Reading g
Creating combustion model

Selecting combustion model PaSR<psiChemistryCombustion>
Selecting chemistry type
{
    chemistrySolver ode;
    chemistryThermo psi;
}

Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        reactingMixture;
    transport      sutherland;
    thermo          janaf;
    energy          sensibleEnthalpy;
    equationOfState perfectGas;
    specie          specie;
}

Selecting chemistryReader chemkinReader
Reading CHEMKIN thermo data in new file format
chemistryModel: Number of species = 5 and reactions = 1
Selecting ODE solver seulex
    using integrated reaction rate
Creating component thermo properties:
    multi-component carrier - 5 species
    liquids - 1 components
    solids - 0 components

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RAS
Selecting RAS turbulence model myLaunderSharmaKE
myLaunderSharmaKECoeffs
{
    Cmu            0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
}

Creating field dpdt

Creating field kinetic energy K

No MRF models present

No finite volume options present


Constructing reacting cloud
Constructing particle forces
    Selecting particle force sphereDrag
Constructing cloud functions
    none
Constructing particle injection models
Creating injector: model1
Selecting injection model coneNozzleInjection
    Constructing 3-D injection
Selecting distribution model myRosinRammler
Selecting dispersion model none
Selecting patch interaction model standardWallInteraction
Selecting stochastic collision model none
Selecting surface film model none
Selecting U integration scheme Euler
Selecting heat transfer model RanzMarshall
Selecting T integration scheme analytical
Selecting composition model singlePhaseMixture
Selecting phase change model mySteamCondDropletBoilXx2
Participating liquid species:
    C7H16
Selecting AtomizationModel none
Selecting BreakupModel ReitzDiwakar
Average parcel mass: 2.4e-10
Selecting radiationModel none
Courant Number mean: 0 max: 0

Starting time loop

Courant Number mean: 0 max: 0
deltaT = 2.94118e-06
Time = 2.94118e-06


lifeinhand March 30, 2017 02:01

Hi wolfindark,

I am having a similar issue "Duplicate entry laminar in runtime selection table TurbulenceModel"..... Did you solve yours?

Regards,

Han

wolfindark August 10, 2017 01:00

1 Attachment(s)
Yes I solved.

Check the attached file

JasonWang3 October 13, 2018 08:55

Quote:

Originally Posted by wolfindark (Post 660131)
Yes I solved.

Check the attached file

Hi there,

I am going to make a modification to the LRR model, and make it, but it does not work. I did make the LS model as you did, it work. I noticed that this two models include different shear stress '.H' files.

Do you have any idea if I want to make LRR model in the original OpenFoam.

regards,
Xinguang

calf.Z March 18, 2019 21:19

Quote:

Originally Posted by wolfindark (Post 660131)
Yes I solved.

Check the attached file

I have also encountered the duplicated entry problem, How do you solved it? I have checked the file you uploaded but I have not found the solution.


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