CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Compilation of custom transportModel in OpenFOAM-3.0.1

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   August 26, 2016, 07:02
Default Compilation of custom transportModel in OpenFOAM-3.0.1
New Member
Johannes Martens
Join Date: Jun 2015
Posts: 27
Rep Power: 3
KingKraut is on a distinguished road
Hi all,

I am trying to port a custom transportModel from OpenFOAM2.2.2 to OpenFOAM-3.0.1.

Like for custom turbulenceModels this seems not a straightforward task. Copy&Paste does not work as is described and explained for turbulenceModels in very good detail here:

I suppose similar to this, the compilation and adding of new transportModels to the runTimeSelectionTable is the problem.

As described in the above link, I tried generating a similar function "makeBaseTransportModel" in a newly created file "makeTraModel.C", (compare makeTurModel.C in the link). The output generated from the wmake command in the folder states that the new library is up to date and the inclusion of the library from within the controlDict-file does not give errors either. However, when I give the new transportModel as keyworkd in the constant/transportProperties file, I get the error, that the called viscosityModel does not exist...

The file makeTurModel.C from the above link is based on two different files,
turbulentTransportModels.C and makeTurbulenceModel.H. I looked for similar files (e.g. makeTransportModel, or whatever) in the OpenFOAM/src/ hinting at a correct definition for a function to create a Base transportModel, however could not find anything alike...

The code I am using in makeTraModel.C is the following:


// #include "IncompressibleTurbulenceModel.H"
#include "transportModel.H"
#include "transportModel.C"
#include "addToRunTimeSelectionTable.H"
// #include "makeTurbulenceModel.H"
#include "viscosityModelNew.C"
#include "viscosityModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define createBaseTransportModel(XXXXX)


#define makeNewTransportModel(Type) \

#include "generalizedPowerLaw.H"

// ************************************************** *********************** //
I really don't know, how to define the "createBaseTransportModel" at all, or if this is necessary at all... As I said, the library seems to compile fine, as the library is up to date according to the ouput of wmake. However, it does not work, when I call the keyword for the transportModel from within a simulation case...

I am bit stuck here right now. Is there anyone who has managed to implement a new transportModel in OpenFOAM-3.0.1, so far and give me a hint in which direction I need to look for a solution?

Thanks a lot for looking into this! All help is highly appreciated.

KingKraut is offline   Reply With Quote

Old   August 29, 2016, 09:44
Default Just in case someone else is making themselves life difficult, too...
New Member
Johannes Martens
Join Date: Jun 2015
Posts: 27
Rep Power: 3
KingKraut is on a distinguished road
It was really quite stupid and easy...

The following lines were missing in the generalizedPowerLaw.H file:

//- Return the laminar viscosity for patch
tmp<scalarField> nu(const label patchi) const
return nu_.boundaryField()[patchi];
The way they appear in all of the viscosityModels/{}/{}.H files coming with OpenFOAM-3.0.1 anyway...

No makeTransportModel-File or whatever is needed...
KingKraut is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 6 September 18, 2016 16:23
A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 1 February 28, 2016 20:00
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 OpenFOAM Announcements from Other Sources 2 August 31, 2015 13:36
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
OpenFOAM Training in Europe and USA hjasak OpenFOAM 0 August 8, 2008 05:33

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