$:dict.entry in fvOptions-file
I am using a caseSetupDict to store parameters for boundary conditions etc. Now i wanted to extend this to my fvOptions files but noticed, that it is not working.
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related. Learn more.
Activity
- Kutalmış Berçin added community label
added community label
- Maintainer
@Juergen I assume that you've used foamDictionary -expand already to confirm that that part is working.
Edited by Mark OLESEN - Author
@mark I used an case that runs nicely with this parameters, but if i switch from hard coded values to variable substitution, it fails. The expansion should look like this:
limitT { type limitTemperature; active yes; selectionMode all; min 200; // $:limitDict.tMin; max 1000; // $:limitDict.tMax; }
- Maintainer
Hi @Juergen - I've tried with v2112 and cannot immediately reproduce your issue. I thought initially that there was an expansion problem, or that fvOptions was not performing the expansion, but that does not seem to be the case.
Of course not a complete test, but please take a look at the attached files (for tutorial buoyantSimpleFoam/comfortHotRoom) fvOptions-example.tar.gz
If you unpack that, the first thing (apart from examining the contents!) is to check that the expansions are working as you expect. For example
$ foamDictionary -expand system/fvOptions
I see no issues.
Next, when running the tutorial, the log file clearly shows the correct limiting values:
Selecting finite volume options type limitTemperature Source: limitTAir - selecting all cells - selected 48000 cell(s) with volume 19.2 Limit min/max: 281 and 311
I have bumped the regular hard-code values of (280, 310) so that we can see if the caseSetupDict values are properly expanded.
A few things for you to consider.
- in your file you do not have the
#remove
directive, which means that the fvOptions may be attempting to use yourlimitDict
entries as an option, but didn't specify a type, selection etc and it all bombs out on you.
For the
#include
you can either not specify the full path (in which case it is relative to the system/fvOptions file), or at least use the more modern and compact<system>
tagging. It simply looks cleaner.For the entries expansion, you can either use the older-style colon/dot notation, but I think that the slash specifiers look more intuitive. They also avoid search ambiguity (eg, should ":a.b.c" mean "/a/b/c", or "/a.b/c" or "/a/b.c" ?)
Please let us know if these modifications make sense to you and if the problem is solved.
- in your file you do not have the
- Author
Hi @mark, thanks for your very detailed description, very interesting stuff.
Indeed, adding "remove limitDict" did the job, thanks.
Regarding this mechanism a new question arises. What if my caseSetupDict has more than 1 entry?
limitDict { tMin 200; tMax 1000; } foo { bar 0; }
Do I have to add the lines
#remove foo; #remove bar;
or is there any nice way to delete all (included from caseSetupDict) dicts (#remove "/caseSetupDict" does not work ;)?
- Maintainer
In any case it would make sense to have your own naming convention instead of thinking about a general foo,bar handling. Take a look at tutorials/incompressible/simpleFoam/squareBend/system/sampling as one possibility.
You could decide on one or two prefixed underscores as your own convention and then use the regex removal
- Author
@mark thank you very, much. This is exactly what I was looking for.
- Jürgen Abraham closed
closed