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

How to add additional header / libs to an codedSource

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2021, 07:32
Default How to add additional header / libs to an codedSource
  #1
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
Hello,

I will use an scalarCodedSource in an fvOptions with access to turbulence model functions as the example.

Code:
options
{
sourceTerm1
{
    type            scalarCodedSource;
    selectionMode   cellSet;
    cellSet         myCellSetForSourceTerm1;

    fields          (h);
    name            source1;

    codeInclude
    #{
        #include "fvCFD.H"
        #include "fvc.H"
        //#include "fluidThermo.H"
        //#include "compressibleTurbulenceModel.H"
        //#include "turbulentTransportModel.H"
    #};

    codeCorrect
    #{
    #};

    codeAddSup
    #{
        // get fields
        const scalarField& volume = mesh_.V();

        const volScalarField& cellT = mesh_.lookupObject<volScalarField> ("T");
        const volVectorField& cellU = mesh_.lookupObject<volVectorField> ("U");
        //const dictionary& transportProperties = db().lookupObject<IOdictionary> ("transportProperties");
        const dictionary& transportProperties = mesh_.lookupObject<IOdictionary> ("transportProperties");

        const compressible::turbulenceModel& turbModel = mesh_.lookupObject<compressible::turbulenceModel> (turbulenceModel::propertiesName);
        const fluidThermo& thermo = mesh_.lookupObject<fluidThermo> (basicThermo::dictName);
    #};

    codeConstrain
    #{
    #};
}
}
The compilation (by calling the solver) leads into the errors
Quote:
error: ‘compressible’ does not name a type
error: ‘fluidThermo’ does not name a type
error: ‘thermo’ was not declared in this scope
...
How I can add the information for the additional include path, headers and libs?
Siassei is offline   Reply With Quote

Old   May 15, 2021, 14:59
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Hi,

May be `codeLibs` and/or `codeOptions` help? (I didn't try them).

link

Hope this helps.
HPE is offline   Reply With Quote

Old   May 16, 2021, 04:12
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Siassei View Post
Hello,

I will use an scalarCodedSource in an fvOptions with access to turbulence model functions as the example.

Code:
options
{
sourceTerm1
{
    type            scalarCodedSource;
    selectionMode   cellSet;
    cellSet         myCellSetForSourceTerm1;

    fields          (h);
    name            source1;

    codeInclude
    #{
        #include "fvCFD.H"
        #include "fvc.H"
        //#include "fluidThermo.H"
        //#include "compressibleTurbulenceModel.H"
        //#include "turbulentTransportModel.H"
    #};
...
The compilation (by calling the solver) leads into the errors

How I can add the information for the additional include path, headers and libs?

Remove the comment characters from in front of your include statements?
olesen 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
Condensation as an additional variable Clark Griswold CFX 2 April 21, 2012 07:20
[snappyHexMesh] Add additional boundary layers to complex stl surface tobijingles OpenFOAM Meshing & Mesh Conversion 1 October 26, 2011 10:45
Add additional scalar to turbulence model john_w OpenFOAM 1 December 23, 2010 12:45
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
how to add header file shanu FLUENT 1 February 14, 2006 09:00


All times are GMT -4. The time now is 04:12.