|
[Sponsors] |
Access simulation time in dictionary expression |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 1, 2021, 10:28 |
Access simulation time in dictionary expression
|
#1 |
New Member
Join Date: Oct 2019
Posts: 10
Rep Power: 6 |
Hello everyone,
I am trying to define a a time dependent rotation axis in my dynamicMeshDict. I think I also found the right tools here: https://www.openfoam.com//documentat...on-syntax.html In my dynamicMeshDict I now want to define axisy as: FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // axisx 0; axisy #eval "time()"; axisz 1; ... Upon running pimpleFoam this gives me the error: Object time does not exist or wrong type in expression <<<< time() >>>> When I instead use "pi()" instead of "time()" it correctly sets axisy to 3.141 etc. In the documentation it says about the "time()"-function: time() : the current simulation time-value (if used by the parser) So maybe it has something to do with the parser? I wouldn't know how to change that, though. Does anybody know what to do and could help me? Thanks in advance. Greetings, Kraneberger |
|
September 1, 2021, 17:44 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66 |
PI() is a mathematical function in the math library which is linked in almost every compiled solver. This is like trying to do 2*1.
time() tries to retrieve the Foam::Time object, the variable that stores the time that you want, which isn't even created until runtime and is associated with a mesh object or a field object. E.g. mesh.time() You are trying to make a declaration in a dict. Unfortunately I don't know enough about any of the DyM solvers to fix your issue. |
|
September 2, 2021, 02:18 |
|
#3 |
New Member
Join Date: Oct 2019
Posts: 10
Rep Power: 6 |
I see, thanks for the quick answer. Is there a way to include or create a Foam object that I could then call *.time() on. For example with #codeStream?
I am using v2012. Greetings, Kraneberger |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LES, Courant Number, Crash, Sudden | Alhasan | OpenFOAM Running, Solving & CFD | 5 | November 22, 2019 02:05 |
laplacianFoam with source term | Herwig | OpenFOAM Running, Solving & CFD | 17 | November 19, 2019 13:47 |
How to export time series of variables for one point? | mary mor | OpenFOAM Post-Processing | 8 | July 19, 2017 10:54 |
Problem with an old Simulation | FrankW | CFX | 3 | February 8, 2016 04:28 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 06:51 |