|
[Sponsors] |
std::ceil fails when using #calc in blockMeshDict |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 10, 2018, 10:25 |
std::ceil fails when using #calc in blockMeshDict
|
#1 | |
Member
Axel
Join Date: May 2016
Location: Augsburg, Germany
Posts: 46
Rep Power: 9 |
Hi everybody,
I am trying to calculate the appropiate number of cells in a blockMeshDict using the #calc operation. Basically what I am doing is this: Code:
x1 1.7; y1 2.1; x2 2.1; y2 2.05; x3 2.5; y3 2.3; nBlock1XCells 20; nBlock1YCells #calc "std::ceil((y1 - y2) * 20)"; Quote:
Best regards, Axel |
||
December 3, 2019, 10:14 |
|
#2 |
New Member
Join Date: Nov 2019
Posts: 3
Rep Power: 6 |
I have the same error, but the problem is slightly more general. For me the error comes from using #calc in the first place. Even simple multiplications result in the same error
|
|
December 4, 2019, 07:02 |
|
#3 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28 |
You need to use your variables properly. The rules of OpenFOAM's macro expansion apply.
Code:
NZ4 #calc "std::ceil( ($Z4 - $Z3) / $dz )"; |
|
December 29, 2019, 17:04 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12 |
FYI// The new #eval expression replacing #calc is pretty powerful and much more faster than #calc //FYI
__________________
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Writing a if loop in the blockMeshDict file | eroussel | OpenFOAM Programming & Development | 0 | April 20, 2018 11:39 |
[blockMesh] blockMesh with parametric mesh. Unusual and unseen problem | 13msmemusman | OpenFOAM Meshing & Mesh Conversion | 1 | June 13, 2016 02:25 |
Drag force coefficient too high for a flow past a cylinder using komega sst | Scabbard | OpenFOAM Running, Solving & CFD | 37 | March 21, 2016 16:16 |
cannot converge a pimpleFoam simulation | iper88 | OpenFOAM Running, Solving & CFD | 1 | November 26, 2015 08:04 |
[blockMesh] Cylindrical mesh with an odd number of circumferential cells | Eldor | OpenFOAM Meshing & Mesh Conversion | 1 | April 16, 2015 04:21 |