|
[Sponsors] |
May 15, 2021, 16:06 |
crazy problem with #calc and blockMeshDict
|
#1 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 288
Rep Power: 6 |
Hi,
Initially I had a problem with getting #calc to work in a blockMeshDict file. But with suggestions from this forum regarding sudo apt-get updates, I got it to work. But then, I copied blockMeshDict to a run directory for a different simulation, and it fails again: "creating block mesh from "system/blockMeshDict" using #calcEntry at line 31 in file "....blockMeshDict" --> FOAM FATAL ERROR (line 31 is the one with lx #calc, below) The same Dict file works in one run directory, but not in another one! This is truly perplexing! I even ran the updates in the new directory, but it didn't help. Any ideas as to this inconsistency? Here are the lines in blockMeshDict in question: xmin -3; xmax 5; ymin -2; ymax 2; zmin 0; zmax 2; deltax 0.1; //cell size in meters deltay 0.1; deltaz 0.1; lx #calc "($xmax) - ($xmin)"; ly #calc "($ymax) - ($ymin)"; lz #calc "($zmax) - ($zmin)"; xcells #calc "round($lx)/($deltax)"; ycells #calc "round($ly)/($deltay)"; zcells #calc "round($lz)/($deltaz)"; Thanks in advance, Alan table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";}tr {mso-height-source:auto;}col {mso-width-source:auto;}br {mso-data-placement:same-cell;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignoreadding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl65 {font-weight:700;}.xl66 {color:#0563C1; text-decoration:underline; text-underline-style:single;} |
|
May 15, 2021, 16:12 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Please completely abandon "#calc" and start using "#eval" directive (link) which is faster, cleaner and stable.
I don't see any lexical or semantic problem in the #calcs. May be the actual problem is that #calc could not be compiled due to some sudo rights, because the error message indicates the first #calc? If that's the case just use #eval since it does not need any compilation (or if you insist on #calc, please ensure that you have proper file rights allowing compilations). Hope this helps a bit.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
July 14, 2023, 08:00 |
|
#3 |
Member
Join Date: Jun 2019
Posts: 41
Rep Power: 7 |
Hi.
In case it may help future generations : I had the following error while using #calc : Code:
--> FOAM FATAL IO ERROR: Failed wmake "dynamicCode/_88c28f6ea7aee10af5a41c01cc48ce917ab7d4a3/platforms/linux64GccDPInt32Opt/lib/libcodeStream_88c28f6ea7aee10af5a41c01cc48ce917ab7d4a3.so" file: /home/user/testOF/testNewSolver/test1:1/system/blockMeshDict from line 17 to line 17. From function static void (* Foam::functionEntries::codeStream::getFunction(const Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&) in file db/dictionary/functionEntries/codeStream/codeStream.C at line 211. I've just named it more normally and it now works.
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. » |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mass flow rate issue | parthigcar | OpenFOAM Running, Solving & CFD | 2 | April 12, 2021 12:03 |
Simulation of a small element of a Hydrodynamic Journal Bearing in Wind Energy Appln | Anuraag | OpenFOAM | 0 | February 24, 2021 10:03 |
[BlockMesh] Problem with blockMesh internal faces | parthigcar | Main CFD Forum | 0 | January 20, 2021 07:10 |
[blockMesh] Creating an axisymmetric piston cylinder in blockMeshDict | foadsf | OpenFOAM Meshing & Mesh Conversion | 9 | August 23, 2018 08:54 |
[blockMesh] blockMesh with parametric mesh. Unusual and unseen problem | 13msmemusman | OpenFOAM Meshing & Mesh Conversion | 1 | June 13, 2016 03:25 |