m4 and blockMesh
Hello,
I have a rather simple question about using m4 to generate blockMeshDicts in OpenFOAM 2.3.0. I want to specify the dimension of my domain in an m4 blockMeshDict where all dimensions are based on a characteristic length. In order to use snappyHexMesh i'm using the same spacing in all three directions to have an aspect ratio of 1. Now I'm just wondering if there's a simple command that would give me the output of the calculation below as integer to that it can be used in blockMesh? Code:
define(nrcellsx,calc((((dd+ud))/delta))) |
Hi,
I guess, you'd like to do floating point calculations as for integer expressions there is eval macro (https://www.gnu.org/savannah-checkou...Eval.html#Eval). You can try something like this (maybe there is easier way): Code:
define(`calc', `esyscmd(echo "scale = 10; $1" | bc)')dnl |
Hi Alexey,
thanks for your reply. Using your suggestions and the example from the OpenFOAM wiki I've come up with this now Code:
changecom(//)changequote([,]) |
All times are GMT -4. The time now is 16:20. |