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

Compilation of custom transportModel in OpenFOAM-3.0.1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2016, 08:02
Default Compilation of custom transportModel in OpenFOAM-3.0.1
  #1
Member
 
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11
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:
http://hassankassem.me/posts/newturbulencemodel/

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:

Quote:

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


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

createBaseTransportModel
(
XXXX
);

#define makeNewTransportModel(Type) \


#include "generalizedPowerLaw.H"
makeNewTransportModel(generalizedPowerLaw);

// ************************************************** *********************** //
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.

JOhannes
KingKraut is offline   Reply With Quote

Old   August 29, 2016, 10:44
Default Just in case someone else is making themselves life difficult, too...
  #2
Member
 
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11
KingKraut is on a distinguished road
It was really quite stupid and easy...

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

Quote:
//- 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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 06:29
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 20:00
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14: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 07:25
OpenFOAM Training in Europe and USA hjasak OpenFOAM 0 August 8, 2008 06:33


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