|
[Sponsors] |
OpenFOAM v2306 Using expressions or Function1 within controlDict file? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 5, 2023, 12:29 |
OpenFOAM v2306 Using expressions or Function1 within controlDict file?
|
#1 |
Senior Member
ONESP-RO
Join Date: Feb 2021
Location: Somwhere on Planet Earth
Posts: 127
Rep Power: 5 |
Hello,
I am using OpenFOAM v2306. I wonder if it is possible to use expressions or Function1 to set the values in controlDict, here is what I mean: Code:
adjustTimeModifiable true; maxCo foo; <<< I want to adjust this using a table of values or using expression
Please note that I am aware of the timeActivatedFileUpdate function object (which is in my exprience becomes quickly confusing, and it is error prone) or using the coded function object to adjust some parameters by using C++ code. The reasons why I don't like using coded Function object:
So my questions are:
any help is appreciated Link to expressions: https://www.openfoam.com/documentati...on-syntax.html |
|
December 8, 2023, 03:48 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40 |
There obviously isn't a trivial way for that at the moment. In general, it should be somewhat doable since controlDict is used almost exclusively by Time, which means it would be possible to have access to a registry and define a Function1 (constant, table, expression, whatever).
It is probably worth taking a look at solution.H, solution.C in OpenFOAM-v2112 or later (commit 53e8f2a807b). There is support for regular Function1 handling for relaxation, which is a similar idea to what you are asking, but it also has a slightly clever approach of caching various Function1 items so that they are only created on-demand once (per field). |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Thermophysical Properties | wsmith02 | OpenFOAM | 4 | June 1, 2023 14:30 |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 03:30 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 17:18 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 12:41 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 19:08 |