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

New turbulence model in OF 3 and no proper make file?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2016, 03:01
Default New turbulence model in OF 3 and no proper make file?
  #1
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   March 10, 2016, 03:23
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,

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".
alexeym is offline   Reply With Quote

Old   March 10, 2016, 03:37
Default
  #3
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
Quote:
Originally Posted by alexeym View Post
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   March 10, 2016, 03:52
Default
  #4
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
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.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   March 10, 2016, 04:06
Default
  #5
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 15
Mojtaba.a is on a distinguished road
Send a message via Skype™ to Mojtaba.a
I manually added links for .C and .H files into:

Code:
$SRC/TurbulenceModels/turbulenceModels/lnInclude
And it solved the problem.
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"
Mojtaba.a is offline   Reply With Quote

Old   March 19, 2016, 22:37
Default
  #6
Member
 
Neilson Whit
Join Date: Aug 2011
Posts: 74
Rep Power: 14
wolfindark is on a distinguished road
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
Attached Files
File Type: zip MYturbulenceModels.zip (10.8 KB, 32 views)
wolfindark is offline   Reply With Quote

Old   March 30, 2017, 02:01
Default
  #7
New Member
 
Han Li
Join Date: Jul 2015
Location: College Station
Posts: 16
Rep Power: 10
lifeinhand is on a distinguished road
Hi wolfindark,

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

Regards,

Han
lifeinhand is offline   Reply With Quote

Old   August 10, 2017, 01:00
Default
  #8
Member
 
Neilson Whit
Join Date: Aug 2011
Posts: 74
Rep Power: 14
wolfindark is on a distinguished road
Yes I solved.

Check the attached file
Attached Files
File Type: zip MYturbulenceModels-copy.zip (31.5 KB, 50 views)
wolfindark is offline   Reply With Quote

Old   October 13, 2018, 08:55
Default
  #9
Member
 
Xinguang Wang
Join Date: Feb 2015
Posts: 45
Rep Power: 11
JasonWang3 is on a distinguished road
Quote:
Originally Posted by wolfindark View Post
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
JasonWang3 is offline   Reply With Quote

Old   March 18, 2019, 21:19
Default
  #10
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by wolfindark View Post
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.
calf.Z is offline   Reply With Quote

Reply


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



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