|
[Sponsors] |
March 5, 2021, 12:58 |
Accessing foamDictionary keyword ".*"
|
#1 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14 |
I have the following in my fvSolution file:
Code:
relaxationFactors { equations { ".*" 0.9; U 0.7; } } Code:
Eddy$ foamDictionary -entry relaxationFactors.equations.U -set 0.9 system/fvSolution New entry U 0.9; Code:
Eddy$ foamDictionary -entry relaxationFactors.equations -keywords system/fvSolution ".*" U Code:
Eddy$ foamDictionary -entry 'relaxationFactors.equations.".*"' system/fvSolution --> FOAM FATAL IO ERROR: Cannot find entry relaxationFactors.equations.".*" Edit: ofc, I could do some dirty hacking with Code:
sed 's/"\.\*"/banana/' system/fvSolution |
|
March 5, 2021, 15:53 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
What if you just used sed to replace that entire line? Not as nice as getting foamDictionary to figure out the location for you, but will circumvent the problem you mentioned in the edit.
Caelan
__________________
Public git repository : https://github.com/clapointe2011/public |
|
March 5, 2021, 16:25 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14 |
Thanks Caelen - yes, that could be a slightly less ugly solution. The good news (thanks to Henry for a quick bug report response) is that the problem is fixed at the moment in the dev version, which clearly has a more advanced suite of dictionary tools. I am just scratching my head now whether I want to (or indeed, can) splice these changes into my v8 distribution, or just live with the ugly hack approach.
Thanks for your input. |
|
March 5, 2021, 16:46 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14 |
The answer is - live with it for this patch; the dictionary system has been updated in dev, and will be available in the next major release.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh error "Cannot determine normal vector from patches." | lethu | OpenFOAM Meshing & Mesh Conversion | 1 | June 3, 2020 07:49 |
Problem calling foamDictionary in docker from a python notebook | Hisham | OpenFOAM Pre-Processing | 0 | January 7, 2020 07:52 |
[OpenFOAM.com] OpenFOAMv1806 with amd aocc 1.2 / 1.3 compiler | cfdx | OpenFOAM Installation | 10 | February 27, 2019 04:59 |
Fatal error: invalid wall function specification | kcc49 | OpenFOAM Running, Solving & CFD | 13 | September 26, 2018 04:07 |
chtMultiRegionSimpleFoam: crash on parallel run | student666 | OpenFOAM Running, Solving & CFD | 3 | April 20, 2017 11:05 |