|
[Sponsors] |
How to add additional header / libs to an codedSource |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 15, 2021, 07:32 |
How to add additional header / libs to an codedSource
|
#1 | |
Member
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14 |
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 #{ #}; } } Quote:
|
||
May 15, 2021, 14:59 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 16, 2021, 04:12 |
|
#3 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
Quote:
Remove the comment characters from in front of your include statements? |
||
|
|
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 |