|
[Sponsors] |
January 30, 2018, 11:48 |
Coded function object in openfoam v5
|
#1 |
New Member
Fantastic Boy
Join Date: Oct 2017
Posts: 12
Rep Power: 9 |
Greetings,
Recently I upgraded my OpenFOAM 2.1.1 to 5.0. Basically the simulation run smoothly until I insert coded function object into controlDict. The simulation detected the code and the dynamicCode folder is created but in the log file, there is no data generate from the coded function object. I installed swak4foam-dev and compiled correctly. I'm using funkySetFields to generate initial condition for fluid. I tried the method post #12 Create registered object at runtime using a functionObject, unfortunately I got the error of 'functions' entry is not a dictionary. Is the openfoam v5 still support coded function object in 2.1.1? Or the v5 is using new script? Thank You |
|
January 30, 2018, 12:10 |
*Update
|
#2 |
New Member
Fantastic Boy
Join Date: Oct 2017
Posts: 12
Rep Power: 9 |
Eventually wrong symbol was used, and the previous error is gone. But Currently lead to another warning which is No critical "code" prefixed keywords were found. Please check the code documentation for more details.
The things is I double check the code, and it is working in OF 2.1.1. I have no clue at all, anyone please help. Thank You |
|
April 30, 2018, 13:04 |
code keyword has been updated in version 4.x
|
#3 |
Member
Bas Nieuwboer
Join Date: Mar 2013
Posts: 34
Rep Power: 13 |
Hi,
I encountered the same error and came across this bugreport about it. It mentions that you should use the keyword "codeExecute" instead of "code". So a minimal working example would be: Code:
functions { printMinU { functionObjectLibs ( "libutilityFunctionObjects.so" ); enabled true; type coded; redirectType printMinU; writeControl timeStep; writeInterval 1; codeOptions #{ -I$(LIB_SRC)/meshTools/lnInclude #}; codeExecute #{ const volVectorField& U ( mesh().lookupObject<volVectorField>("U") ); Info << "minU = " << min(U) <<endl; #}; } } Last edited by bjnieuwboer; May 1, 2018 at 11:27. |
|
September 29, 2020, 16:43 |
|
#4 | |
Senior Member
Alejandro
Join Date: Jan 2014
Location: Argentina
Posts: 128
Rep Power: 12 |
Quote:
|
||
Tags |
coded functions, openfoam v5 |
|
|
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 4.0 Released | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 2 | October 6, 2017 06:40 |
[foam-extend.org] Error compiling OpenFOAM-1.6-ext | Canesin | OpenFOAM Installation | 137 | January 20, 2016 15:56 |
[swak4Foam] installation problem with version 0.2.3 | Claudio87 | OpenFOAM Community Contributions | 9 | May 8, 2013 11:20 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |