|
[Sponsors] |
The use of #calc in blockMeshDict works for some numbers, but not for others |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 14, 2023, 15:44 |
The use of #calc in blockMeshDict works for some numbers, but not for others
|
#1 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 288
Rep Power: 6 |
Hi,
Following examples I've seen from others of a parametric blockMeshDict, I created one which initially worked. But when I change the domain size, it fails. Why would it work for one set of numbers, but not for another? In the attached the blockMeshDict file the numbers that work properly are commented out; the numbers that fail are not. The failure message looks in part like this: Code:
Creating block edges No non-planar block faces defined Creating topology blocks --> FOAM FATAL IO ERROR: wrong token type - expected int32_t, found on line 0 the doubleScalar 66.6667 file: /home/boffin5/cfdaero/tyrecase/system/blockMeshDict/blocks at line 0. From function Foam::Istream& Foam::operator>>(Foam::Istream&, int32_t&) in file primitives/ints/int32/int32IO.C at line 62. |
|
February 15, 2023, 04:33 |
|
#2 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
In your blockMeshDict, you have code like this:
Code:
xcells #calc "round($lx)/($deltax)"; Do you see the error? |
|
February 15, 2023, 04:40 |
|
#3 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29 |
Hello
EDIT : Gerhard answered before me and I don't want to spoil his question so I removed my message! Yann |
|
February 15, 2023, 05:56 |
|
#4 | |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
Quote:
You brought up the mismatch between the variable value of 66.6667 and the expected type, i.e., the number of cells needing to be an integer. You highlighted the symptom, while I only pointed out the source of the error without much explanation. |
||
February 17, 2023, 13:58 |
parametric blockMeshDict example
|
#5 |
Senior Member
Alan w
Join Date: Feb 2021
Posts: 288
Rep Power: 6 |
Thank you Gerhard. The response brevity notwithstanding, I did manage to find some references to blockMeshDict.m4, which I know nothing about, and combined with a post from member bjnieuwboer, I was somehow able to create a parametric blockMeshDict.m4 file which seems to work. You just input the domain size, along with the desired cell size, and it creates the meshed domain, after entering 'm4 blockMeshDict.m4 > blockMeshDict. Then you enter 'blockMesh' to actually create the domain in polyMesh.
I have attached the blockMeshDict.m4 file in case anyone is interested. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
crazy problem with #calc and blockMeshDict | boffin5 | OpenFOAM Running, Solving & CFD | 2 | July 14, 2023 08:00 |
Drag force coefficient too high for a flow past a cylinder using komega sst | Scabbard | OpenFOAM Running, Solving & CFD | 37 | March 21, 2016 17:16 |
[blockMesh] Cylindrical mesh with an odd number of circumferential cells | Eldor | OpenFOAM Meshing & Mesh Conversion | 1 | April 16, 2015 05:21 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |